Tuesday, July 5, 2011

Sending SIP Requests with TCP mode enabled.

First of all we need to know - why TCP is required over UDP ?

The problem occurs when the application attempts to send out a request over UDP, and the request message exceeds the MTU (Message Transfer Unit) size. By default, the MTU boundary is 1300 bytes. If the request is larger than the MTU size, the underlying stack is responsible to switch the transport connection from UDP to TCP.

This process is explained in section 18.1.1 of RFC 3261. (Courtesy - Swarnapriya)
For more info visit 18.1.1 (Page 141-142) of http://tools.ietf.org/html/rfc3261

Here are the steps to send SIP request using Glassfish/sailfin with TCP :

1. Start the Server and login to admin console (http://localhost:4848) (Note : Admin port is configurable so check your admin port in config settings).
2. Now in Sidebar go to Configurations Link ---> Sip Service as shown below :

3. Now Click on SIP Protocol Tab on SIP Service Page and check the "Default Transport" Enabled check box as shown below :

4. Now your SIP Application Server is ready for SIP Transmission via TCP. 

5. As far as I concerned Sipp is the tool most of the SIP Programmers use for testing SIP Servlets. Using Sipp you can write scenario files describing the flow of your requests in XML and then from command line you can run that scenario file which will hit your SIP Servlet and shows the result. For more information on how to use Sipp for testing and for sample sipp scenario files visit another post of this Blog.

6. At this point I hope you read lot about Sipp, so I am directly jumping on the command option you have to write for enable transport=tcp. In the command you write for running the Scenario file you have to add -t t1 at the end of command but before the -timeout option if you are using one in your command.
    Depending on the value of -t parameter, this will take the values "UDP", "TCP" etc.
    t1: TCP with one socket
    u1: UDP with one socket (default)
    l1: TLS with one socket. etc...
    Example Commands : 
    UAC : sipp -sf <scenario file> <server ip>:<server port> -i <client ip> -p <client port> -m 1 
    -mp 7000 -cp 8990 -t t1 -timeout 20s
    UAS : sipp -sf <scenario file> <server ip>:<server port> -i <client ip> -p <client port> -m 1 
               -t t1 -timeout 40s
    Regards : Basit { theTechnoCreative(); }

    1 comment: