Hi Andrew, Noticed you fixed the problem, but here are some ideas/questions:
1) what version on opensips do you use? 2) keep in mind that all the changes you do before creating the transaction (which is typically done by the first t_relay()) are inherited by all the following branched (you create via failure route). If you want to do changes to affect only a specific branch, you should use the onbranch route (see http://www.opensips.org/Resources/DocsCoreRoutes#toc2) Regards, Bogdan Andrew Pogrebennyk wrote: > 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:89151793...@xx.yy.zz.ww > 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:40089151793...@xx.yy.zz.ww > F=sip:84957978...@xx.yy.zz.ww T=sip:4953801...@aa.bb.cc.dd > IP=XX.YY.ZZ.WW id=470bed43-cece11de-b158f4a9-da974...@xx.yy.zz.ww > > > 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:89165438...@xx.yy.zz.ww > 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:40089165438...@xx.yy.zz.ww' - M=INVITE > RURI=sip:40089165438...@xx.yy.zz.ww F=sip:84957978...@xx.yy.zz.ww > T=sip:4953801...@aa.bb.cc.dd IP=XX.YY.ZZ.WW > id=e9c3fa8b-ced411de-b59ef4a9-da974...@xx.yy.zz.ww > > What is the problem? > > _______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users