Re: about stun4j in jain-sip 1.2

"M. Rangnathan" <[email protected]>
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
Man-Chi Leung wrote:

> hi,
>
> ----------------------------------------------
> in jain-sip 1.1 CVS source,
> ----------------------------------------------
> I found info about stun4j in /docs/faq.html
>
> How do you enable/use the STUN support?
> set the gov.nist.javax.sip.STUN_SERVER to point to 
> stun_server_ip_address[:port] where your stun server resides. The 
> stack will return mapped address when you getIpAddress() from the 
> stack and getPort() from the listening point. With stun, if you have a 
> NAT box, these will in general be different from the IP address and 
> port used to create the LP. Your application needs to use these in 
> setting up the contact address and SDP parameters as appropriate. The 
> stack is not responsible for this.
>
>
> ----------------------------------------------
> in jain-sip 1.2 CVS source
> ----------------------------------------------
> i found the following snippet in Class 
> "gov.nist.javax.sip.SIPStackImpl.java"
>
>         String stunAddr = configurationProperties
>                 .getProperty("gov.nist.javax.sip.STUN_SERVER");
>
>         if ( stunAddr != null )
>             this.logWriter.logWarning("Ignoring obsolete property "
>                 + "gov.nist.javax.sip.STUN_SERVER");
>
> -----------------------
> my Question:
> -----------------------
> is stun4j totally ignored by jain-sip 1.2 ?


Totally and absolutely ignored. :-) Stun was never part of JAIN-SIP. The 
previous version had some Stun support in the RI. It was deemed 
unecessary and therefore removed.

>
>
> so idea is to just call Stun's API from my jain-sip client, am i correct?
> - get public address from Stun4j's  addressDiscovery.determineAddress();
> - set public address in Via using API Jain-SIP's  
> headerFactory.createViaHeader()


Set the sentBy on your Listening point. See ListeningPoint.setSentBy()
Set the public address in Via.

If you dont do the former,  the RI will throw an exception. It does a 
little integrity check.

This may not be relevant to you but there is now an AddressResolver 
(only part of the RI and not the spec).  When the reciever gets a 
message it checks the via header to see if it can resolve the address. 
To do this it uses the AddressResolver. If the address cannot be 
resolved the message is dropped. Just a little security and integrity 
feature that I thought people might find useful. Also a way to deal with 
DNS SRV record lookups that the stack does not implement ( you can 
implement this Interface and register with the stack).

> - set public address in Contact using API Jain-SIP's  
> addressFactory.createAddress(contactURI);

Yes

> - set public address and port for  SDP c=  attribute.


Yes.

>
> ~manchi
>
>
>
> _______________________________________________
> nist-sip mailing list
> [email protected]
> http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
>


-- 
M. Ranganathan 

Advanced Networking Technologies Division,
National Institute of Standards and Technology (NIST),
100 Bureau Drive, Stop 8920, Gaithersburg, MD 20899. 
tel:301 975 3664 , fax:301 590 0932 http://w3.antd.nist.gov/
Advanced Networking Technologies For the People!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.