I am building an application in Asterisk , which has to simulate the phone keypress action i.e DTMF. For instance , if a caller calls a number and the IVR requires to press a digit , the application (say a webpage) should also be able to simulate the same key press. I tried the following:
- I have a web application that triggers PlayDTMF action over AMI to simulate the key press on the caller channel. Unfortunately this didn't work , as it played the DTMF digit on the channel (the keypress could be heard) but asterisk didn't receive the DTMF. It was just playing the DTMF, which is what the AMI action was designed for. I technically need to "send" the DTMF digit on the channel.
- the sendDTMF function in asterisk couldn't be used either,as it is a dialplan function and I need a AMI action to trigger DTMF from an external source.
A similar issue was reported sometime back: Asterisk AMI: DTMF not received on SIP channel
I am using Asterisk 11. Is there a way to implement the above using AMI/AGI? Or do i need to further upgrade my Asterisk to 12 to make use of ARI?
Appreciate your inputs.
I managed to simulate the DTMF action , by Dialing/Originating out to a local context and using the outgoing bridging channel id for DTMF input. So the flow is :
call lands on Asterisk -> Asterisk Dials out to a Local context -> The dialout creates a bridging event which has the outgoing channel id(store in some DB) -> The local context can have the IVR flow and using the stored channel and PLayDTMF action - dtmf digits can be inserted. Not sure if there is a more elegant solution to this!
Related
I am using Asterisk 15 server and wanted to configure IVR call simulation. My configuration scenario is
1. A subscriber will register to Asterisk server and start a call.
2. The IVR audio will come from the Asterisk sever to sbscriber.
3. Once the subscriber pressed the botton, the call will connect to a number based on DTMF digit pressed by subscriber. Then call will continue for 30 seconds.
I observered for normal call pjsip.conf file is used for configuration of a subscribers.
Could you please help me on below queries ?
1. Which file we need to configure for the IVR call simulation ?
2. Please suggest a good documentation for IVR simulation.
Files are extensions.conf and pjsip.conf/sip.conf
You have read book for beginner, for example "Asterisk the future of telephony".
After that write dialling core or reuse vicidial.org or other core and write dialplan in extensions.conf for you ivr.
What you tried to do usually called "press-1 outbound dialling campaign"
I have an executive and incoming caller. I patched their call in Asterisk using the dial command, but how can I to receive the inputi.e DTMF from the caller?
You should look at features.conf. It contains examples for:
dynamic features
These dynamic features can be triggered by in-call DTMF.
My goal is to :
run a background task activated by dynamic feature while in active call, that will execute dial to another EXT and send DTMF.
It means, when a user is active call with someone, when the user press 5555, the door will be opened.
In order to open the door today, I have to manually call EXT 6(the door) and send DTMF digits: 00*
All of this has to happen automatically when the user press 5555 without interfering the active call.
I tried before to do all of this with dial, but dial blocks the call or bridges with another extension and then I lose the original call.
I figured out that I need to do this with ASYNC, means I can not use dialplan, I need to use CLI, and then originate some how.
Asterisk will need to create a local session / local channel and establish/connect to the door extension, then send DTMF and hangup
All of this – in background.
this is somthing i managed to do so far:
features_applicationmap_custom.conf
openthedoor=> 5555,caller,macro,OpenIntercomCall
then in ->
extensions_custom.conf
[macro-OpenIntercomCall]
exten => s,1,System(asterisk -rx "channel originate SIP/6 extension#yoyo")
i do not understand how do i call to SIP/6 from asterisk(using a local or random channel), and then send DTMF on answer.
the door ext is SIP/6, and 00* is the dtmf to open it.
What i am trying to do is that when a user 5555 in a call, the door will be opened.
means i want asterisk to call the intercom and send dtmf
There are no any sence do exec asterisk from inside asterisk. You can do Originate command.
Originate(tech_data,type,arg1[,arg2[,arg3[,timeout]]])
For example you can do something like this
exten => s,1,Originate(SIP/6,app,SendDTMF,ww00*)
Should be enought for your need.
I'm using asterisk with webrtc in chrome (SIPml5 client) and also using their webrtc2sip gateway.
My problem is that I can't send the hook-flash/flash signal to asterisk for some reason.
Is there a possibility to trigger hook flash by sending DTMF signals ? (which apparently work for me )
Example: I want to trigger the standard hold functionality by sending the following DTMF sequence: #123.
On the other hand as a workaround, could I hold a channel using AMI or AGI ?
Basically I want the other party to hear OnHoldMusic while the channels/call remain active. On the local side I can just mute the audio tag which is fine.
Thanks.
Yes, you can do hold using ami command hold or AGI exec command musiconhold
That info is availible in AMI/AGI documentation
You can handle dtmf by using features.conf
I am using confBridge in my asterisk for conferencing.
I want to detect who is talking and who is not talking inside a conference.
For this there is an option in confBridge "talk_detection_events=yes" this sends the talk events to AMI, but it only sends the talk events when the user joins a conference and after that I am not able to see any events in AMI.
I want that whenever a user starts talking or stops talking there should be an event triggered in AMI.
Or, is there any command by which I can detect if a user is talking or not in confbridge?
Also, I want to detect keypress (dtmf) events in confbridge. There is an option "dtmf_passthrough=yes" which pass the dtmf events to the AMI, but I did not see any events when a user presses any key in a conference.
Please help me in setting up these.
Regards
Anil
Talk Detection:
While setting talk_detection_events=yes will enable sending AMI events out denoting when a user begins/ends talking, that may not be sufficient to configure your ConfBridge depending on several other factors.
Whether or not a user is determined to be 'talking' depends on combinations of the dsp_talking_threshold and dsp_silence_threshold settings. If you are not receiving the talk detection events that you expect, then you may need to tweak these settings to match the audio properties that ConfBridge is receiving from its participants.
Alternatively, you should ensure that your AMI account has sufficient class permissions to receive the Talk Detection events. The event has the EVENT_FLAG_CALL class permission, and you should be listening for the event ConfbridgeTalking.
DTMF
dtmf_passthrough has nothing to do with the actual raising of the DTMF AMI event, which is done by the channel read/write routines. dtmf_passthrough allows the DTMF key presses to be sent to the other channels in the bridge - typically, the ConfBridge application absorbs the DTMF key presses.
With this enabled, you should see DTMF events - at a minimum - on the Bridging channel. If you aren't seeing events of any kind, you most likely don't have the appropriate class permissions set on the AMI account.
All of that being said, I have to wonder why you're looking for the DTMF key presses. In general, actions on channels in ConfBridge should take place using the menu system implemented in ConfBridge, or using the AMI/CLI commands. You'd be hard pressed to accurately intercept and handle a channel's DTMF while it was still in the conference bridge - the channel, at that point, is in owned by the bridge layer, and anything you choose to do to that channel is almost certainly unsafe.