Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

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


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





PostPosted: Fri May 23, 2008 4:08 pm    Post subject: [asterisk-users] dialplan syntax error: need new eyes Reply with quote

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:
Quote:
140

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

Thanks.

sean
Back to top
asterisk-users at nota...
Guest





PostPosted: Fri May 23, 2008 6:12 pm    Post subject: [asterisk-users] dialplan syntax error: need new eyes Reply with quote

On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote:
Quote:

This doesn't work:

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

Change "IF (" to "IF(".
Back to top
seandarcy2 at gmail.com
Guest





PostPosted: Fri May 23, 2008 11:01 pm    Post subject: [asterisk-users] dialplan syntax error: need new eyes Reply with quote

Barry Miller wrote:
Quote:
On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote:
Quote:
This doesn't work:

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

Change "IF (" to "IF(".


Thanks for the response.

Tried it this way:

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

Same result.

sean
Back to top
asterisk-users at nota...
Guest





PostPosted: Sat May 24, 2008 1:59 am    Post subject: [asterisk-users] dialplan syntax error: need new eyes Reply with quote

On Sat, May 24, 2008 at 12:01:50AM -0400, sean darcy wrote:
Quote:
Barry Miller wrote:
Quote:
On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote:
Quote:
This doesn't work:

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

Change "IF (" to "IF(".

Same result.

Sorry. This time I actually tested it. *After* de-spacing the " = ",

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

behaved properly. At least with 1.4.19.1. FWIW, every time I try to use
whitespace to make a dialplan more readable, it jumps up and bites me.

Again, sorry for jumping in with an untested response.
Back to top
seandarcy2 at gmail.com
Guest





PostPosted: Sat May 24, 2008 7:49 am    Post subject: [asterisk-users] dialplan syntax error: need new eyes Reply with quote

Barry Miller wrote:
Quote:
On Sat, May 24, 2008 at 12:01:50AM -0400, sean darcy wrote:
Quote:
Barry Miller wrote:
Quote:
On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote:
Quote:
This doesn't work:

exten =>_1NXXNXXXXXX,n,Set( CALLERID(num) = ${IF ( $[${CALLERID(num)} >
140] ? ${MAINSTUB}${CALLERID(num)} : ${MAINNUMBER} )})
Change "IF (" to "IF(".
Same result.

Sorry. This time I actually tested it. *After* de-spacing the " = ",

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

behaved properly. At least with 1.4.19.1.

I cut and pasted that, and got the same error. I'm still at 1.4.13. I'm
also testing with a blank callerid. If you could test with a blank
callerid, I'd appreciate it, but it looks like I need to upgrade.

FWIW, every time I try to use
Quote:
whitespace to make a dialplan more readable, it jumps up and bites me.

Again, sorry for jumping in with an untested response.

If you hadn't responded, tested or not, I'd still be going crazy staring
at this.

Thanks for all your help.

sean
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