[OpenSIPS-Users] Redirect & LCR

Jeff Pyle jpyle at fidelityvoice.com
Fri Feb 21 16:58:40 CET 2014


It works quite well.  Here is my config chunk:

route[3] { # 302 Redirect for inbound traffic
if (!is_gflag("1")) { # Secondary server
$var(rU) = $rU;
$ru = "sip:" + $var(rU) + "@10.9.8.2:5060";
$ru_q = 400;
setflag(1);
}

if (!is_gflag("0")) { # Primary server
if (isflagset(1)) append_branch();
$ru = "sip:" + $var(rU) + "@10.9.8.1:5060";
$ru_q = 500;
setflag(1);
}

if (isflagset(1)) { # Send 302 if at least one set
sl_send_reply("302", "Inbound Redirect");
} else { # or 503 if none set
sl_send_reply("503", "Service Unavailable");
}

exit;
}



In the future this will become more sophisticated with db/cache lookups,
etc.  For now gflags provides enough control to toggle out a proxy from the
302 reply if necessary.


- Jeff




On Thu, Feb 20, 2014 at 10:25 AM, Bogdan-Andrei Iancu
<bogdan at opensips.org>wrote:

>  Yes, it should be 1.8 compatible. Just let me know if it does the trick,
> I'm really curious :).
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 20.02.2014 17:07, Jeff Pyle wrote:
>
> Perfect, I'll try this soon.  Do you expect this to work as far back as
> 1.8?
>
>
> On Thursday, February 20, 2014, Bogdan-Andrei Iancu <bogdan at opensips.org>
> wrote:
>
>>  Hi Jeff,
>>
>> Try :
>>
>>     # first contact
>>     $ru = "sip:firstcontact at foo.com";
>>     $ru_q = 500; # q for the first contact
>>     # second contact
>>     append_branch("sip:secondcontact at foo.com",1000);
>>     ....
>>     t_reply("302","Redirected");
>>
>> Let me know if it works - revisiting the links, I see the docs must be
>> improved.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>> On 20.02.2014 15:20, Jeff Pyle wrote:
>>
>>   Hi Bogdan,
>>
>>  I'm not looking to process a received 302, but rather generate one of
>> my own.  I want to set the q values so that the other side will serially
>> fork.  Ovidiu's example [1] from earlier in the thread doesn't address
>> this.  Looking at the docs for append_branch() [2] or rewriteuri() [3] I
>> don't see any mention either.
>>
>>    [1]
>> https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg
>>   [2] http://www.opensips.org/Documentation/Script-CoreFunctions#toc2
>>   [3] http://www.opensips.org/Documentation/Script-CoreFunctions#toc40
>>
>>
>>  - Jeff
>>
>>
>> On Wed, Feb 19, 2014 at 1:05 PM, Bogdan-Andrei Iancu <bogdan at opensips.org
>> > wrote:
>>
>>  Jeff,
>>
>> In OpenSIPS, the get_redirects() (
>> http://www.opensips.org/html/docs/modules/1.10.x/uac_redirect.html#id250266)
>> and the serialize_branches() (
>> http://www.opensips.org/Documentation/Script-CoreFunctions-1-10#toc44)
>> do follow the q values in the handled contacts.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>>  On 19.02.2014 18:08, Jeff Pyle wrote:
>>
>>   How does one manage q values for the various branches?  I'd like the
>> endpoint receiving the 302 to serially fork through the various URIs
>> (branches) I include.
>>
>>
>>  - Jeff
>>
>>
>>
>> On Thu, Sep 19, 2013 at 11:26 AM, Ovidiu Sas <osas at voipembedded.com>wrote:
>>
>> Take a look at the redirect example in the source tree:
>> https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg
>>
>> Regards,
>> Ovidiu Sas
>>
>>
>
> --
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140221/16bb9beb/attachment-0001.htm>


More information about the Users mailing list