Sunday, January 22, 2017

An example of creating the array with a list of phone numbers in the Asterisk

In this example, we create a variable and assign a list of numbers in /etc/asterisk/globals_custom.conf file.
Then we can use this variable in the dialplan /etc/asterisk/extensions_custom.conf.

1. Create a variable in /etc/asterisk/globals_custom.conf
TELS1 = "(18005532447|14085267209|18005536387)"
2. Example of use dialplan /etc/asterisk/extensions_custom.conf
exten = _1XXXXXXXXXX,1,GotoIf($["${CALLERID(num)}" : ${TELS1}]?eq)

...
exten = _1XXXXXXXXXX,n(eq),Noop("equal")