I am not sure if I understand the question, but are you asking about how to use the ephemeral port that is created when a UAC sends a request, as the port in Contact header? If yes, then the port in Contact header should be the local listener port on which the UA is listening for sip requests and not the ephemeral port. That port will be used by the UAS/proxy to route the response and is not meant to be used for requests in the backward direction. The UAS/proxy needs to create another connection in the backward direction on which requests on that dialog will be sent. There are security consideration with using the same connection for requests from backward direction.
If that's not what you are asking, pl. explain the question. Thanks Sanjay >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >[EMAIL PROTECTED] >Sent: Tuesday, February 06, 2007 1:40 AM >To: [email protected]; >[EMAIL PROTECTED] >Subject: [Sip-implementors] TCP question - Proper way to >Construct ContactURIs > >Hi, > >I am currently working on the TCP transport for the >opensipstack library. I have a few doubts on how to properly >construct the Contact address for outbound INVITEs. On >construction of the INVITE request, the UA Core doesn't have >an idea about the port the transport would be providing to >send the request and it would be impossible to guess this >before the actual request hits the Transport Unit. Currently, >the stack populates the Via and Contact URIs with the address >of the default >listener on port 5060. Upon detection that the request is bound to a >TCP destination, the transaction would change the top most via >address with the socket created by the Transport to be sure >that responses would be sent using the same socket. However, >this approach cannot be used for the Contact URI since the >contact might be the remote address of a request being >proxied. Thus, the Contact address should remain intact for >proxy transactions and only change it if the request is >actually originated from the local UA. An extra sanity check >is needed and see if Contact URI == local listener. This >would work but I am in doubt that this is the best way to do >it. My goal is to use the socket for the entire lifespan of >the dialog without having to inject transport >logic into the core level. I wonder what's the popular >approach to do >this. Any advice on how to do this the right way would be >appreciated. > >Thanks! > >----------------------------- >Joegen E. Baclor >http://www.opensipstack.org >_______________________________________________ >Sip-implementors mailing list >[email protected] >https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors > _______________________________________________ Sip-implementors mailing list [email protected] https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
