Help Needed in Sending DTMF 'AFTER' call is bridged


I need to find a way to send some DTMF strings both ways ( caller and callee ) WHILE they are IN a call.

Is there some automated way to do this ?

Using the D option with the Dial command only sends the DTMF BEFORE the call is bridged ( i.e. no audio is passed except the DTMF )

I tried using the M option with a macro containing the commands
exten => s,1,Answer
exten => s,n,SendDTMF(1234)

but it still shows ringing while the DTMF is being sent.

The G option works( i.e. the soft phone shows that the call is connected ), but immediately after the DTMF is sent, the call gets disconnected as it doesn’t return. I tried to GOTO back using
exten => s,n,Goto(${OUT_${DIAL_TRUNK}}/${OUTNUM})
but nothing.

I am using the FreePBX/Asterisk as a trunk.

Note : We want to automatically execute commands such as Macro, SendDTMF etc. AFTER the call is bridged and NOT before.

The only ways of sending DTMF after the call is bridged is:

1st party: sending it from the phone;
3rd party: injecting DTMF frames using AMI.

However, I would point out that once you have used G on Dial to do a Goto, you can complete the bridge using the Bridge application. G based methods will not allow you to transfer bridged audio, although you will be able do more than just send DTMF.

I imagine most people with this sort of requirement would have a CTI application and be using AMI anyway, but you could always spawn a short running AMI application.

There is nothing in the FreeSwitch wike page you quote that suggests to me that the DTMF is sent after the bridge is established. The program might go beyond that documentation.

Now that’s some helpful reply. Thanks man. I saw your similar reply where you said the same, albeit not in this much detail.
I think I would be interested in this “3rd party: injecting DTMF frames using AMI.” but really have no idea on how to do it. Can it be used to send it both ways ?

The wiki page said :

Send DTMF digits after a bridge is successful from the session using the … "

3rd party means that you are viewing the PABX from outside of any call, which means you can do operations on any channel.

Look in the book at Read the AMI chapter, then look in the AMI appendix for something like SendDTMF.

Will I be able to do this to 100+ simultaneous calls using AMI ? A script will probably be required to do it for each call.

I think you will need to give details of the application before you can get further useful advice. A single AMI process may well meet the requirements, and I still don’t need to understand why you need to inject DTMF after the two parties have been allowed to speak to each other.

Asterisk/FreePBX is used as a trunk with this sole purpose of automatically sending DTMF tone ‘0’ to the caller(s) after 20 seconds once a call is bridged without the callee(s) pressing any button BUT as if they were sent by the callee(s).

Will this work ? :

Action: PlayDTMF
Channel: SIP/ALL ???
Digit: wwwwwwwwwwwwwwwwwwww0

Thanks in advance.

I tried the following and all of them gave the same ’ Response: Error | Message: Channel not specified "

Action: PlayDTMF
Channel: SIP
Digit: 1

Action: PlayDTMF
Channel: SIP/
Digit: 1

Action: PlayDTMF
Channel: SIP/all
Digit: 1

Action: PlayDTMF
Channel: SIP/103
Digit: 1

Action: PlayDTMF
Channel: SIP/103-*
Digit: 1

Action: PlayDTMF
Channel: SIP/103-_.
Digit: 1

Action: PlayDTMF
Channel: *
Digit: 1

Action: PlayDTMF
Channel: _.
Digit: 1

Channel has to be a channel, i.e. something that would be listed on core show channels. In particular it must include - at the end.

If you really want to send DTMF to everyone, once, a fixed interval into the call, a single, continuously running AMI thread could read events to detect and handle all the calls.

However knowing the real application is still likely to be the best way of getting good solutions.

Can’t AMI work with variables of the dial-plan ?

Action: PlayDTMF
Channel: $(CHANNEL)
Digit: 1

Maybe not as they are two different things.

Yes but that would require some advanced scripting perhaps.

However knowing the real application is still likely to be the best way of getting good solutions.[/quote]
The thing is that the caller’s side will disconnect if it doesn’t sense a DTMF tone within 30 seconds ( even if some audio conversation is going on )

The only application I am aware of with that sort of requirement is consumer grade alarm dialers. For that application, automatically generating the tone would be rather bad practice, as the whole point is to ensure that a human is really listening. Nonetheless, the Dial D option should cover that case.

But, as previously discussed, the Dial D option doesn’t bridge the call while sending DTMF.
Using AMI it can be achieved but need some automation.
I was also wondering if it can be done using chanspy with the whisper option.

Why do you need it bridged when sending?

To show on the softphone that the call is connected.

That requires doing it it just before bridging, rather than whilst bridged. Under no conditions will the tone be mixed with audio in the same direction, so it won’t be fully bridged, anyway.

We want to send DTMF after 15 seconds of bridging ( 0:15 in the softphone ). Is there any script or something like that that can help ? Because all other options like D or SendDTMF are useless for us.