Changes between Initial Version and Version 1 of Using_SIP_TCP


Ignore:
Timestamp:
Apr 13, 2012 5:00:11 AM (13 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Using_SIP_TCP

    v1 v1  
     1{{{ 
     2#!html 
     3<!-- MAIN TABLE START --> 
     4<table border=0 width="90%" align="center"><tr><td> 
     5}}} 
     6 
     7= Using SIP TCP Transport = 
     8 
     9'''Table of Contents''' 
     10[[PageOutline(2-3,,inline)]] 
     11 
     12[[BR]] 
     13 
     14== Enabling TCP support == 
     15 
     16First you must instantiate SIP TCP transport in your application. The TCP transport is enabled by default on ''pjsua'' so you can skip this test if you're using pjsua. 
     17 
     18 
     19== Sending Initial Requests == 
     20 
     21PJSIP only sends the request with TCP if the destination URI contains ''";transport=tcp"'' parameter. Adding this parameter can be accomplished in two ways: 
     22 1. the most convenient way is to add a route-set entry (with proxy or outbound proxy setting) 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: 
     23 {{{ 
     24pjsua_acc_config acc_cfg; 
     25 
     26... 
     27acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str("sip:proxy.example.com;transport=tcp"); 
     28          
     29 }}} 
     30 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 call, the target URI when sending MESSAGE, etc.). For example, to make outgoing call with TCP: 
     31 {{{ 
     32pj_str_t dst = pj_str("sip:alice@example.net;transport=tcp"); 
     33 
     34status = pjsua_call_make_call(acc_id, &dst, NULL, NULL, NULL, NULL); 
     35 }}} 
     36 
     37== Contact Header == 
     38 
     39With PJSUA-LIB, when making or receiving calls with TCP, the local Contact header will automatically be adjusted to use the TCP transport. 
     40 
     41== Subsequent Requests == 
     42 
     43Subsequent requests means subsequent request that is sent within the call (dialog), for example UPDATE, BYE, re-INVITE to hold the call, and so on. 
     44 
     45 
     46== Additional Info about Registration == 
     47 
     48The client registration session also will keep the TCP connection active throughout the registration session, and server may send inbound requests using this TCP connection if it wants to.  
     49 
     50 
     51{{{ 
     52#!html 
     53<!-- MAIN TABLE END --> 
     54</td></tr></table> 
     55}}} 
     56