[asterisk-users] Route an incoming call by ANI*DNIS

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Fri Nov 2 12:40:27 CDT 2007

On Friday 02 November 2007 12:07:48 Eric "ManxPower" Wieling wrote:
> exten => _XXXXXXX*XXXX*,1,Set(CALLERID(num)=${EXTEN:0:7)
> exten => _XXXXXXX*XXXX*,n,Goto(${EXTEN:8:4},1)
> The first line extracts the Caller*ID number from the incoming digits
> and sets the Caller*ID number to that value.
> The second line goes to the actual extension or DID in your dialplan.
> I have not tested this.  For more information on extracting characters
> from variables see README.variables (or whatever obvious name your
> version of Asterisk uses)

There's no need to go to these lengths.  chan_zap already parses out the
ANI and places it in the Caller*ID field, with the DNIS becoming the initial


More information about the asterisk-users mailing list