Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
tutorials:alias-example [2011/04/22 20:26]
87.93.81.21
tutorials:alias-example [2011/04/22 21:09]
87.93.81.21
Line 6: Line 6:
  
   * Request-URI in requests to UAs behind NATs is always what UAs expect   * Request-URI in requests to UAs behind NATs is always what UAs expect
-  * Re-use of tcp sessions between proxy and UAs (optional)+  * Re-use of tcp/tls sessions between proxy and UAs
  
 In the example below only functions related to signaling are shown.  Proxying of media using either Mediaprxy or RTP Proxy can be easily added. In the example below only functions related to signaling are shown.  Proxying of media using either Mediaprxy or RTP Proxy can be easily added.
Line 50: Line 50:
 ===== Register Requests ===== ===== Register Requests =====
  
-Call fix_nated_register() on register requests, if registering ua is +Call fix_nated_register() on register requests, if registering UA is 
-behind nat OR is using tcp.+behind NAT or transport protocol is not UDP.
  
 <code> <code>
 route [REGISTER_REQUESTS] { route [REGISTER_REQUESTS] {
     ...     ...
-    if (isflagset(FROM_NATED) || (proto == TCP) || (proto == TLS)) {+    if (isflagset(FROM_NATED) || (proto !UDP)) {
         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 add_contact_alias() on all in-dialog requests that come from behind NAT or (if you want re-use of TCP sessions) that don't come +Call add_contact_alias() on all in-dialog requests that come from behind NAT or that don't come 
-from another proxy.  Call handle_ruri_alias() for all in-dialog requests before+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 77:
 route [IN_DIALOG_REQUESTS] { route [IN_DIALOG_REQUESTS] {
  
-    # Choose this test (and delete the next) if you don't care about re-use of TCP sessions +    if (REQUEST_COMES_FROM_BEHIND_NAT || ((@via[2] == "") && (proto != UDP))) {
-    if (REQUEST_COMES_FROM_BEHIND_NAT) { +
-        route(ADD_CONTACT_ALIAS); +
-    } +
-    # Choose this test (and delete the previous) if you want re-use of TCP sessions +
-    if (@via[2] == "") {+
         route(ADD_CONTACT_ALIAS);         route(ADD_CONTACT_ALIAS);
     }     }

Navigation

Wiki

Other

QR Code
QR Code tutorials:alias-example (generated for current page)