[asterisk-users] Automatically dial a number, then an extension

Tony Mountifield tony at softins.co.uk
Mon May 15 10:59:12 CDT 2017

In article <004201d2cd90$cad754e0$6085fea0$@us>,
Tech Support <asterisk at voipbusiness.us> wrote:
>     I have an application that dials a list of numbers and then plays a
> recorded message. My customer uses it to dial a list of customers to confirm
> their appointment for the next day. No biggie, maybe 25 - 30 calls per day
> for customers who want the confirmation call. What they need now is a way to
> dial an extension after the number is dialed and answered. I've seen that
> before, but I just can't remember where. I was wondering if anyone else has
> implemented something along these lines. Any insight at all would be greatly
> appreciated.
> Thanks Much;
> John V.   

That depends on how you are playing the message. If you are doing an Originate,
either via the AMI or via a call file, then you dial the outbound call using
the Channel parameter, and when the call is answered, it gets attached to the
dialplan segment given by your Context, Extension and Priority parameters.

The dialplan segment at its simplest could be something like this:

exten => s,1,Playback(${MESSAGE})
exten => s,n,Hangup

You would give:
Context: myplaycontext
Extension: s
Priority: 1

You would need to supply the message filename in the variable MESSAGE in the
AMI command or call file (maybe you need _MESSAGE or __MESSAGE when setting).

But you can make it more complex, and could do something like:

exten => _X!,1,Wait(3)
exten => _X!,n,SendDTMF(${EXTEN})
exten => _X!,n,Wait(5) ; how long???
exten => _X!,n,Playback(${MESSAGE})
exten => _X!,n,Hangup

So if your recipient has an extension number configured, instead of giving s as
the Extension, you give the extension number.

Alternatively, you could supply the DTMF to be dialled in a channel variable.

The problem you will have is that, while for direct lines, you know when to
start playing the message, as you can tell when the line has been answered,
when dialling an extension number on the answering PBX, you have no way of
telling when that extension has been answered and it is safe to play the message.
That is why I added the comment "how long???", as it is just a guess.

Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

More information about the asterisk-users mailing list