Changes between Initial Version and Version 1 of Using_SIP_TCP

Apr 13, 2012 5:00:11 AM (8 years ago)



  • Using_SIP_TCP

    v1 v1  
     3<!-- MAIN TABLE START --> 
     4<table border=0 width="90%" align="center"><tr><td> 
     7= Using SIP TCP Transport = 
     9'''Table of Contents''' 
     14== Enabling TCP support == 
     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. 
     19== Sending Initial Requests == 
     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; 
     27acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(";transport=tcp"); 
     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(";transport=tcp"); 
     34status = pjsua_call_make_call(acc_id, &dst, NULL, NULL, NULL, NULL); 
     35 }}} 
     37== Contact Header == 
     39With PJSUA-LIB, when making or receiving calls with TCP, the local Contact header will automatically be adjusted to use the TCP transport. 
     41== Subsequent Requests == 
     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. 
     46== Additional Info about Registration == 
     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.  
     53<!-- MAIN TABLE END -->