[OpenSIPS-Users] UAC_REDIRECT : get_redirectsdoesnot rewritehost

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Aug 21 13:09:04 CEST 2009


HI Julien,

Could you print $du also (along $ru) and post ?

Thanks and regards,
Bogdan

Julien Chavanton wrote:
> Hi, I am now able to handle SIP/2.0 302 redirection corrrectly, 
> without setdsturi("$ru") there was a problem internaly not sure wy but 
> if I add this Opensips behave correctly
>  
>  
> failure_route[1] {
>         sip_trace();
>         end_media_session();
>         if (t_check_status("302")) {
>                 xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECT 
> ru[$ru]**\n");
>                 get_redirects("6:2","redirect");
>                 xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECTING TO: 
> [$ru]**\n");
>                 setdsturi("$ru");
>                 t_relay();
>                 exit;
>         }
> }
>  
>
> ------------------------------------------------------------------------
> *From:* users-bounces at lists.opensips.org on behalf of Julien Chavanton
> *Sent:* Wed 19/08/2009 5:01 PM
> *To:* OpenSIPS users mailling list; OpenSIPS users mailling list; 
> OpenSIPS users mailling list
> *Subject:* Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirectsdoesnot 
> rewritehost
>
> Hi, I found a fix to this problem, in some circumstances the contact 
> header is already parsed when hiting shmcontact2dset()
> however it is not parsed by parse_contact(), I have set a logging 
> entry in there.
>  
> My fix/workaround is simply to force it to parse again : 
>  
>         // start modification
>         int* b=0;
>         contact_hdr->parsed =(void*)b;
>         // end modification
>         /* parse the body of contact header */
>         if (contact_hdr->parsed==0) {
>                 if ( parse_contact(contact_hdr)<0 ) {
>                         LM_ERR("contact hdr parse failed\n");
>                         ret = -1;
>                         goto restore;
>                 }
>                 if (dup==0)
>                         dup = 1;
>         }
> Could we find out why it is parsed in a way that result in this 
> confusion between
> Contact and VIA header, this would be better.
>  
>  
>
> ------------------------------------------------------------------------
> *From:* users-bounces at lists.opensips.org on behalf of Julien Chavanton
> *Sent:* Tue 18/08/2009 12:06 AM
> *To:* OpenSIPS users mailling list; OpenSIPS users mailling list
> *Subject:* Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirectsdoesnot 
> rewritehost
>
> Hi Bogdan, I installed a test server with
>  
> 1.5.1
> 1.5.2
> and the SVN
>  
> I have the same behavior, where the IP adress is not taken from the 
> contact header but from somewhere else (maybe the VIA hdr)
>  
> The setup I have in my lab :
> X-Lite(caller computer) and another X-Lite(called computer).
> I set X-Lite(called computer), to forward the call to another target 
> new_target at 1.1.1.1 <mailto:new_target at 1.1.1.1> for example.
>  
> Maybe I should test with gateway instead of registered phones.
>  
> Regards
>
> ------------------------------------------------------------------------
> *From:* users-bounces at lists.opensips.org on behalf of Bogdan-Andrei Iancu
> *Sent:* Fri 14/08/2009 8:51 AM
> *To:* OpenSIPS users mailling list
> *Subject:* Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirects doesnot 
> rewritehost
>
> Hi Julien,
>
> Could you please try the latest 1.5 from SVN (1.5.2) ? I remember there
> were some fixes in the uac_redirect part and I want to be sure we are
> not troubleshooting it again.
>
> What is really strange is that the IP in the printed contacts is
> actually the IP + port from VIA hdr  :-/..
>
> If upgrading is an issue for you, I can prepare some debuging patch to
> print more stuff and to see where the change comes from.
>
> Regards,
> Bogdan
>
> Julien Chavanton wrote:
> > I have activated full debug mode, sort_contacts() seems to find the
> > host somewhere else ?
> > Maybe this will help you understand what is going on
> > 
> > 
> > #
> > U 10.0.1.73:57226 -> 10.0.5.10:5060
> > SIP/2.0 302 Moved Temporarily.
> > Via: SIP/2.0/UDP 10.0.5.10;branch=z9hG4bK2714.0ee86a21.0.
> > Via: SIP/2.0/UDP
> > 
> 10.0.1.73:57226;received=10.0.1.73;branch=z9hG4bK-d8754z-7048034193434959-1---d8754z-;rport=57226.
> > Contact: <sip:new_target at 10.0.1.1:5060>.
> > To: "777"<sip:777 at osip.domain.com>;tag=944d064a.
> > From: "777"<sip:777 at osip.domain.com>;tag=d650bd17.
> > Call-ID: YmI3ZmQ0Mzk2MDE3OGY0M2FlNjVkNGVlY2EwZmI5NzM..
> > CSeq: 1 INVITE.
> > User-Agent: X-Lite release 1103d stamp 53117.
> > Content-Length: 0.
> > 
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]: ***FAILURE ROUTE
> > - REDIRECT ru[sip:777 at 10.0.1.73:57226;rinstance=c699f35c276783d3]**
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:uac_redirect:get_redirect: resume branch=0
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:uac_redirect:get_redirect: checking branch=0 (added=0)
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:uac_redirect:get_redirect: branch=0 is a redirect (added=0)
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:uac_redirect:sort_contacts: sort_contacts:
> > <sip:new_target at 10.0.1.73:57226> q=10
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:uac_redirect:shmcontact2dset: adding contact
> > <sip:new_target at 10.0.1.73:57226>
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]:
> > DBG:core:parse_headers: flags=78
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]: ACC: request
> > accounted:
> > 
> timestamp=1250195007;method=INVITE;from_tag=d61cb370;to_tag=;call_id=NDA2ZmI4YmNmMjJmMGNjYjI4YjUxODUyNTNkZmUyNzQ.;code=;reason=redirect
> >
> > Aug 13 21:23:27 osip /usr/local/sbin/opensips[16925]: ***FAILURE ROUTE
> > - REDIRECTED TO: sip:new_target at 10.0.1.73:57226]** .
> > 
> >
> > ------------------------------------------------------------------------
> > *From:* users-bounces at lists.opensips.org on behalf of Julien Chavanton
> > *Sent:* Thu 13/08/2009 6:43 PM
> > *To:* OpenSIPS users mailling list; OpenSIPS users mailling list
> > *Subject:* Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirects does not
> > rewritehost
> >
> > Hi Bogdan,
> > 
> > version: opensips 1.5.1-notls (x86_64/linux)
> > 
> > failure_route[1] {
> >         sip_trace();
> >          if (t_check_status("302")) {
> >                 xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECT
> > ru[$ru]**\n");
> >                 get_redirects("6:2","redirect");
> >                 xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECTED TO:
> > $ru]**\n");
> >                 t_relay();
> >         }
> > }
> > 
> > Aug 13 18:44:17 osip /usr/local/sbin/opensips[16565]: ***FAILURE ROUTE
> > - REDIRECT ru[sip:777 at 10.0.1.73:57226;rinstance=c699f35c276783d3]**
> > Aug 13 18:44:17 osip /usr/local/sbin/opensips[16565]: ***FAILURE ROUTE
> > - REDIRECTED TO: ru[sip:new_target at 10.0.1.73:57226]**
> > 
> >
> > ------------------------------------------------------------------------
> > *From:* users-bounces at lists.opensips.org on behalf of Bogdan-Andrei 
> Iancu
> > *Sent:* Thu 13/08/2009 6:29 PM
> > *To:* OpenSIPS users mailling list
> > *Subject:* Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirects does not
> > rewrite host
> >
> > Hi Julien,
> >
> > The get_redirects() function does replace the entire RURI with the
> > contact URI. My feeling is you (by mistake) rewrite the domain part
> > after the new RURI is set - try printing the RURI just after the
> > get_redirects() function.
> >
> > BTW, what version of opensips are you using?
> >
> > Regards,
> > Bogdan
> >
> > Julien Chavanton wrote:
> > > I am looking to handle redirect 302 request, get_redirect does not
> > > replace the domain/host part of the new target ?
> > >
> > > How do we handle redirection to a different IP address ?
> > >
> > >
> > > Example :
> > >
> > > U 10.0.4.44:5060 -> 10.0.1.73:57226
> > > INVITE sip:777 at 10.0.1.73:57226;rinstance=c699f35c276783d3 SIP/2.0.
> > >
> > > U 10.0.1.73:57226 -> 10.0.4.44:5060
> > > SIP/2.0 302 Moved Temporarily.
> > > Contact: <sip:new_target at 10.0.1.1:5060>.
> > >
> > > U 10.0.4.44:5060 -> 10.0.1.73:57226
> > > INVITE sip:new_target at 10.0.1.73:57226 SIP/2.0.
> > > 
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Users mailing list
> > > Users at lists.opensips.org
> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > > 
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >  
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list