detecting intl. CLI with +

Report
Question

Hello asterisk users, I need to convert the CLI received according to national/international
format: 55-555-5555 to 055-555-5555 (add 0 in the beginning)
+55-55-555-5555 to +55-55-555-5555 (remains unchanged) I put the following line in my dial plan:
exten => _X., n, Set(CALLERID(num)=${IF($[ ${CALLERID(num):0:1} =
"+"]?${CALLERID(num)}:0${CALLERID(num)})}) But I get these error messages:
[May 2 17:05:43] WARNING[1494]: ast_expr2.fl:468 ast_yyerror:
ast_yyerror(): syntax error: syntax error, unexpected '+', expecting $end;
Input:
+ = "+"
^
[May 2 17:05:43] WARNING[1494]: ast_expr2.fl:472 ast_yyerror: If you have
questions, please refer to
https://wiki.asterisk.org/wiki/display/AST/Channel+Variables
[May…

Asterisk Users 3.2 years ago 3 Answer

Stumped about adding a semi-colon to a variable

Report
Question

I need to add a semi-colon to a variable, but no matter how I quote
it, the parser ignores it and considers the semi-colon as the
beginning of a comment.
Si how do I concatenate the content of a variable to a semi-colon? I
tried surrounding it with double quotes, single quotes, using a
backslash first, a period first, to no avail.

Asterisk Users 3.4 years ago 3 Answer