Changes between Version 2 and Version 3 of Using_SIP_TCP


Ignore:
Timestamp:
Apr 16, 2012 4:05:06 AM (8 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Using_SIP_TCP

    v2 v3  
    1414== Enabling TCP support == #enable 
    1515 
    16 TCP support must be enabled in the build by setting '''{{{PJ_HAS_TCP}}}''' to non-zero (it is enabled by default). You must then instantiate SIP TCP transport in your application, e.g.: 
     16TCP support must be enabled in the build by setting '''{{{PJ_HAS_TCP}}}''' to non-zero. This is enabled by default, hence normally there's no specific step to do to enable this. You must then instantiate SIP TCP transport in your application, e.g.: 
    1717 
    1818 {{{ 
     
    2929== Sending Initial Requests == #initial 
    3030 
    31 According to SIP spec, a request is sent to the URI in the ''Route'' header if it is present, or to the request URI if not. PJSIP only sends the request with TCP if the destination URI contains ''";transport=tcp"'' parameter. Hence sending a request with TCP can be accomplished in two ways: 
     31According to SIP spec, a request is sent to the address in the destination URI, which is the URI in the ''Route'' header if it is present, or to the request URI if there is no Route header. PJSIP only sends the request with TCP if the destination URI contains ''";transport=tcp"'' parameter. Hence to send request with TCP, the destination URI must contain this parameter. This can be accomplished in two ways: 
    3232 
    33  1. the most convenient way is to add a route-set entry (with proxy or outbound proxy setting in the account config) containing URI with TCP transport. This way all '''initial''' requests will be sent with TCP via the proxy, and we don't need to change the URI for the registrar and all buddies in the buddy list. Sample code: 
     33 1. The most convenient way is to add a route-set entry (with proxy or outbound proxy setting in the account config) containing URI with TCP transport. This way all '''initial''' requests will be sent with TCP via the proxy, and we don't need to change the URI for the registrar and all buddies in the buddy list. Sample code: 
    3434 {{{ 
    3535pjsua_acc_config acc_cfg; 
     
    3939          
    4040 }}} 
    41  2. if you don't want to configure route set entry, then you must add ''";transport=tcp"'' parameter to all outgoing URIs (the registrar URI, the buddy URI, the target URI when making calls, the target URI when sending MESSAGE, etc.). For example, to make outgoing call with TCP: 
     41 If the destination doesn't like the additional ''Route'' header, you can hide this Route header by adding ''";hide"'' parameter to the route URI, for example: 
     42 {{{ 
     43   "sip:proxy.example.com;transport=tcp;hide" 
     44 }}} 
     45 This way PJSIP will process the request as if the Route header is present, but the header itself will not actually put in the transmission. 
     46 
     47 2. If you don't want to configure route set entry, then you must add ''";transport=tcp"'' parameter to all outgoing URIs (the registrar URI, the buddy URI, the target URI when making calls, the target URI when sending MESSAGE, etc.). For example, to make outgoing call with TCP: 
    4248 {{{ 
    4349pj_str_t dst = pj_str("sip:alice@example.net;transport=tcp");