Re: [asterisk-users] dialplan syntax error: need new eyes
On Sat, May 24, 2008 at 12:01:50AM -0400, sean darcy wrote: Barry Miller wrote: On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote: This doesn't work: exten =_1NXXNXX,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. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] dialplan syntax error: need new eyes
Barry Miller wrote: On Sat, May 24, 2008 at 12:01:50AM -0400, sean darcy wrote: Barry Miller wrote: On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote: This doesn't work: exten =_1NXXNXX,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 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 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] dialplan syntax error: need new eyes
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 =_1NXXNXX,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 =_1NXXNXX,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 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] dialplan syntax error: need new eyes
On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote: This doesn't work: exten =_1NXXNXX,n,Set( CALLERID(num) = ${IF ( $[${CALLERID(num)} 140] ? ${MAINSTUB}${CALLERID(num)} : ${MAINNUMBER} )}) Change IF ( to IF(. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] dialplan syntax error: need new eyes
Barry Miller wrote: On Fri, May 23, 2008 at 05:08:28PM -0400, sean darcy wrote: This doesn't work: exten =_1NXXNXX,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 =_1NXXNXX,n,Set(CALLERID(num) = ${IF($[ ${CALLERID(num)} 140] ? $ {MAINSTUB}${CALLERID(num)} : ${MAINNUMBER})}) Same result. sean ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users