[asterisk-bugs] [Asterisk 0004903]: [patch] SIP over TCP project

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Aug 10 08:12:30 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=4903 
====================================================================== 
Reported By:                hjlee
Assigned To:                oej
====================================================================== 
Project:                    Asterisk
Issue ID:                   4903
Category:                   Channels/chan_sip
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 46875 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             08-05-2005 00:41 CDT
Last Modified:              08-10-2007 08:12 CDT
====================================================================== 
Summary:                    [patch] SIP over TCP project
Description: 
I added TCP support to asterisk SIP channel. I put all my changes under
#ifdef SIP_TCP_SUPPORT and left the original code. So if you search
SIP_TCP_SUPPORT, you can find my changes very easily.

My changes
-Added TCP listening socket, siptcpsock.
-Added securechannel, sockfd, transport field to struct sip_pvt.
-Added transport, tcpsockfd field to struct sip_peer.
-Added TCP read in sipsock_read().
-Added siptcp_accept() to accept an incoming TCP connection request.
-Added transport, q parameter processing in Contact header parsing.
-Changed the hard-coded "UDP" in Via header to copy sip_pvt.transport.
-Added tcp_conenct() to make a TCP connection for outgoing message.
-Added TCP transmit in __sip_xmit().
-Saved TCP connecton socket to sip_peer.tcpsockfd, copied it to
sip_pvt.sockfd when OPTIONS or INVITE is sent to the peer that is using
TCP.

I tested it mainly xlite(UDP only free version) and Jain-SIP communicator.
call signal is working well. One problem I am having is Jain-SIP
communicator doesn't receive any audio, I don't know why. If any one has
xlite-pro(TCP supported commercial version) or TCP supported SIP clients, I
am looking forward to hear the test result.

Welcome any comment.
Thanks

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0004904 [patch] SIP over TCP project
related to          0010354 Add Basic Support For RFC 4662 (Subscri...
====================================================================== 

---------------------------------------------------------------------- 
 irroot - 08-10-07 08:12  
---------------------------------------------------------------------- 
thx for the 411.

as im trying to do the bare bones and try keep inline with the RFC here a
few things required.

in the hope of it benifiting ill continue ... besides im learning a bit
more about sip at the same time 

from the RFC
----------
   All SIP elements MUST implement UDP and TCP.  SIP elements MAY
   implement other protocols.

      Making TCP mandatory for the UA is a substantial change from RFC
      2543.  It has arisen out of the need to handle larger messages,
      which MUST use TCP, as discussed below.  Thus, even if an element
      never sends large messages, it may receive one and needs to be
      able to handle them.

   o  RFC 2543 mandated retransmission of INVITE responses over TCP, but
      noted it was really only needed for 2xx.  That was an artifact of
      insufficient protocol layering.  With a more coherent transaction
      layer defined here, that is no longer needed.  Only 2xx responses
      to INVITEs are retransmitted over TCP.

Timer changes

Timer D  > 32s for UDP    Section 17.1.1.2     Wait time for response
         0s for TCP/SCTP                       retransmit
Timer I  T4 for UDP       Section 17.2.1       Wait time for
         0s for TCP/SCTP                       ACK retransmits
Timer J  64*T1 for UDP    Section 17.2.2       Wait time for
         0s for TCP/SCTP                       non-INVITE request
Timer K  T4 for UDP       Section 17.1.2.2     Wait time for
         0s for TCP/SCTP                       response retransmits
Timer A  initially T1     Section 17.1.1.2     INVITE request retransmit
                                               interval, for UDP only 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-10-07 08:12  irroot         Note Added: 0068705                          
======================================================================




More information about the asterisk-bugs mailing list