Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Logical AND (resent due to bounces)


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
jsneerin at gmail.com
Guest





PostPosted: Mon May 26, 2008 9:47 am    Post subject: [asterisk-users] Logical AND (resent due to bounces) Reply with quote

On Sun, May 25, 2008 at 6:17 AM, Adrian Marsh
<Adrian.Marsh at ubiquisys.com> wrote:
Quote:
I'm trying to figure out why in the below code, the PSTN_NUM variable is
always amended

exten => s,n,NoOp(${PSTN_NUM})
exten => s,n,ExecIf( $[ "${PSTN_NUM:0:1}" != "0" ] & $[ ${LEN(${PSTN_NUM})}
= 10 ]|Set|PSTN_NUM=001${PSTN_NUM})
exten => s,n,NoOp(${PSTN_NUM})

-- Executing [s at macro-setpstncli:8] NoOp("SIP/427-b7d0f518", "0123456789")
in new stack
-- Executing [s at macro-setpstncli:9] ExecIf("SIP/427-b7d0f518", " 0 &
1|Set|PSTN_NUM=0010123456789") in new stack
-- Executing [s at macro-setpstncli:10] NoOp("SIP/427-b7d0f518",
"0010123456789") in new stack

Remove the space between "ExecIf(" and "$[". It's causing the first
comparison to evaluate to the string " 0" (space-zero) and not the
digit 0, and a string will always evaluate to "true" if its length is
greater than zero.

-James
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services