users@woodstock.java.net

Re: nist-sip 1.2 and NAT traversal : issue with ListeningPoint sentby field

From: Jeroen van Bemmel <jbemmel_at_zonnet.nl>
Date: Thu, 17 Jan 2008 18:27:44 +0100

All,

setSentBy() makes most sense if you want to set a FQDN (i.e. hostname)
in the Via header. This can be used to support failover for responses
(through DNS)

Setting it to a specific IP address does not help, as the SIP protocol
is designed to send back responses to the IP address from which they come

Regards,
jeroen

M. Ranganathan wrote:
> Oh I should add -- you can do a listeningPoint.setSentBy(... )
> *before* you get a client Transaction
>
> On Jan 16, 2008 2:30 AM, Brian Wyld <brian.wyld_at_eloquant.com> wrote:
>> Hi,
>>
>> I've been using the NIST SIP stack, and recently updated to the latest
>> version (note in passing, great job guys).
>>
>> However, my code to deal with calls that are outbound thru a NAT'd router no
>> longer works.... If anyone can explain what I'm doing wrong it'd be a great
>> help.
>>
>> Basically, I want to make calls out (send the INVITE) to destinations that
>> may be either on an 'internal' network, or 'public' ie outside of a NATing
>> router.
>> There is no problem for the INVITE sending (using UDP), as the destination
>> IP is routable in both cases. My code detects when the destination is going
>> via NAT, gets the public IP of the router from a config file, and:
>> - adds a Via header accordingly
>> - fixes up the From, Contact etc URIs (change the local IP to the external
>> IP)
>> - ensures the RTP SDP IP is the external IP
>> This all worked fine until I updated to 1.2....
>>
>> Now, when I send to the public network, I get:
>> javax.sip.TransactionUnavailableException: sentBy does not match the sentby
>> setting of the ListeningPoint 62.212.123.79:5060
>> at
>> gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.j
>> ava:304)
>> ... etc
>> My external IP (in the Via, From, Contact etc) is 62.212.123.79 and my local
>> IP (to which the ListeningPoint is bound) would have been 192.168.0.167
>> (local server).
>>
>> So, when I create the ListeningPoint at initialisation of the server
>> process, I tried setting the sendby using setSentBy() to be the external
>> IP...
>>
>> Now, it works when I send to an external destination, but not when I send to
>> an internal one!
>>
>> Is there a way to stop the ListeningPoint checking its sentby field against
>> my Via, From etc headers? Or is my basic method (fixing up the headers
>> myself) wrong, and I should do it another way? Or do I have to use 2
>> SipProvider instances, one for internal calls (sentby=192.168.0.167:5060)
>> and one for externals (sentby=62.212.123.79:5060)? (this is not my preferred
>> solution....)
>>
>> All ideas gratefully received....
>>
>> Brian
>>
>> [ Brian Wyld : Eloquant SA ]
>> [ Directeur technique ]
>> [ brian.wyld at eloquant.com ]
>> [ tel: +33 476 77 69 54 ]
>> [ mob: +33 609 62 10 87 ]
>> [ fax: +33 476 77 40 65 ]
>>
>>
>> _______________________________________________
>> nist-sip mailing list
>> nist-sip_at_antd.nist.gov
>> http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
>>
>
>
>