[SR-Users] $du gets set automatically before branch_route
Alex Hermann
alex at speakup.nl
Mon Aug 1 19:20:18 CEST 2011
On Monday 01 August 2011 17:58:17 Alex Balashov wrote:
> On 08/01/2011 11:57 AM, Alex Hermann wrote:
> > Is it even guaranteed that $du gets set to $ru in every possible
> > scenario?
>
> No, it is set only in a few cases.
>
> Good way to check:
>
> if(!defined $du)
That does not work:
The following script fragment:
request_route:
xlog("Relay: <$ru> via <$du>");
if (defined $du) {
xlog("Relay: $$du is defined");
}
branch_route:
xlog("Branch: <$ru> via <$du>");
if (defined $du) {
xlog("Branch: $$du is defined");
}
Produces the following log fragment:
Relay: <sip:user at domain:8888;transport=udp> via <<null>>
Branch: <sip:user at domain:8888;transport=udp> via
<sip:user at domain:8888;transport=udp>
Branch: $du is defined
Let me rephrase the question as it may have been a bit unclear: How can i
determine within branch_route if the current branch had $du set?
--
Alex Hermann
More information about the sr-users
mailing list