Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorials:alias-example [2010/07/09 09:17] 87.93.23.172 |
tutorials:alias-example [2011/04/22 21:09] 87.93.81.21 |
||
---|---|---|---|
Line 5: | Line 5: | ||
The benefits of using add_contact_alias() and handle_ruri_alias() functions instead of conventional NAT traversal solutions are: | The benefits of using add_contact_alias() and handle_ruri_alias() functions instead of conventional NAT traversal solutions are: | ||
- | * support for re-use of tcp sessions between proxy and UAs | + | * Request-URI in requests to UAs behind NATs is always what UAs expect |
- | * supports for routing of requests to UAs behind NATs so that r-uri is always what UAs expect | + | * Re-use of tcp/tls sessions between proxy and UAs |
In the example below only functions related to signaling are shown. | In the example below only functions related to signaling are shown. | ||
Line 12: | Line 12: | ||
===== Non-Register Initial Requests ===== | ===== Non-Register Initial Requests ===== | ||
- | Call add_contact_alias() | + | Call add_contact_alias() |
- | don't come from another | + | come from UAs behind NAT or which don't come via a proxy and transport protocol is not UDP. |
If you know that non-register initial request is going to another | If you know that non-register initial request is going to another | ||
proxy, set TO_PROXY flag before relaying the request. | proxy, set TO_PROXY flag before relaying the request. | ||
Line 24: | Line 24: | ||
route [NON_REGISTER_INITIAL_REQUESTS] { | route [NON_REGISTER_INITIAL_REQUESTS] { | ||
- | if (!is_present_hf(" | + | if (REQUEST_COMES_FROM_BEHIND_NAT || (!is_present_hf(" |
route(ADD_CONTACT_ALIAS); | route(ADD_CONTACT_ALIAS); | ||
}; | }; | ||
Line 50: | Line 50: | ||
===== Register Requests ===== | ===== Register Requests ===== | ||
- | Call fix_nated_register() on register requests, if registering | + | Call fix_nated_register() on register requests, if registering |
- | behind | + | behind |
< | < | ||
route [REGISTER_REQUESTS] { | route [REGISTER_REQUESTS] { | ||
... | ... | ||
- | if (isflagset(FROM_NATED) || (proto == TCP)) { | + | if (isflagset(FROM_NATED) || (proto |
fix_nated_register(); | fix_nated_register(); | ||
if (isflagset(FROM_NATED)) { | if (isflagset(FROM_NATED)) { | ||
Line 69: | Line 69: | ||
===== In-Dialog Requests ===== | ===== In-Dialog Requests ===== | ||
- | Call alias_contact() for all in-dialog requests that don't come | + | Call add_contact_alias() on all in-dialog requests |
- | from another proxy. | + | from another proxy and transport protocol is not UDP. Call handle_ruri_alias() for all in-dialog requests before |
- | t_relaying them to UAs. | + | t_relaying them to UAs. |
- | didn't set $du. | + | didn't set $du. |
+ | < | ||
route [IN_DIALOG_REQUESTS] { | route [IN_DIALOG_REQUESTS] { | ||
- | if (@via[2] == "" | + | if (REQUEST_COMES_FROM_BEHIND_NAT || ((@via[2] == "" |
route(ADD_CONTACT_ALIAS); | route(ADD_CONTACT_ALIAS); | ||
} | } | ||
Line 101: | Line 102: | ||
... | ... | ||
} | } | ||
+ | </ | ||
===== Replies ===== | ===== Replies ===== | ||
Line 107: | Line 109: | ||
another proxy. | another proxy. | ||
+ | < | ||
onreply_route [REPLY] { | onreply_route [REPLY] { | ||
Line 120: | Line 123: | ||
... | ... | ||
} | } | ||
+ | </ | ||
===== Notes ===== | ===== Notes ===== |