[asterisk-users] Idiot's question

Steve Edwards asterisk.org at sedwards.com
Fri Jun 13 19:59:23 CDT 2008


On Fri, 13 Jun 2008, 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?

First, it doesn't do what your explanation says it does.

Second, why would you want to? Any savings in execution time will be 
insignificant and it will obscure the intent and "readability" of the 
code.

FYI, my 2.6GHz P4 executes about 3,000 CALLERID(num) assignments per 
second.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list