Hi,
I'm trying to put together some configuration for unconditional call 
forwarding. The carrier requires me to send the call with prefix "400" 
in R-URI. Here are the relevant routes:

route[6]
{
         if(avp_db_load("$ru/username","$avp(s:callfwd)")) {
                 avp_pushto("$ru", "$avp(s:callfwd)");
                 xlog("L_INFO", "forwarded to: $avp(s:callfwd)");
                 avp_delete("$avp(s:callfwd)");
                 $avp(i:25) = 20;
         }
         route(7);
}

route[7]
{
        prefix("400");
        rewritehost("XX.YY.ZZ.WW");
        t_on_failure("2");
        xlog("L_INFO", "Request leaving server, D-URI='$du' - M=$rm RURI=$ru 
F=$fu T=$tu IP=$si ID=$ci\n");
        t_relay("XX.YY.ZZ.WW:5060");
        exit;
}

failure_route[2]
{
         # forward on busy
         if(t_check_status("(486)|(408)") && avp_pushto("$ru", 
"$avp(s:callfwd)")) {
                 append_branch();
                 xlog("forwarded on $T_reply_code to: $avp(s:callfwd)");
                 avp_pushto("$du", "$avp(s:callfwd)");
                 avp_delete("$avp(s:callfwd)");
                 $avp(i:25) = 20;
                 route(7);
         }
}

The problem is that while the call is sent to the first call forward 
destination correctly (with prefix 400 in R-URI), it goes to the next 
destination (triggered from failure_route) without the prefix in R-URI! 
There are the following messages in the log file:

Nov 12 21:12:00 sip2 /usr/local/sbin/openser[52971]: forwarded on 408
to: sip:[email protected]
Nov 12 21:12:00 sip2 /usr/local/sbin/openser[52971]:  1 avps were removed
Nov 12 21:12:00 sip2 /usr/local/sbin/openser[52971]:
DBG:core:pv_get_dsturi: no destination URI
Nov 12 21:12:00 sip2 /usr/local/sbin/openser[52971]: Request leaving
server, D-URI='<null>' - M=INVITE RURI=sip:[email protected]
F=sip:[email protected] T=sip:[email protected]
IP=XX.YY.ZZ.WW [email protected]


Despite R-URI appears with 400, it is sent without the prefix as I've 
confirmed by the trace.

That "no destination URI" line looked suspicious to me, in fact I would 
expect that prefix() handles destination URI as well. I thought that 
could be the case so I've added explicit "$du = $ru;" after prefix and 
rewritehost. D-URI looks fine now, but it is still sent on the wire 
without 400:

ov 12 21:59:29 sip2 /usr/local/sbin/openser[53183]: forwarded on 408 to: 
sip:[email protected]
Nov 12 21:59:29 sip2 /usr/local/sbin/openser[53183]: 
DBG:avpops:ops_pushto_avp: 1 avps were processed
Nov 12 21:59:29 sip2 /usr/local/sbin/openser[53183]:  1 avps were removed
Nov 12 21:59:29 sip2 /usr/local/sbin/openser[53183]: Request leaving 
server, D-URI='sip:[email protected]' - M=INVITE 
RURI=sip:[email protected] F=sip:[email protected] 
T=sip:[email protected] IP=XX.YY.ZZ.WW 
[email protected]

What is the problem?

-- 
Sincerely,
Andrew Pogrebennyk

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

Reply via email to