[OpenSIPS-Devel] [ opensips-Bugs-2922728 ] else not executed in script
SourceForge.net
noreply at sourceforge.net
Tue Dec 29 15:03:28 CET 2009
Bugs item #2922728, was opened at 2009-12-29 11:40
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2922728&group_id=232389
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.5.x
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Emmanuel BUU (neutrino38)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: else not executed in script
Initial Comment:
If we write the following code in opensips.cfg
if ( $du != "" )
{
// Destination URI is set. Use it
$avp(s:req_dest_ip) = $(du{uri.host});
}
else
{
// Use request URI by default
$avp(s:req_dest_ip) = $(ru{uri.host});
}
if $du is defined, then no problem
if $du is NOT define, the "else" clause is not executed.
We need to have a clean way to test for pseudo-variable existence. Even though, is the current behavior acceptable ?
som
----------------------------------------------------------------------
>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-12-29 16:03
Message:
Hi Emmanuel,
The correct test is
if ($du!=NULL)
if a pvar is not defined, NULL is returned.
Regards,
Bogdan
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2922728&group_id=232389
More information about the Devel
mailing list