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.
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.
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.