[asterisk-users] Idiot's question

Philipp Kempgen philipp.kempgen at amooma.de
Fri Jun 13 19:52:16 CDT 2008


Venefax schrieb:
> 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?

I think it does multiple passes to evaluate ${} so maybe
	Set(CALLERID(num)=${${CALLERID(num)}0000000000:0:11})
works.

However assuming a callerid to always be 11 chars is not
generally valid.

Grüße,
Philipp Kempgen
-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998



More information about the asterisk-users mailing list