Prepend the Area Code with Asterisk

Posted by Hans Fugal Wed, 29 Mar 2006 17:18:10 GMT

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.

Comments

(leave url/email »)

   Comment Markup Help Preview comment

Tags

asterisk audio bash bread cs diy fat food health life linux mac music osx review ruby sourdough src typo voip