<div dir="ltr">Eric,<br><br>You were right.<br><br>Thanks :)<br><br>Michael<br><br><div class="gmail_quote">On Wed, May 2, 2012 at 7:25 PM, Eric Wieling <span dir="ltr"><<a href="mailto:EWieling@nyigc.com" target="_blank">EWieling@nyigc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you have quotes on one side of the = sign, then you need quotes on the other side. In your dialplan line you are comparing + with "+". A plus sign is not equal to quote plus sign quote<br>
<div class="im"><br>
exten => _X., n, Set(CALLERID(num)=${IF($["${CALLERID(num):0:1}" = "+"]?${CALLERID(num)}:0${CALLERID(num)})})<br>
<br>
</div><div class="im">-----Original Message-----<br>
From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a>] On Behalf Of Michael<br>
</div><div class="im">Sent: Wednesday, May 02, 2012 12:20 PM<br>
To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
Subject: [asterisk-users] detecting intl. CLI with +<br>
<br>
</div><div><div class="h5">Hello asterisk users,<br>
<br>
I need to convert the CLI received according to national/international format:<br>
<br>
55-555-5555 to 055-555-5555 (add 0 in the beginning)<br>
+55-55-555-5555 to +55-55-555-5555 (remains unchanged)<br>
<br>
I put the following line in my dial plan:<br>
exten => _X., n, Set(CALLERID(num)=${IF($[ ${CALLERID(num):0:1} = "+"]?${CALLERID(num)}:0${CALLERID(num)})})<br>
<br>
But I get these error messages:<br>
[May 2 17:05:43] WARNING[1494]: ast_expr2.fl:468 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected '+', expecting $end; Input:<br>
+ = "+"<br>
^<br>
[May 2 17:05:43] WARNING[1494]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to <a href="https://wiki.asterisk.org/wiki/display/AST/Channel+Variables" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Channel+Variables</a><br>
[May 2 17:05:43] WARNING[1494]: func_logic.c:192 acf_if: Syntax IF(<expr>?[<true>][:<false>]) (expr must be non-null, and either <true> or <false> must be non-null)<br>
[May 2 17:05:43] WARNING[1494]: func_logic.c:193 acf_if: In this case, <expr>='', <true>='+55555555555', and <false>='0+55555555555'<br>
<br>
Can anyone suggest the proper syntax? I tried the + with no quotes, single quotes '+' and double quotes"+" and nothing worked.<br>
<br>
Thanks<br>
<br>
<br>
</div></div>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div><br></div>