[asterisk-dev] 1.6 - beta9: channelvariables.txt missing
sean darcy
seandarcy2 at gmail.com
Fri Jun 20 13:16:18 CDT 2008
Tilghman Lesher wrote:
> On Friday 20 June 2008 10:55:47 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} )})
>>
>> But I get this error:
>>
>> [Jun 20 11:40:24] WARNING[7821]: ast_expr2.fl:398 ast_yyerror:
>> ast_yyerror(): syntax error: syntax error, unexpected '>', expecting
>>
>> $end; Input:
>> > 140
>>
>> ^
>> [Jun 20 11:40:24] WARNING[7821]: ast_expr2.fl:402 ast_yyerror: If you
>> have questions, please refer to doc/channelvariables.txt in the asterisk
>> source.
>>
>> Now I think the problem is that CALLERID(num) is a character value that
>> can't be compared to another value. But there's got to be some way to do
>> this, so I looked for channelvariables.txt. It's not there.
>>
>> So any help on my specific problem would be appreciated. Or if I should
>> RTFM, please point me to the FM.
>
> The parser gave you the exact string that occurred after the variable
> substitution, " > 140". This means that CALLERID(num) was not a string, but
> rather was blank (or unset). You might have better luck doing:
> $[0${CALLERID(num)} > 140], which should, in this case, evaluate to false.
>
Great. Worked For Me.
Thanks for the quick response.
sean
More information about the asterisk-dev
mailing list