29 Mar 2006 10:18

Prepend the Area Code with Asterisk

If you want to prefix the area code for 7-digit numbers with Asterisk, it usually looks like something like this:

ext => _NXXXXXX,1,goto(505${EXTEN},1)

But if you need to server all area codes dynamically, you can do something like this:

ext => _NXXXXXX,1,goto(${CALLERID(number):0:3}${EXTEN},1)

This assumes caller id is set, and that your callers are using standard PSTN-like DIDs.