[Asterisk-Users] Prefix the * character

Barton Hodges barton at gcmcomputers.com
Mon Dec 8 07:58:07 MST 2003


asterisk-users-admin at lists.digium.com wrote:
> I have a smilar problem : I have a default context for an interface,
> where I'd like to prefix all incoming calls DID numbers (basically,
> the telco sends the last 4 digits dialed, I want to fully qualify my
> E164 number before doing extensions processing).
> 
> I don't know much (yet!) about Asterisk, so I thought something like
> 
> exten => s,1,Prefix(3312345)
> include => my_local_e164_extensions
> 
> would do the trick. Unfortunatly, if the ${EXTEN} was 6060 at that
> time, I get a new extension as s6060 (instead of 33123456060). Is it
> supposed to be this way ? 
> 
> So instead I had to do something like
> 
> exten => _XXXX,1,Prefix(3312345)
> include => my_local_e164_extension
> 
> which works fine, except that now I'm at the "2" level in the
context,
> and I had to modify my_local_e164 extension context accordingly.
> 
> Does somebody know of a better way to do it ?
> 
> Thanks.

The lines in a context get reordered.  If you want to force the order
of those lines, put the exten lines in separate contexts and "include"
them... something like this:

[some-context]
include => prefix
include => my_local_e164_extension

[prefix]
exten => _XXXX,1,Prefix(3312345)

I don't know if that will solve your problem, but it is something to
consider.

Barton





More information about the asterisk-users mailing list