If I understand what you are trying to do, your redirect server is essentially the "outbound proxy" for your client UA. What you want to do is insert a Route header in the request with the address/host of your redirect server (see section 8.1.2 of RFC 3261). Note that this Route header should have the "lr" parameter to conform to the loose routing described in RFC 3261. The Request-URI will be the intended destination (likely matching the To header). The stack should look for the top Route header to determine where to send the request. If there is no Route header, then it sends it to the address/host in the Request-URI.
The redirect server should recognize that the Route header is itself and strip it (in accordance with section 16.4). It would then use the Request-URI the figure out where to redirect the request. When the client gets the redirect response, it would replace the Request-URI with the value from the Contact header. The new request would not include the Route header pointing at the redirect server that the original request has so that the stack would send it to the address/host in the Request-URI. cheers, (-:bob Robert F. Penfield Chief Software Architect Acme Packet, Inc. 130 New Boston Street Woburn, MA 01801 [EMAIL PROTECTED] ----- Original Message ----- From: "Magnus Edev�g" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 4:19 AM Subject: [Sip-implementors] request uri & where to send message? > Hi. > I am implementing a SIP chat client for a mobile phone. In this phone a > small SIP stack will reside. But now I have found some issues I don't know > how to handle when developing the SIP stack. > When I create the SIP message, I set the request URI to the address where to > send the message, that is, our redirect server. The final destination is in > the to-header. But now I have read that the request uri and the to header > should most often be the same (though not for REGISTERs). How does this > work? My current implementation works like this: > > When createing the message, the next actuall destination is set in the > request uri. The final destination is set in the to-header. So the SIP stack > works in the manner that it reads the request URI and then writes it to that > network address. > > We then get a reply back from the redirect server that the contact has moved > (it's a redirect server...) with the new address in the contact field. The > we write a new request uri and sends it to the stack again. The stack writes > it to the network using the new request uri as destination address. > > But if the request uri and to-header should be the same, where do I specify > the actuall address for sending it? The to-header will contain the final > destination, so the request uri will contain the same. How do the SIP stack > then determine to what real network address to send it to? I can't put it in > the sipstack as "always send messages to this address" since when I get a > "moved" response I have to send it to another address. How do I tell this to > the SIP stack? > > Regards, > Magnus Edev�g > > _______________________________________________ > Sip-implementors mailing list > [EMAIL PROTECTED] > http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors > _______________________________________________ Sip-implementors mailing list [EMAIL PROTECTED] http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
