[asterisk-users] dialplan syntax error: need new eyes

sean darcy seandarcy2 at gmail.com
Fri May 23 16:08:28 CDT 2008


I'm trying to set the outgoing caller id to the DID number, but only if 
the extension is greater than 140. MAINSTUB is simply the first 7 digits 
of the main number. sip.conf sets the CALLERID(num) to the extension.

exten =>_1NXXNXXXXXX,n,Set(CALLERID(num)=${MAINSTUB}${CALLERID(num)})

works. But I want to set the caller id to the main number unless the 
extension is 141 or higher.

This doesn't work:

exten =>_1NXXNXXXXXX,n,Set( CALLERID(num) = ${IF ( $[${CALLERID(num)} > 
140] ? ${MAINSTUB}${CALLERID(num)} : ${MAINNUMBER} )})

ast_yyerror():  syntax error: syntax error, unexpected '>', expecting 
$end; Input:
  > 140

I've counted my parens, checked IF syntax, and now need some new eyes to 
look at this.

Thanks.

sean




More information about the asterisk-users mailing list