[OpenSIPS-Users] Intercepting a 302 response and dispatching an INVITE to a new destination set
Blagovest Buyukliev
blagovest at voipfone.co.uk
Thu Sep 7 13:34:33 EDT 2017
The onreply_route is never armed, but gets executed.
The failure_route[initial_request] is armed via t_on_failure("initial_request") and actually gets executed after the onreply_route (as per my last test).
Can we stop the propagation of the 302 from within failure_route, or is it considered already sent after the execution of onreply_route?
> On Sep 7, 2017, at 8:12 PM, Alex Balashov <abalashov at evaristesys.com> wrote:
>
> Don't arm the onreply_route. Doesn't the failure_route get called?
>
> On September 7, 2017 1:08:55 PM EDT, Blagovest Buyukliev <blagovest at voipfone.co.uk> wrote:
>> Which functions need to be used for that?
>>
>> The current routing logic is roughly what's listed below and the
>> problematic issues are commented.
>>
>> How can it be modified to accomplish what you've described?
>>
>> route {
>> ...
>> loose_route();
>> record_route();
>> t_on_failure("initial_request");
>> t_relay();
>>
>> # We are okay here, the initial INVITE is passed to a local server.
>> }
>>
>> onreply_route {
>> if ($rs == 302) {
>> # The 302 is caught here, but we are pretty much handicapped to do
>> anything in this block.
>> # The response is passed back to the external network, which is
>> undesired.
>> }
>> }
>>
>> failure_route[initial_request] {
>> # How can we arrive here right upon the receipt of the 302, not in
>> onreply_route?
>> }
>>
>>> On Sep 5, 2017, at 4:54 PM, Alex Balashov <abalashov at evaristesys.com>
>> wrote:
>>>
>>> Yes, failure_route is the answer to all your objectives here. You can
>>> intercept the 302, extract what you want from it, create a new branch
>>> and fork the call elsewhere.
>>>
>>> --
>>> Alex Balashov | Principal | Evariste Systems LLC
>>>
>>> Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
>>> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> -- Alex
>
> --
> Sent via mobile, please forgive typos and brevity.
>
> _______________________________________________
> Users mailing list
> 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/20170907/a90bb009/attachment.html>
More information about the Users
mailing list