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

RE: [reSIProcate] Setting via headers for STUN


Hi,

I think I got it working now in the following way:

        if (UseSTUN)
        {
                resip::Uri mOverrideURI;
                mOverrideURI.host() = mMappedAddress.presentationFormat();
                mOverrideURI.port() = mMappedAddress.getPort();
                spUserProfile->setOverrideHostAndPort(mOverrideURI);
                pMsg->header(h_Vias).front().sentHost() = 
mMappedAddress.presentationFormat();
                pMsg->header(h_Vias).front().sentPort() = 
mMappedAddress.getPort();
                
spUserProfile->setFixedTransportInterface(m_pUdpTransport->interfaceName(););
                spUserProfile->setFixedTransportPort(m_pUdpTransport->port());
        }

The setFixedTransport... functions override the tranport selection
and thus transport selection doesn't fail when you modify the via header.
My sip messages now get sent out with the STUN discovered mapped
ip address and port in both contact and via header.

I'm not sure if we maybe should change the setOverrideHostAndPort
profile setting in a way that it performs these actions automatically?


Best regards,

Matthias Moetje
______________________________________________

TERASENS GmbH       Phone:  +49.89.143370-0
Augustenstraße 24   Fax:    +49.89.143370-22
80333 Munich        e-mail: info@xxxxxxxxxxxx
GERMANY             Web:    www.terasens.com
______________________________________________ 


> -----Original Message-----
> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On 
> Behalf Of Matthias Moetje - TERASENS GmbH
> Sent: Thursday, April 06, 2006 4:09 PM
> To: Joe Liao
> Cc: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [reSIProcate] Setting via headers for STUN
> 
> Joe,
> 
> thanks for the hint. I read the discussion and I don't fully 
> agree that a wrong via address doesn't matter. Other SIP UAs 
> with STUN support also set the via address to the mapped 
> public ip address.
> 
> Today I had the idea to specify a fixed transport in the 
> userprofile (STUN only works with UDP anyway) to prevent the 
> transport selection failure, but I haven't tried that yet...
> 
> Best regards,
> 
> Matthias Moetje
> 
> 
> 
> > -----Original Message-----
> > From: Joe Liao [mailto:joe.jhliao@xxxxxxxxx]
> > Sent: Thursday, April 06, 2006 4:41 AM
> > To: Matthias Moetje - TERASENS GmbH
> > Cc: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> > Subject: Re: [reSIProcate] Setting via headers for STUN
> > 
> > Hi Matthias ,
> >    I saw this problem on thread before as below, 
> > http://list.sipfoundry.org/archive/resiprocate-devel/msg02732.html
> > But i can't see what's the conclusion there.
> > Hope this helps.
> > 
> > Best regards,
> > -Joe
> > 
> > 2006/4/5, Matthias Moetje - TERASENS GmbH <moetje@xxxxxxxxxxxx>:
> > >
> > > Hi,
> > >
> > > I am currently encountering a problem while implementing
> > STUN support:
> > >
> > > When I adjust the via headers for sending an invite to the
> > discovered
> > > mapped ip address and port, the TransportSelector tells 
> that it is 
> > > unable to determine a matching transport. This is because
> > it uses the
> > > first via header to determine a matching transport.
> > >
> > > How can I work around this (change the via but use the
> > actual local IP
> > > and port for transport selection)?
> > >
> > >
> > > Best regards,
> > >
> > > Matthias Moetje
> > >
> > > _______________________________________________
> > > resiprocate-devel mailing list
> > > resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> > > https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
> > >
> > >
> > 
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
>