Prefix in extensions.conf

When incoming calls come in on my voice line (lingo VOIP service) and asterisk “rings” my X-Lite SIP client, the CID always contains the area code then the number.

I am trying to get my extensions.conf file setup so that when I click on a missed called in X-Lite, that it dials properly. Currently, when I try to dial a missed call, it sends the area code + number, but missing a 1 in front of the number.

In my extensions.conf file, I have some canned dialplans that allow me to route local calls differently than LD calls differently than 800 calls, etc…
What I am trying to do is write an extenion that will match a 10 digit number and then prefix a ‘1’ in front, then let the other dialplans match the dialed number.

According to the docs ( digium.com/en/docs/asterisk_ … refix.html ), I should be able to use the following:

exten => _NXXNXXXXXX,1,Prefix,1

But when asterisk matches this exten, I get the following error:

pbx_extension_helper: No application ‘Prefix’ for extension

I can’t seem to find any more information on using prefix.

Granted, I can just add the approiate extens to match the dialed 10 digit number and process accordingly, but am more concerned as to why the Prefix does not work.

I am using 1.2.13 on FreeBSD 5.4

Any ideas?

Thanks,

Justin

You can handle this many ways. If this is occurring in the default context, you can send a goto back to the context you are dialing with the correct syntax or optionally have two dials. Here are a few examples below:

[default]
exten => _NXXNXXXXXX,1,Goto(default,1${EXTEN},1)
exten => _1NXXNXXXXXX,1,Dial(IAX2/servercontext/${EXTEN},,rt)

or

[default]
exten => _NXXNXXXXXX,1,Dial(IAX2/servercontext/1${EXTEN},,rt)
exten => _1NXXNXXXXXX,1,Dial(IAX2/servercontext/${EXTEN},,rt)

I think this is what you are asking for. I Hope this helps.

As I stated in my OP, I can easily add the extensions that will handle the 10 digit numbers, just like you have in your post, but what I am wondering is why ‘Prefix’ doesn’t work according to the documentation.

Thanks,

Justin

are you aware that Prefix is now obsolete ? you should really lose any dependency on the command in your dialplan unless you never want to upgrade. what version are you running ?

Have a look at the book: Asterisk: The future of Telephony (voip-info.org) to see if the sytax has been changed for 1.4. There are a lot of new changes to 1.4. Although older comamnds will still work in 1.2.13 they will not work in 1.4. Since 1.4 will be released real soon (hopefully) it would be a good idea to get in to the habbit of coding for 1.4