now when someone dials into my IVR Number which is different like e.g 2126090000 and they want to dial this 221 which is not on our server but we want this extension to be dialed by the customer. It’s not working.
Is there any solution that we can use this custom dialplan to work with our internal dialplan.
For security, an external incoming call would not normally have access to from-internal resources.
Try replacing [from-internal-custom]
You can also do this without custom dial plan. Define an outgoing trunk identical to your SIPROUTES trunk but with Asterisk Trunk Dial Options set to D(wwww221#) and Override checked. Set up an Outbound Route with some prefix to access the special trunk. Set up virtual extension 221 with Follow Me set to call via the special route.
Going to very strongly recommend against @Stewart1’s advice. Nobody should ever use from-pstn-custom unless they know what they’re doing (and if you know what you’re doing, you already know the proper way).
You can only direct dial local extensions from an IVR, so create an extension of type custom for your custom dial string.
On second thought, I agree with @lgaetz that using from-pstn-custom is generally a bad idea, because it’s all too easy to inadvertently allow an external caller to make outgoing calls on your nickel.
Our application is different but it also involves connecting an external caller via IVR to an external extension selected with DTMF tones.
When a user does not answer quickly at his desk, we use Follow Me to ring his mobile. Normally, we just put the mobile number with # appended in the follow me list. But if he is traveling and staying at a hotel with https://www.handy.travel/ , we use the Handy phone, avoiding the hassle and expense of purchasing a local SIM card. However, a Handy phone does not have a dedicated DID – to reach it you must call the Handy access number in that country and enter an ‘extension’ number (assigned when the guest checks in).
So, the follow me number is set to 6568171454# (Handy access in Singapore) but we have an Outbound Route (ahead of the normal one for Singapore) that matches 6568171454 and selects the Handy trunk. The Handy trunk has the Dial Options set as noted earlier, so when the Handy server answers the proper extension is dialed.
Once set up, the user can be reached via his direct DID, via IVR or via call transfer to his normal extension.
I would posit that it’s always a bad idea. Every line a user puts in from-pstn-custom will override an existing, FreePBX generated line of dialplan. Unless one is aware of which lines are being overridden, and take steps to replace them somehow (easier said than done) then you will have unpredictable results, tho they may not be immediately apparent.
And I tried changing the context to [from-pstn-custom] but what happens is that I am getting Failed IVR " All circuites are busy now" even if I dial it directly without entering the IVR. And It’s also not dialable via IVR.
I don’t understand why your latest test didn’t work, but here’s easy simple to try:
Assuming that with your previous setup using [from-internal-custom] you can successfully dial 221 from a local extension, create a new virtual extension that doesn’t conflict with your dial plan, e.g. 299. Turn on its Follow Me and put 221# in the Follow-Me List. Test whether you can call 299 via the IVR.
Or creating custom extensions as suggested by @lgaetz should also work.