Dialing Extension Dials External Number

I have tried searching the forums and Google but haven’t figured out the best way to do this.

Use case:
Specific extension (1234) dials a four digit number (say between 2000-8000). If the four digit number matches the range, Asterisk needs to dial a specific external number (510) 555-1212 (as an example), wait 3 seconds, then dial the four digit number that was previously matched.

I know I can use the w for wait but not really sure where to start. Any help would be appreciated.

I can get you started. You’ll want to add the following to extensions_custom.conf:

[from-internal-custom]
exten => _[2-8]XXX,1,NoOp(Entering user defined context from-internal-custom in extensions_custom.conf)
exten => _[2-8]XXX,n,Dial(Local/[email protected],,D(wwwwwwww${EXTEN}))
exten => _[2-8]XXX,n,Hangup()

I haven’t tested it, but looks roughly correct. You will want to enable DTMF logging in Settings, Asterisk Logfiles and then watch the console/full log when dialing to see what’s going on.

2 Likes

Thank you so much @lgaetz!

This worked without any issues. If I may ask a follow up question, what if I only I want one one specific PJSIP extension to follow this custom dial plan for testing so it doesn’t affect all PJSIP extensions I have created on that PBX system?

If you want to block access to all by ext 123, you would do it this way:

[from-internal-custom]
exten => _[2-8]XXX/123,1,NoOp(Entering user defined context from-internal-custom in extensions_custom.conf)
exten => _[2-8]XXX/123,n,Dial(Local/[email protected],,D(wwwwwwww${EXTEN}))
exten => _[2-8]XXX/123,n,Hangup()

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.