[OpenSIPS-Users] 302 handling

Alex G greekman0000 at gmail.com
Tue Aug 19 16:26:13 CEST 2008


I did some more testing with this yesterday. The phone that is redirecting
indeed is behind nat, but my pstn gateway is all open net. What I did find
was that opensips was rediricting sdp to the phone still and not the
gateway. Why there is still rtp traffic in asterisk is still a mystery, but
I think with the right code I can also redirect the sdp out to the pstn as
well.

Will update you all on how this goes as I don't anticipate to start this
scripting challenge till late in the week.

A question that comes up is does the get_redirect function actually work in
the failure route or am I misplacing it and it should be somewhere else?

Thanks,

Alex

On Tue, Aug 19, 2008 at 6:30 AM, Bogdan-Andrei Iancu <bogdan at voice-system.ro
> wrote:

> Hi Alex,
>
> Glad you solved the problem - at least at signalling level :)
>
> Do you have NAT involved ? Have you checked the SDP (Ip and port) in both
> request and reply to see if where the problem comes?
>
> Regards,
> Bogdan
>
> Alex G wrote:
>
>> well i did make some headway on this, unfortunately i had to get tricky
>> with it.
>>
>> Even with the get redirects, it was still not placing the correct redirect
>> in there. As a matter of fact,  it seems like the function was not working
>> at all in the failure_route. My solution involved setting an avp in the
>> reply route becuase both the source and destination of the paceket were the
>> same when it was in the failure route.  So in on reply i set an avp that
>> then if was true in the branch route just rewrote the host port. So great I
>> was able to make the call path divert but when the 2 pstn endpoints actually
>> link, there is no sound. There seems to be rtp when i look in asterisk's
>> cli, but neither side is giving me audio  :(
>>
>> In the branch route, i tried with and without forecrtp proxy, but no
>> dice....
>>
>> anyone have an idea as to what might be going on?
>>
>> as always any input is greatly appreciated :)
>>
>>
>> On Sun, Aug 17, 2008 at 2:16 PM, Bogdan-Andrei Iancu <
>> bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>>
>>    Hi Alex,
>>
>>    Actually, after the get_redirects(), you should not do a
>>    rewiteXXXX() - just to t_relay(); the get_redirects() already
>>    populates the new branch with all the information.
>>
>>    Regards,
>>    Bogdan
>>
>>
>>    Ovidiu Sas wrote:
>>
>>        If you want to rewrite the port, you need to use the following
>>        syntax:
>>        rewritehostport("XXX.XXX.XXX.XXX:ZZZZZ");
>>        where ZZZZZ is the new port.
>>
>>
>>        Regards,
>>        Ovidiu Sas
>>
>>        On Wed, Aug 13, 2008 at 4:54 PM, Alex G
>>        <greekman0000 at gmail.com <mailto:greekman0000 at gmail.com>> wrote:
>>
>>            unfortunately the solution is a bit vague for what I'm
>>            trying to do...
>>
>>
>>            in the 302 packet the contact for redirect is sip
>>            xyz at abc.abc.abc.abc
>>
>>            failure_route[1] {
>>               if (t_check_status("302")) {
>>               xlog("in redirect failure $fu");
>>                get_redirects("*:1","redirect");
>>                 rewritehostport("XXX.XXX.XXX.XXX");
>>                t_relay();
>>               }
>>
>>            this should take the contact address and rewrite the host
>>            port for it
>>            relaying it to the new location right? should be an
>>            immediate invite to
>>            abc at XXX.XXX.XXX.XXX
>>
>>            unfortunately it doesn't rewrite the host port. It merely
>>            relays directly to
>>            the contact in the 302 packet xyz at abc.abc.abc.abc
>>
>>            any ideas would be welcome :)
>>
>>            thanks
>>
>>            alex
>>
>>            On Wed, Aug 13, 2008 at 2:38 PM, Ovidiu Sas
>>            <osas at voipembedded.com <mailto:osas at voipembedded.com>> wrote:
>>
>>                It is all here:
>>                http://www.opensips.org/html/uac_redirect.html#id2519995
>>
>>                Regards,
>>                Ovidiu Sas
>>
>>                On Wed, Aug 13, 2008 at 2:03 PM, Alex G
>>                <greekman0000 at gmail.com
>>                <mailto:greekman0000 at gmail.com>> wrote:
>>
>>                    I know there was some stuff about how to handle
>>                    302s and send forward a
>>                    new
>>                    invite to the diversion contact on the old mailing
>>                    list archives, but
>>                    they
>>                    are all gone now :(
>>
>>                    wondering if anyone can help me with this.....
>>
>>                    opensips -> ua -> moved -> opensips invite contact
>>                    from diversion
>>
>>
>>
>>                    basically opensips makes an invite to locally
>>                    registered uac, the uac
>>                    redirects to an external pstn number XXX-XXX-XXXX,
>>                    opensips then needs
>>                    to
>>                    handle the 302 and generate an invite to XXX-XXX-XXXX
>>
>>
>>                    any help would be most appreciated
>>
>>                    thanks Alex
>>
>>                    _______________________________________________
>>                    Users mailing list
>>                    Users at lists.opensips.org
>>                    <mailto:Users at lists.opensips.org>
>>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>>
>>        _______________________________________________
>>        Users mailing list
>>        Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>        http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20080819/6e1c071d/attachment.htm 


More information about the Users mailing list