[SR-Users] Pseudo-variables and branches
Steve Davies
steve at connection-telecom.com
Sat Aug 24 20:05:24 CEST 2013
Hi -
Can someone help me understand how pseudo-variables interact with branches?
I've written this logic in my failure route to do a reroute of calls if the
primary destination fails:
if ( is_method("INVITE") && !t_check_status("407") && ($rd !=
"127.0.0.1") ) {
# Maybe should also check its not just a Busy or similar
xlog("L_NOTICE","SLD: INVITE failed $rm ($mt / $rs $rr):
$ci::$ft; try via asterisk instead\n");
append_branch("sip:$rU at 127.0.0.1:5070");
send_reply("181", "Rerouting call via local failover");
$avp(senttoast) = 1;
if (!t_relay()) {
sl_reply_error(); # or reply_error ?
}
I'm trying to check if the call was already rerouted - by looking at $rd.
But in fact I find that $rd keeps the domain from the ORIGINAL invite even
if the call that just failed was the one to 127.0.0.1:5070 .
So I'm obviously missing something about how pseudo-variables interact with
the branching etc.
Thanks,
Steve
--
Steve Davies: Technical Director, Connection Telecom (Pty) Ltd
Email is preferred, but: Phone: 0878200200
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130824/37189c01/attachment.html>
More information about the sr-users
mailing list