[SR-Users] 401 responses ending up in onreply_route instead of failure_route

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 31 06:17:35 CET 2014


Hello,

On 30/01/14 18:33, Daniel Tryba wrote:
> Situation:
> endpoint -> kamailio (4.1.0) -> upstream sip server (kamailio 4.0.x)
>
> For an outbound call endpoint authenticates with kamailio. Kamailio relays the
> invite to upstream and upstream responds with a 401.
>
> This 401 should trigger authentication. So I thought I could use uac_auth() to
> fix this. uac_rely may only be used from FAILURE_ROUTE. So the initial INVITE
> from the endpoint has this set:
>
>          if (is_method("INVITE")) {
>                  if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");
>          }
>
> But to my suprise the 401 doesn't end up in the failure_route but in the
> onreply_route. Why? What am I missing?
>
if you don't drop it in the onreply route, then you should have the 
failure route executed as well. Also, in case there are many branches, 
the failure route is executed only when all branches fail and the branch 
with the response code having the highest priority is executed. 401 is 
among ones with high priority, but there are others over it, like 
redirects, transaction cancelled...

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list