Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:alias-example [2010/12/29 14:45] 192.98.100.130 |
tutorials:alias-example [2013/06/08 08:42] (current) jh [In-Dialog Requests] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | The benefits | + | The benefit |
- | + | ||
- | * Request-URI in requests to UAs behind NATs is always what UAs expect | + | |
- | * Re-use of tcp sessions between proxy and UAs (optional) | + | |
- | + | ||
- | In the example below only functions related to signaling are shown. | + | |
===== 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 18: | ||
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 44: | ||
===== 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) || (proto == TLS)) { | + | if (isflagset(FROM_NATED) || (proto |
fix_nated_register(); | fix_nated_register(); | ||
if (isflagset(FROM_NATED)) { | if (isflagset(FROM_NATED)) { | ||
Line 69: | Line 63: | ||
===== In-Dialog Requests ===== | ===== In-Dialog Requests ===== | ||
- | Call add_contact_alias() | + | Call add_contact_alias() |
- | 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. Next hop is an UA if loose_route() | t_relaying them to UAs. Next hop is an UA if loose_route() | ||
didn't set $du. If next hop is a proxy, set TO_PROXY flag. | didn't set $du. If next hop is a proxy, set TO_PROXY flag. | ||
Line 77: | Line 71: | ||
route [IN_DIALOG_REQUESTS] { | route [IN_DIALOG_REQUESTS] { | ||
- | if (@via[2] | + | if (REQUEST_COMES_FROM_BEHIND_NAT || (is_first_hop() && (proto != UDP))) { |
route(ADD_CONTACT_ALIAS); | route(ADD_CONTACT_ALIAS); | ||
} | } |