[asterisk-users] Idiot's question

Richard Lyman pchammer at dynx.net
Sat Jun 14 12:58:30 CDT 2008


TP'n to follow flow.

I haven't seen anyone mention ISNULL so there is an example (obviously 
wrap it in the below Set(CALLERID(num)=...) as the other examples are)

${IF(${ISNULL(${CALLERID(num)})}?0000000000:${CALLERID(num)})}

Eric "ManxPower" Wieling wrote:
> This should do it, but I've not actually tested it.  It is based on a 
> line from my own dialplan.
>
> _X.,n(entrada),Set(CALLERID(num)=${IF($[${LEN(${CALLERID(num)})} = 
> 0]?0000000000:${CALLERID(num):0:11})})
>
> Venefax wrote:
>   
>> I have two lines in my dialplan that I wish to make it into only one, and I
>> fail
>> X.,n(entrada),Set(CALLERID(num)=${CALLERID(num)}0000000000)
>> X.,n,Set(CALLERID(num)=${CALLERID(num):0:11})
>>
>> It means: add '0000000000' to the caller id, and then take the first 11
>> chars from the left. It aims to detect null caller ids and replace them by
>> zeros. How can I write this expression in just one line?
>>
>>     
>
>
>   




More information about the asterisk-users mailing list