Sending DTMF after a call is bridged

(Re-posting this as I had a link to another question before and it seems to be tripping up the moderation flag. Sorry for the inconvenience)

Hi Everyone,

I know there is another question (Topic ID:81736) with a similar title but my use case is different and was also hoping to get some additional clarity on some of the responses for that question.

Each month, I need to pay my insurance company. They do not accept automatic payments via credit card but they let me pay each month’s premium over the phone using a credit card. I wanted to automate the tedium of inputting all the responses to make the payment. So I turned to Asterisk for this task. I am using a vanilla installation of Asterisk and not FreePBX / AsteriskNow.

I thought I will just use the Dial command’s D option but that does not actually work. My dialplan is below:

exten => 203,1,Monitor(wav,,i) ; recording it so I can listen to the confirmation later on 
exten => 203,n,Dial(SIP/DIAL_OUT_NUMBER,,D(www212121{{truncated}}))
exten => 203,n,Playtones(congestion)
exten => 203,n,Hangup()

I use LinPhone to dial the extension 203 and Asterisk dials my DIAL_OUT_NUMBER and after a few seconds of pause and sending tones, the call gets bridged. But unfortunately the IVR on the other hand has not received any of the DTMF tones. Atleast it starts the greeting as though none was sent. Although, when I try this on my cell phone, I seem to be getting DTMF tones. Please note that I tried different values for dtmfmode (auto, rfc2833, etc.) but no luck.

Once the call is bridged, I can use LinPhone to send DTMF tones through the keypad and it functions just like my cell phone but I would like to automate this sending of tones as well.

My question is how can I send DTMF tones after my call is bridged (i.e., simulate a manual key press on LinPhone)? I read AMI Originate as a possible solution to this. However, I don’t know how to get started. I can use Perl AMI interface but how do I know which channel this call is on? Any sample code (in whatever form) around interacting with the call after it is live will be very much appreciated. I don’t care for performance – I just need to do this once a month.



Thanks, David. It took me a while to get the AMI setup and send test calls. The only thing is in the latest version of the Asterisk, it looks like the AMI command is ‘playDTMF’ instead of ‘sendDTMF’.