rewriting transactional responses

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

rewriting transactional responses

Jeff Pyle
Hello,

If a transaction has progressed from the initial request route, hit a
t_relay(), come back into an armed failure route with a 302, and gone back
to another request route... how can I change the 302 to something more
generic (such as a 500) before relaying it to the UAC?


Thanks,
Jeff


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewriting transactional responses

Bogdan-Andrei Iancu
Hi Jeff,

simply do t_reply() from failure route and you will override the
received reply.

Regards,
Bogdan

Jeff Pyle wrote:

> Hello,
>
> If a transaction has progressed from the initial request route, hit a
> t_relay(), come back into an armed failure route with a 302, and gone back
> to another request route... how can I change the 302 to something more
> generic (such as a 500) before relaying it to the UAC?
>
>
> Thanks,
> Jeff
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewriting transactional responses

Jeff Pyle
Hi Bogdan,

Will this work if the t_reply() is in the request route?  In this case I
don't know yet in the failure_route if I have another PSTN carrier to try
until I check in a request route.

I tried it in the request route, and it indeed sent the specified response,
and the UAC (Asterisk) ACK'd it, but Opensips continued to send the new
message several more times as if it hadn't received the ACK or it didn't
match the proper transaction.



- Jeff



On 3/17/09 9:51 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:

> Hi Jeff,
>
> simply do t_reply() from failure route and you will override the
> received reply.
>
> Regards,
> Bogdan
>
> Jeff Pyle wrote:
>> Hello,
>>
>> If a transaction has progressed from the initial request route, hit a
>> t_relay(), come back into an armed failure route with a 302, and gone back
>> to another request route... how can I change the 302 to something more
>> generic (such as a 500) before relaying it to the UAC?
>>
>>
>> Thanks,
>> Jeff
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>  
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewriting transactional responses

Bogdan-Andrei Iancu
Hi Jeff,

you can do t_reply() from request route (when processing first time the
received request) if you want to reply the request and not to forward
it, and from failure route if you want to overwrite the replies received
from the UASs.

route{
    t_on_failure("1");
    t_relay();
}

failure_route[1] {
    if (t_check_status("3[0-9][0-9]")
       t_reply("500","Server dailure");
}


Regards,
Bogdan

Jeff Pyle wrote:

> Hi Bogdan,
>
> Will this work if the t_reply() is in the request route?  In this case I
> don't know yet in the failure_route if I have another PSTN carrier to try
> until I check in a request route.
>
> I tried it in the request route, and it indeed sent the specified response,
> and the UAC (Asterisk) ACK'd it, but Opensips continued to send the new
> message several more times as if it hadn't received the ACK or it didn't
> match the proper transaction.
>
>
>
> - Jeff
>
>
>
> On 3/17/09 9:51 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:
>
>  
>> Hi Jeff,
>>
>> simply do t_reply() from failure route and you will override the
>> received reply.
>>
>> Regards,
>> Bogdan
>>
>> Jeff Pyle wrote:
>>    
>>> Hello,
>>>
>>> If a transaction has progressed from the initial request route, hit a
>>> t_relay(), come back into an armed failure route with a 302, and gone back
>>> to another request route... how can I change the 302 to something more
>>> generic (such as a 500) before relaying it to the UAC?
>>>
>>>
>>> Thanks,
>>> Jeff
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>  
>>>      
>
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewriting transactional responses

Jeff Pyle
Hi Bogdan,

After some experimentation that's what I've discovered.  Much of the time
Opensips contines to resend whatever t_reply() sends even after receiving
the ACK from Asterisk (UAC).  I upgraded Asterisk to 1.4.23.1 (almost
current) and those retransmissions seem to have stopped.

Apparently it wasn't Opensips at all.  Imagine that.


Thanks,
Jeff



On 3/18/09 5:46 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:

> Hi Jeff,
>
> you can do t_reply() from request route (when processing first time the
> received request) if you want to reply the request and not to forward
> it, and from failure route if you want to overwrite the replies received
> from the UASs.
>
> route{
>     t_on_failure("1");
>     t_relay();
> }
>
> failure_route[1] {
>     if (t_check_status("3[0-9][0-9]")
>        t_reply("500","Server dailure");
> }
>
>
> Regards,
> Bogdan
>
> Jeff Pyle wrote:
>> Hi Bogdan,
>>
>> Will this work if the t_reply() is in the request route?  In this case I
>> don't know yet in the failure_route if I have another PSTN carrier to try
>> until I check in a request route.
>>
>> I tried it in the request route, and it indeed sent the specified response,
>> and the UAC (Asterisk) ACK'd it, but Opensips continued to send the new
>> message several more times as if it hadn't received the ACK or it didn't
>> match the proper transaction.
>>
>>
>>
>> - Jeff
>>
>>
>>
>> On 3/17/09 9:51 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:
>>
>>  
>>> Hi Jeff,
>>>
>>> simply do t_reply() from failure route and you will override the
>>> received reply.
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Jeff Pyle wrote:
>>>    
>>>> Hello,
>>>>
>>>> If a transaction has progressed from the initial request route, hit a
>>>> t_relay(), come back into an armed failure route with a 302, and gone back
>>>> to another request route... how can I change the 302 to something more
>>>> generic (such as a 500) before relaying it to the UAC?
>>>>
>>>>
>>>> Thanks,
>>>> Jeff
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> [hidden email]
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>  
>>>>      
>>
>>
>>  
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: rewriting transactional responses

Bogdan-Andrei Iancu
The reply transmission is according to RFC3261 if no ACK is received. So
I suspect that the ACK generated by Asterisk was bogus and not
recognized by OpenSIPS.

Regards,
Bogdan

Jeff Pyle wrote:

> Hi Bogdan,
>
> After some experimentation that's what I've discovered.  Much of the time
> Opensips contines to resend whatever t_reply() sends even after receiving
> the ACK from Asterisk (UAC).  I upgraded Asterisk to 1.4.23.1 (almost
> current) and those retransmissions seem to have stopped.
>
> Apparently it wasn't Opensips at all.  Imagine that.
>
>
> Thanks,
> Jeff
>
>
>
> On 3/18/09 5:46 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:
>
>  
>> Hi Jeff,
>>
>> you can do t_reply() from request route (when processing first time the
>> received request) if you want to reply the request and not to forward
>> it, and from failure route if you want to overwrite the replies received
>> from the UASs.
>>
>> route{
>>     t_on_failure("1");
>>     t_relay();
>> }
>>
>> failure_route[1] {
>>     if (t_check_status("3[0-9][0-9]")
>>        t_reply("500","Server dailure");
>> }
>>
>>
>> Regards,
>> Bogdan
>>
>> Jeff Pyle wrote:
>>    
>>> Hi Bogdan,
>>>
>>> Will this work if the t_reply() is in the request route?  In this case I
>>> don't know yet in the failure_route if I have another PSTN carrier to try
>>> until I check in a request route.
>>>
>>> I tried it in the request route, and it indeed sent the specified response,
>>> and the UAC (Asterisk) ACK'd it, but Opensips continued to send the new
>>> message several more times as if it hadn't received the ACK or it didn't
>>> match the proper transaction.
>>>
>>>
>>>
>>> - Jeff
>>>
>>>
>>>
>>> On 3/17/09 9:51 AM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:
>>>
>>>  
>>>      
>>>> Hi Jeff,
>>>>
>>>> simply do t_reply() from failure route and you will override the
>>>> received reply.
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>> Jeff Pyle wrote:
>>>>    
>>>>        
>>>>> Hello,
>>>>>
>>>>> If a transaction has progressed from the initial request route, hit a
>>>>> t_relay(), come back into an armed failure route with a 302, and gone back
>>>>> to another request route... how can I change the 302 to something more
>>>>> generic (such as a 500) before relaying it to the UAC?
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Jeff
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing list
>>>>> [hidden email]
>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>  
>>>>>      
>>>>>          
>>>  
>>>      
>
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users