Sending DTMF during a call

Fabian Luttman

New Member
Joined
Mar 24, 2018
Messages
8
Reaction score
0
Hello,
Is there any way to have an extension that will answer a call, wait a second, output 9 (in dtmf) and hung up?
I want to use it to open my condo door automatically when I receive a delivery or a visitor, without having to pick up the phone and dial it manually.
Any ideas? other than to terminate the call in a recording of the DTMF audio...
Thanks for your help?
Fabian
 

dallas

Active Member
Joined
Oct 21, 2007
Messages
212
Reaction score
27
Location
Sydney, Australia
Where does the call originate? What is the function of the dtmf 9?
Can you expand on your description. The more info you provide the easier it is to help you.
 

Fabian Luttman

New Member
Joined
Mar 24, 2018
Messages
8
Reaction score
0
Hi Dallas,
The call originates in the PSTN (intercom at the entrance of the condo), and comes into my Asterisk as a SIP Trunk.
Currently, I send it to one if my extensions, I pick up the call, I have the option to talk to the caller at the door, and pressing 9 opens the door for the visitor.
Since whoever comes looking for me is either a friend or a delivery person, I just want to have them dial the my code at the intercom (which will dial my SIP number via the PSTN) and I want to have Asterisk do all the work: answer the call, dial 9 and hung up.
 

dallas

Active Member
Joined
Oct 21, 2007
Messages
212
Reaction score
27
Location
Sydney, Australia
Hi Fabian,
If you want to automatically open the door by sending dtmf you could send the call to an ivr, play a message, then play the dtmf.
Have you considered that you could be letting someone in while you are not home?
 

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
I would add thefollowing (or similar) to extensions_custom.conf
Code:
exten => *001,1, Answer
exten => *001,n, Wait(1)
exten => *001,n, Authenticate(1234)
exten => *001,n, SendDTMF(9)
exten => *001,n, Playback(welcome)
exten => *001,n, Hangup
Then I would add a custom extension like the following:
2351

Then just set your inbound route so that the intercom goes to the custom extension
 

Fabian Luttman

New Member
Joined
Mar 24, 2018
Messages
8
Reaction score
0
Thank you Gerry!
I think you are pointing me in the right direction. I didn't know about the SendDTMF command...
This is what I have so far:

exten => 7755,1,Answer
exten => 7755,n,Wait(1)
exten => 7755,n,Playback(hello)
exten => 7755,n,SendDTMF(99,,1000)
exten => 7755,n,Playback(welcome)
exten => 7755,n,Hangup

But when I try calling it (from another extension), I can hear the playbacks (hello and welcome) but not the DTMF tones. It will give me just silence...
I think it is sending the DTMF as SIP codes, and I need them as inband tones to be detected by the intercom.

Here is the log of one call to this extension:
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
> 0x76016f60 -- Strict RTP learning after remote address set to: 192.168.0.35:2228
-- Executing [[email protected]:1] Answer("SIP/812-000002a7", "") in new stack
> 0x76016f60 -- Strict RTP switching to RTP target address 192.168.0.35:2228 as source
-- Executing [[email protected]:2] Wait("SIP/812-000002a7", "1") in new stack
-- Executing [[email protected]:3] Playback("SIP/812-000002a7", "hello") in new stack
-- <SIP/812-000002a7> Playing 'hello.ulaw' (language 'en')
-- Executing [[email protected]:4] SendDTMF("SIP/812-000002a7", "99,,1000") in new stack
-- Executing [[email protected]:5] Playback("SIP/812-000002a7", "welcome") in new stack
-- <SIP/812-000002a7> Playing 'welcome.ulaw' (language 'en')
> 0x76016f60 -- Strict RTP learning complete - Locking on source address 192.168.0.35:2228
-- Executing [[email protected]:6] Hangup("SIP/812-000002a7", "") in new stack
== Spawn extension (from-internal, 7755, 6) exited non-zero on 'SIP/812-000002a7'
-- Executing [[email protected]:1] Macro("SIP/812-000002a7", "hangupcall") in new stack
-- Executing [[email protected]:1] GotoIf("SIP/812-000002a7", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [[email protected]:3] ExecIf("SIP/812-000002a7", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [[email protected]:4] Hangup("SIP/812-000002a7", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/812-000002a7' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/812-000002a7'
 

GerryGerry

Member
Joined
Dec 26, 2015
Messages
38
Reaction score
5
When calling another SIP de
Thank you Gerry!
I think you are pointing me in the right direction. I didn't know about the SendDTMF command...

But when I try calling it (from another extension), I can hear the playbacks (hello and welcome) but not the DTMF tones. It will give me just silence...
I think it is sending the DTMF as SIP codes, and I need them as inband tones to be detected by the intercom.
You could spend some time configuring the extension to send DTMF inband rather than using RFC2833 or sip info BUT it would probably be a lot simpler to just download the DTMF tones and upload them to the sounds directory then just replace the SendDTMF line with playback(DTMF_9) to the dialplan (assuming the file is named DTMF_9)

a quick google search should find plenty of dtmf audio files to download for free

Let us know how you get on
 
Last edited:

Fabian Luttman

New Member
Joined
Mar 24, 2018
Messages
8
Reaction score
0
Thank you Gerry!
I will try that and let you know, but I guess it should work fine.
;)
 

Fabian Luttman

New Member
Joined
Mar 24, 2018
Messages
8
Reaction score
0
Hi Gerry,
Your implementation worked fine when I called that extension from another extension, but I couldn't make it work from the PSTN.
Since I had the DTMF already loaded into the system as an audio file, I ended up doing the following from the GUI:
  1. Loaded the audio file (in .gsm format) as a System Recording
  2. Created an inbound route based on the CID of the Intercom
  3. Pointed the inbound route to play the newly created recording.
It works great and it does exactly what I needed!
Thank you!!
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,371
Messages
137,398
Members
14,576
Latest member
emmonks