Dial an extension via cmd Dial

Is there a way to automatically dial a specific extension using the Dial() function? I would like to call our main office line, get our voice prompt, and have it automatically try to dial my extension. Is this possible? Thanks

I don’t understand your question. It is no problem to get a call to your extension directly from the outside. (Direct inward dialing).

[from-extern]

exten=>s,1,Playback(welcome)
exten=>s,n,Dial(SIP/yourextension)
exten=>s,n,Hangup()

Right, I understand that.

I want to dial a specific phone number through my service provider, then dial an extension.

For example, dial 715-386-5700 ext 404

If that number really ends in two zeroes, there is a very good chance that they have DID (traditional meaning) and 715-386-5704 is likely to work.

The Dial application does have the ability to send digits after answer. That assumes you get answer supervision at a point where is is appropriate to send the additional digits. Some people using analogue FXO connections don’t have answer supervision, so would need to add delays into the main dial string.

Look at the cmd Dial command here: voip-info.org/wiki/view/Asterisk+cmd+Dial

Specifically at the ‘identifier’ flag “w”

so to dial 18005551111 and then dial extension 250 you ‘could’ do something like this:

exten = 555,1,Dial(SIP/MyTrunk/18005551111www250)

This is highly dependant on the remote end and the amount of w’s are a dark art that may not always be reliable.

For SIP, it is totally dependent on the remote end, as it is only a de facto convention that SIP user fields can directly represent phone numbers and I don’t think there are any standards for the use of pauses in such strings. In particular, it is likely to fail if the gateway uses ISDN, which most ITSP will use.

However, I don’t think the OP has ever said that he is using SIP, which is why I gave options for SIP and for FXO analogue.

Great responses!

david55, your are correct, I never said that I am using SIP. The problem is, I don’t know what may be at the remote end of the line.

kschmutz, I will try using the ‘w’ flag. This looks promising.