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

Re: [reSIProcate-users] question regarding "received" and "rport" tags


Hi Scott and thanks as usual for your help :)
i am facing a couple of issues trying to emulate the scenario that i posted before:
1) if i strip all contacts with removeAll() i get a REGISTER going out with "Contact:" set to "*" and i would rather not (to mimic the scenario exactly)
2) if i try to remove the contact i used in the first REGISTER well, i don't know where to find it! :) let me explain
Basically to mimic that scenario i am adding code in the onSuccess() method of the registration handler.
However when I read the contact from the response message the URI has an rinstance parameter that i did not know before... (i.e. if i try to store my contact when i send out the first REGISTER, that URI doesn't have any parameters) so if i try to use removeBinding() it fails. 
Am i doing this all wrong or am i missing something? 
Is there a way to retrieve the contact used when sending the first REGISTER? if i ask for the contact header uri().getAor() before sending the register message through dum i only get the username.

3) i also tried some code along the lines of
for (ParserContainer<NameAddr>::const_iterator i=response.header(h_Contacts).begin(); i != response.header(h_Contacts).end(); i++)
                {
                    qDebug() << "examining contact header: " << i->uri().toString().c_str();
                    
                    pReg->removeBinding(*i);
                }

but this also fails, and still haven't figured out why.

thanks and best regards

On Tue, Jan 2, 2018 at 11:37 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
There is no way to do that automatically with resip.

You will need to manually modify the 2nd out going registration and fiddle with the contact headers before sending.  Profile::setOverrideHostAndPort may be of assistance, or you can just strip all contacts and re-add your own.  Note: If you provide a pre-populated contact header, the stack won't try to fill it in itself.

Scott

On Tue, Jan 2, 2018 at 5:08 PM, Francesco Lamonica <alienpenguin@xxxxxxxxx> wrote:
Hi all and happy 2018,
i have one UA that uses another sip stack (sofia-sip) then when receiving a response ( 200 OK to a REGISTER) containing a "received" and an "rport" tags in the Via Header then issues automatically another REGISTER with 2 contact headers
1) the old one, with expires=0 
2) the new one where the ip address and port are gathered from the received/rport tags parsed from the Via header

is there a way to do this automatically w resiprocate?
or, what would be the best actions to emulate this behaviour?

thanks

_______________________________________________
resiprocate-users mailing list
resiprocate-users@resiprocate.org
List Archive: http://list.resiprocate.org/archive/resiprocate-users/