DID to extension mapping

I Was just reading this :

I re-created it;

in extensions_custom.conf
[automap]
include => from-did-direct

Then I created a custom destination named automap in FreePBX:
automap,${CALLERID(DNID):-4},1
In my case, the extension is the last 4 digits of the DID.

Finally I used the custom destination in the inbound route in FreePBX.

It works ! Only one inbound route !

Now I have a dumb question : how do I modify this so it does the following :

  • If the extension exists, send it to the extension.
  • If the extension does not exist, send it to a trunk.

Please enlighten me.

Not sure if it’s wise, but changing your custom dest to:

from-internal,${CALLERID(DNID):-4},1
1 Like

Hi Lorne,

What you suggested works fine; I was just thinking about something like that; it makes sense to me, I have an outgoing route to that trunk already for the extension range, so I could dial the extensions on the legacy PBX.

What would the dangers be ?

Michel.

Honestly, I can’t think of any, but this is probably not good practice to funnel inbound calls to the from-internal context. Perhaps putting things back to the way they were and modifying the original context to:

[automap]
include => from-did-direct
include => outbound-allroutes

Very elegant, I am learning a lot.Whatever the bad karma may be, if the inbound route is specific enough and we limit it to that context, it looks more contained than making look it came from-internal.

Thanks much for the education.

1 Like