Automatically Dial A Number, Then An Extension
All;
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.
Recommended
Recent Questions
- Asterisk Release 21.1.0
- Asterisk Release 20.6.0
- Asterisk Release 18.21.0
- Mailing List Shutdown Reminder
- Aeap Wss Connection
- SIP_HEADER GET_TRANSFERRER_DATA Chan_pjsip
- Chan_iax2.c:4739 __auto_congest: Auto-congesting Call Due To Slow Response
- Asterisk Release 21.0.2
- Asterisk Release 20.5.2
- Asterisk Release 18.20.2
Frequent Terms
AMI
Anyone
app
application
asterisk
Asterisk Development Team
call
caller
callerid
chan
cli
com
connection
Dahdi
default
Digium
dtmf
error
exten
extension
file
google
hangup
IAX
incoming calls
linkedin
linux
message
module
pbx
phone
port
PRI
PSTN
queue
realtime
sip
sip phone
source
support
system
thanks in advance
time
trunk
www api
Categories
- Advanced Dialplan
- Asterisk Announces
- Asterisk System Management
- Asterisk Tips
- Asterisk Tutorial
- Asterisk Users
- Book Reviews
- Dialplan Basics
- General
- Initial Configuration of Asterisk
- Installing Asterisk
- IT Jobs
- Java News
- Off Topic News
- Preparing a System for Asterisk
- programming
- Technical News
- Uncategorized
- VoIP News
FAQs Archive
- January 2024 (7)
- December 2023 (12)
- November 2023 (6)
- October 2023 (5)
- September 2023 (7)
- August 2023 (13)
- July 2023 (23)
- June 2023 (17)
- May 2023 (18)
- April 2023 (15)
- March 2023 (5)
- February 2023 (8)
- January 2023 (10)
- December 2022 (9)
- November 2022 (13)
- October 2022 (14)
- September 2022 (10)
- August 2022 (15)
- July 2022 (14)
- June 2022 (7)
- May 2022 (17)
- April 2022 (9)
- March 2022 (14)
- February 2022 (14)
- January 2022 (10)
- December 2021 (15)
- November 2021 (23)
- October 2021 (18)
- September 2021 (12)
- August 2021 (13)
- July 2021 (11)
- June 2021 (13)
- May 2021 (16)
- April 2021 (8)
- March 2021 (11)
- February 2021 (11)
- January 2021 (26)
- December 2020 (36)
- November 2020 (14)
- October 2020 (25)
- September 2020 (21)
- August 2020 (10)
- July 2020 (20)
- June 2020 (37)
- May 2020 (30)
- April 2020 (22)
- March 2020 (22)
- February 2020 (26)
- January 2020 (24)
- December 2019 (26)
- November 2019 (38)
- October 2019 (32)
- September 2019 (23)
- August 2019 (15)
- July 2019 (32)
- June 2019 (20)
- May 2019 (19)
- April 2019 (22)
- March 2019 (31)
- February 2019 (35)
- January 2019 (49)
- December 2018 (35)
- November 2018 (21)
- October 2018 (36)
- September 2018 (18)
- August 2018 (26)
- July 2018 (34)
- June 2018 (34)
- May 2018 (29)
- April 2018 (24)
- March 2018 (31)
- February 2018 (46)
- January 2018 (31)
- December 2017 (39)
- November 2017 (38)
- October 2017 (29)
- September 2017 (28)
- August 2017 (25)
- July 2017 (30)
- June 2017 (43)
- May 2017 (37)
- April 2017 (49)
- March 2017 (36)
- February 2017 (37)
- January 2017 (32)
- December 2016 (45)
- November 2016 (68)
- October 2016 (67)
- September 2016 (65)
- August 2016 (54)
- July 2016 (44)
- June 2016 (59)
- May 2016 (71)
- April 2016 (55)
- March 2016 (77)
- February 2016 (83)
- January 2016 (55)
- December 2015 (44)
- November 2015 (37)
- October 2015 (65)
- September 2015 (68)
- August 2015 (54)
- July 2015 (68)
- June 2015 (78)
- May 2015 (69)
- April 2015 (83)
- March 2015 (113)
- February 2015 (55)
- January 2015 (70)
- December 2014 (68)
- November 2014 (61)
- October 2014 (85)
- September 2014 (72)
- April 2014 (45)
- March 2014 (95)
- February 2014 (72)
- January 2014 (101)
- December 2013 (3)
- November 2013 (1)
- May 2013 (3)
- March 2013 (2)
- February 2013 (1)
- December 2012 (9)
- November 2012 (1)
- October 2012 (2)
- September 2012 (1)
- August 2012 (2)
- July 2012 (3)
- June 2012 (2)
- April 2012 (7)
- March 2012 (5)
- February 2012 (9)
- January 2012 (6)
- December 2011 (11)
- November 2011 (5)
- October 2011 (18)
- September 2011 (12)
- August 2011 (4)
- July 2011 (18)
- June 2011 (5)
- May 2011 (1)
- March 2011 (1)
- February 2011 (2)
- January 2011 (1)
- December 2010 (3)
- November 2010 (3)
- October 2010 (2)
- September 2010 (2)
- August 2010 (1)
Recommended
Frequent Terms
AMI
Anyone
app
application
asterisk
Asterisk Development Team
call
caller
callerid
chan
cli
com
connection
Dahdi
default
Digium
dtmf
error
exten
extension
file
google
hangup
IAX
incoming calls
linkedin
linux
message
module
pbx
phone
port
PRI
PSTN
queue
realtime
sip
sip phone
source
support
system
thanks in advance
time
trunk
www api
Recent Questions
- Asterisk Release 21.1.0
- Asterisk Release 20.6.0
- Asterisk Release 18.21.0
- Mailing List Shutdown Reminder
- Aeap Wss Connection
- SIP_HEADER GET_TRANSFERRER_DATA Chan_pjsip
- Chan_iax2.c:4739 __auto_congest: Auto-congesting Call Due To Slow Response
- Asterisk Release 21.0.2
- Asterisk Release 20.5.2
- Asterisk Release 18.20.2
Categories
- Advanced Dialplan
- Asterisk Announces
- Asterisk System Management
- Asterisk Tips
- Asterisk Tutorial
- Asterisk Users
- Book Reviews
- Dialplan Basics
- General
- Initial Configuration of Asterisk
- Installing Asterisk
- IT Jobs
- Java News
- Off Topic News
- Preparing a System for Asterisk
- programming
- Technical News
- Uncategorized
- VoIP News
FAQs Archive
- January 2024 (7)
- December 2023 (12)
- November 2023 (6)
- October 2023 (5)
- September 2023 (7)
- August 2023 (13)
- July 2023 (23)
- June 2023 (17)
- May 2023 (18)
- April 2023 (15)
- March 2023 (5)
- February 2023 (8)
- January 2023 (10)
- December 2022 (9)
- November 2022 (13)
- October 2022 (14)
- September 2022 (10)
- August 2022 (15)
- July 2022 (14)
- June 2022 (7)
- May 2022 (17)
- April 2022 (9)
- March 2022 (14)
- February 2022 (14)
- January 2022 (10)
- December 2021 (15)
- November 2021 (23)
- October 2021 (18)
- September 2021 (12)
- August 2021 (13)
- July 2021 (11)
- June 2021 (13)
- May 2021 (16)
- April 2021 (8)
- March 2021 (11)
- February 2021 (11)
- January 2021 (26)
- December 2020 (36)
- November 2020 (14)
- October 2020 (25)
- September 2020 (21)
- August 2020 (10)
- July 2020 (20)
- June 2020 (37)
- May 2020 (30)
- April 2020 (22)
- March 2020 (22)
- February 2020 (26)
- January 2020 (24)
- December 2019 (26)
- November 2019 (38)
- October 2019 (32)
- September 2019 (23)
- August 2019 (15)
- July 2019 (32)
- June 2019 (20)
- May 2019 (19)
- April 2019 (22)
- March 2019 (31)
- February 2019 (35)
- January 2019 (49)
- December 2018 (35)
- November 2018 (21)
- October 2018 (36)
- September 2018 (18)
- August 2018 (26)
- July 2018 (34)
- June 2018 (34)
- May 2018 (29)
- April 2018 (24)
- March 2018 (31)
- February 2018 (46)
- January 2018 (31)
- December 2017 (39)
- November 2017 (38)
- October 2017 (29)
- September 2017 (28)
- August 2017 (25)
- July 2017 (30)
- June 2017 (43)
- May 2017 (37)
- April 2017 (49)
- March 2017 (36)
- February 2017 (37)
- January 2017 (32)
- December 2016 (45)
- November 2016 (68)
- October 2016 (67)
- September 2016 (65)
- August 2016 (54)
- July 2016 (44)
- June 2016 (59)
- May 2016 (71)
- April 2016 (55)
- March 2016 (77)
- February 2016 (83)
- January 2016 (55)
- December 2015 (44)
- November 2015 (37)
- October 2015 (65)
- September 2015 (68)
- August 2015 (54)
- July 2015 (68)
- June 2015 (78)
- May 2015 (69)
- April 2015 (83)
- March 2015 (113)
- February 2015 (55)
- January 2015 (70)
- December 2014 (68)
- November 2014 (61)
- October 2014 (85)
- September 2014 (72)
- April 2014 (45)
- March 2014 (95)
- February 2014 (72)
- January 2014 (101)
- December 2013 (3)
- November 2013 (1)
- May 2013 (3)
- March 2013 (2)
- February 2013 (1)
- December 2012 (9)
- November 2012 (1)
- October 2012 (2)
- September 2012 (1)
- August 2012 (2)
- July 2012 (3)
- June 2012 (2)
- April 2012 (7)
- March 2012 (5)
- February 2012 (9)
- January 2012 (6)
- December 2011 (11)
- November 2011 (5)
- October 2011 (18)
- September 2011 (12)
- August 2011 (4)
- July 2011 (18)
- June 2011 (5)
- May 2011 (1)
- March 2011 (1)
- February 2011 (2)
- January 2011 (1)
- December 2010 (3)
- November 2010 (3)
- October 2010 (2)
- September 2010 (2)
- August 2010 (1)
10 thoughts on - Automatically Dial A Number, Then An Extension
Le 15/05/2017
In article <004201d2cd90$cad754e0$6085fea0$@us>, Tech Support wrote:
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:
[myplaycontext]
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:
[myplaycontext]
… 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.
Cheers Tony
Hi John,
I think we need to known how you play the audio to the customers, before we can help you.
Are you using AMI? Or AGI maybe? Or Call files?
What Asterisk version do you have?
El 15 may. 2017 12:35, “Tech Support” escribió:
Hey;
What happens is that a script logs into the AMI and originates a call. When the call is answered, it jumps to a context in the dial plan.
Thanks Much;
John V.
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Victor Villarreal Sent: Monday, May 15, 2017 12:08 PM
To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: Re: [asterisk-users] Automatically dial a number, then an extension
Hi John,
I think we need to known how you play the audio to the customers, before we can help you.
Are you using AMI? Or AGI maybe? Or Call files?
What Asterisk version do you have?
El 15 may. 2017 12:35, “Tech Support” escribió:
All;
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.
All;
What I did was add a line in the dialplan that used the SendDTMF() application and that worked great. The problem that I’ve run into now is that dialing the extension screwed up the answering machine detection. The sample context looks something like this.
[play-audiomsg]
exten => s,1,AMD
exten => s,n,ExecIf($[“${EXT}” != “”]?SendDTMF(${EXTEN}))
exten => s,n,Background(${AUDIOMSG})
exten => s,n,Hangup
As you can see, it’s very simple. Modifying the amd.conf configuration wasn’t the answer since I don’t know how long it will take for the extension to pick up. Simply placing the AMD command after the SendDTMF() wasn’t the answer I don’t know how to approach this problem.
Thanks;
John V.
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Tech Support Sent: Tuesday, May 16, 2017 03:56 PM
To: ‘Asterisk Users Mailing List – Non-Commercial Discussion’
Subject: Re: [asterisk-users] Automatically dial a number, then an extension
Hey;
What happens is that a script logs into the AMI and originates a call. When the call is answered, it jumps to a context in the dial plan.
Thanks Much;
John V.
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Victor Villarreal Sent: Monday, May 15, 2017 12:08 PM
To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: Re: [asterisk-users] Automatically dial a number, then an extension
Hi John,
I think we need to known how you play the audio to the customers, before we can help you.
Are you using AMI? Or AGI maybe? Or Call files?
What Asterisk version do you have?
El 15 may. 2017 12:35, “Tech Support” escribió:
All;
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.
Isn’t it safe to assume that if you’ve been given an extension number to dial after the initial call is answered, then it wasn’t answered by an answering machine?
The extension might be answered by an answering machine, I suppose, but that’s not the problem you’re talking about (I think).
I would create two contexts:
1. Does AMD and gets called when there is no follow-on extension to dial
2. Dials a follow-on extension and doesn’t do AMD (or at least, not at the start)
Then you choose which context to place the call through depending on whether a follow-on extension has been supplied for that customer’s number or not.
Why wasn’t it the answer? What happens or doesn’t happen when you try this?
Antony
—
“A person lives in the UK, but commutes to France daily for work. He belongs in the UK.”
– From UK Revenue & Customs notice 741, page 13, paragraph 3.5.1
– http://tinyurl.com/o7gnm4
Please reply to the list;
please *don’t* CC me.
—
Ok, the purpose of the answering machine detection (AMD) is to determine when the audio file should start playing *after* the call has been picked up. Typically, if a call has been picked up by a person, they say a short greeting, for example “Hello, this is John, how can I help you?” or simply “Hello?” or something similar. If a call has been picked up by an answering machine, usually the message is somewhat longer, maybe 10 seconds or so, maybe longer. Ideally, the AMD tries to make sure that the audio file starts right after the greeting is over. It’s not exact, but my experience is that it works fairly well.
The problem that I am having is that when I also have to dial an extension, the call has already picked up and the AMD will start working immediately after the SendDTMF() even if dialing the extension means that it may ring anywhere from 5 – 20 seconds plus the greeting on the far end. There doesn’t appear to be a way for the AMD to wait until extension gets picked up, either by a human or a machine. So what happens is that the AMD gets confused and the audio file starts playing while the extension is still ringing. I hope this helps. Thanks;
John V.
—–Original Message—–
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] Isn’t it safe to assume that if you’ve been given an extension number to dial after the initial call is answered, then it wasn’t answered by an answering machine?
The extension might be answered by an answering machine, I suppose, but that’s not the problem you’re talking about (I think).
I would create two contexts:
1. Does AMD and gets called when there is no follow-on extension to dial
2. Dials a follow-on extension and doesn’t do AMD (or at least, not at the start)
Then you choose which context to place the call through depending on whether a follow-on extension has been supplied for that customer’s number or not.
Why wasn’t it the answer? What happens or doesn’t happen when you try this?
—
Okay, so my suggestion still stands:
Create two contexts:
– one which does AMD and gets called when there is no follow-on extension to dial
– another which dials a follow-on extension and doesn’t do AMD (or at least, not at the start)
Then you choose which context to place the call through depending on whether a follow-on extension has been supplied for that customer’s number or not – if there’s no follow-on extenstion, use the first context; if there is, use the second one.
Antony.
—
BASIC is to computer languages what Roman numerals are to arithmetic.
Please reply to the list;
please *don’t* CC me.
—
I definitely appreciate your insight on this and I split the context into two contexts, but I still have a problem. That is, after I send the extension digits using SendDTMF( ), I need to be able to tell whether or not the far end extension picked up and I don’t know how to do that. Because of that, the message sometimes gets played while the extension is still ringing. Thanks Much;
John V.
—–Original Message—–
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] Okay, so my suggestion still stands:
Create two contexts:
– one which does AMD and gets called when there is no follow-on extension to dial
– another which dials a follow-on extension and doesn’t do AMD (or at least, not at the start)
Then you choose which context to place the call through depending on whether a follow-on extension has been supplied for that customer’s number or not – if there’s no follow-on extenstion, use the first context; if there is, use the second one.
Antony.
—
BASIC is to computer languages what Roman numerals are to arithmetic.
Please reply to the list;
please *don’t* CC me.
—
might a waitForSilence come in useful here?