< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] Sending INVITE over TCP


I am trying to use the resiprocate stack to send INVITE's over TCP.
The transport type is determined on the basis of the value set in the Request-URI.  The default transport is scheme dependent. For sip:, it is UDP. For sips:, it is TCP.  Im using sip, so need to explicitly set transport=TCP in the request-uri.
 
The steps Ive followed are :
a.    Add TCP transport to the stack.
        g_sipStack->addTransport(TCP, g_sipPort);
b.    Use TCP as the transport type in the required headers (To, From, Contact)
c.    I ve used Helper::makeInvite to build the INVITE.
        Helper::makeInvite( dest, from, contact)
 
The stack still tries to send the message via UDP.
 
Debugging
---------------
*    Helper::MakeInvite uses Helper::MakeRequest in which the RequestLine is determined using the target.uri.
*    When I send the message, the TransportSelector calls "mDns.lookup(result, msg->header(h_RequestLine).uri());" that further calls "DnsResult::lookup" which returns UDP since the condition "if (uri.exists(p_transport))" in that member function evaluates to false and it therefore uses the default type of UDP.
 
I can send the sample code as well. Any pointers as to what Im missing.
 
The log output is as follows :
DEBUG | 20051020-143206.511 | UAC | RESIP:TRANSPORT | 6124 | ConnectionBase.cxx:29 | ConnectionBase::ConnectionBase, no params: 00FD7E08
DEBUG | 20051020-143206.527 | UAC | RESIP:TRANSPORT | 6124 | InternalTransport.cxx:85 | Creating fd=3804 V4/TCP
DEBUG | 20051020-143206.527 | UAC | RESIP:TRANSPORT | 6124 | InternalTransport.cxx:93 | Binding to 0.0.0.0
INFO | 20051020-143206.543 | UAC | RESIP:TRANSPORT | 6124 | TcpTransport.cxx:27 | Creating TCP transport host= port=5060 ipv4=1
INFO | 20051020-143206.558 | UAC | RESIP:TRANSPORT | 6124 | UdpTransport.cxx:30 | Creating UDP transport host= port=5060 ipv4=1
DEBUG | 20051020-143206.558 | UAC | RESIP:TRANSPORT | 6124 | InternalTransport.cxx:85 | Creating fd=3784 V4/UDP
DEBUG | 20051020-143206.558 | UAC | RESIP:TRANSPORT | 6124 | InternalTransport.cxx:93 | Binding to 0.0.0.0
DEBUG | 20051020-143217.496 | UAC | RESIP | 4468 | SipStack.cxx:267 | SEND: SipReq:  INVITE
8665722037@xxxxxxxxxx:5060 tid=fb36831df16a5517 cseq=INVITE contact=0@xxxxxxxxxxx:5060 / 1 from(tu)
DEBUG | 20051020-143217.511 | UAC | RESIP:TRANSACTION | 6124 | TimerQueue.cxx:85 | Adding timer: Timer B tid=fb36831df16a5517 ms=32000
DEBUG | 20051020-143217.511 | UAC | RESIP:TRANSPORT | 6124 | TransportSelector.cxx:243 | Looking up dns entries for sip:8665722037@xxxxxxxxxx:5060
DEBUG | 20051020-143217.511 | UAC | RESIP:DNS | 6124 | DnsResult.cxx:183 | DnsResult::lookup sip:8665722037@xxxxxxxxxx:5060
DEBUG | 20051020-143217.511 | UAC | RESIP:DNS | 6124 | DnsResult.cxx:291 | Numeric result so return immediately: [ V4 10.10.1.14:5060 UDP connectionId=0 ]
DEBUG | 20051020-143217.527 | UAC | RESIP:TRANSACTION | 6124 | TimerQueue.cxx:85 | Adding timer: Timer A tid=fb36831df16a5517 ms=500
DEBUG | 20051020-143217.527 | UAC | RESIP:TRANSPORT | 6124 | TransportSelector.cxx:479 | Looked up source for destination: [ V4 10.10.1.14:5060 UDP connectionId=0 ] -> [ V4 10.10.1.151:5060 UDP connectionId=0 ] sent-by= sent-port=5060
 
 
Thanks,
Mehul.