[asterisk-dev] 1.6 - beta9: channelvariables.txt missing

Jared Smith jsmith at digium.com
Fri Jun 20 11:13:25 CDT 2008


On Fri, 2008-06-20 at 11:55 -0400, sean darcy wrote:
> I'm trying to set CALLERID(num) if the calling number is less than 140. 
> Thiat is, for all the internal extensions less  than 140, I want to set 
> the main number as the callerid, but use DID for 140 and up.
> 
> So I tried:
> 
> exten =>_1NXXNXXXXXX,n,Set(CALLERID(num)=${IF( $[${CALLERID(num)} > 140] 
> ? ${MAINSTUB}${CALLERID(num)} : ${MAINNUMBER} )})

The Asterisk dialplan parser is typically pretty picky about extra
spaces... so I'd take them out.  Without having tested it, I'd bet
you'll have better success with:

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


-- 
Jared Smith
Training Manager
Digium, Inc.




More information about the asterisk-dev mailing list