[asterisk-users] trouble removing + sign
Dovid Bender
dovid at telecurve.com
Wed Feb 13 17:22:46 CST 2019
Try == in your gotoif (instead of =)
Regards,
Dovid
Original Message
From: seandarcy2 at gmail.com
Sent: February 14, 2019 01:14
To: asterisk-users at lists.digium.com
Reply-to: asterisk-users at lists.digium.com
Subject: [asterisk-users] trouble removing + sign
I'm using BLACKLIST() to check numbers, which does not like leading +
signs. I want to test if there is a plus sign, and then remove it.
I tried:
; strip leading plus sign
same => n, Verbose( callerid 0:1 is ${CALLERID(num):0:1} )
same => n,ExecIf($["${CALLERID(num):0:1}" = "+"]?Set(CALLERID(num) =
${CALLERID(num):1})
same=>n,GotoIf(${BLACKLIST()}?make-em-wait)
but it's stripping the first character + sign or not. The callerid is
1203XXYYYY
-- Executing [s at hangup-spam:3] Verbose("PJSIP/2667075-0000000b", "
callerid 0:1 is 1 ") in new stack
callerid 0:1 is 1
-- Executing [s at hangup-spam:4] ExecIf("PJSIP/2667075-0000000b",
"0?Set(CALLERID(num) = 203XXXYYYY") in new stack
-- Executing [s at hangup-spam:5] GotoIf("PJSIP/2667075-0000000b",
"0?make-em-wait") in new stack
ExecIf correctly finds the comparison false(the "0"), but still executes
the appiftrue .
What am I missing ?
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Check out the new Asterisk community forum at: https://community.asterisk.org/
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list