This manual consist info about DTMF feature supported by Flashphoner
What is DTMF
DTMF - Dual-Tone Multi-Frequency signaling
This signaling method used for telecommunication over analog telephone lines in the voice-frequency band between telephone handsets and other communications devices and the switching center.
Methods of sending DTMF
There are 3 methods of sending DTMF in SIP environment:
- SIP INFO packets.
- As specially marked events in the RTP stream - see: RFC 2833.
- Inband as normal audio tones in the RTP stream with no special coding or markers.
Flashphoner supports DTMF with 1 and 2
Example:
Javascript → Flashphoner-client → Flashphoner-server → Asterisk
This scheme using for DTMF sending and implements simple IVR menu.
If you not familiar with Asterisk, you can find book "Asterisk PBX Configuration Guide" for increase your knowledges about Asterisk installation and configuration process.
Let`s go throw it step-by-step:
- Configuring Asterisk and creating IVR-menu.
Create backup of sip.conf and extensions.conf files and replace theirs with this:sip.conf[general] bindport=5060 bindaddr=0.0.0.0 context=default dtmfmode=info allow=all [2000] type=friend secret=2000 host=dynamic canreinvite=no dtmfmode=info [2001] type=friend secret=2001 host=dynamic canreinvite=no dtmfmode=infoHere we configured two SIP accounts: 2000, and 2001.

dtmfmode=info means that Asterisk works DTMF by SIP INFO packets way, which described above. extensions.conf[default] exten=>2001,1,answer() exten=>2001,2,background(conf-adminmenu) exten=>2001,3,hangup() exten=>1,1,playback(digits/1) exten=>1,2,goto(default,2001,1) exten=>2,1,playback(digits/2) exten=>2,2,goto(default,2001,1) exten=>3,1,playback(digits/3) exten=>3,2,goto(default,2001,1) exten=>4,1,playback(digits/4) exten=>4,2,goto(default,2001,1) exten=>5,1,playback(digits/5) exten=>5,2,goto(default,2001,1) exten=>6,1,playback(digits/6) exten=>6,2,goto(default,2001,1) exten=>7,1,playback(digits/7) exten=>7,2,goto(default,2001,1) exten=>8,1,playback(digits/8) exten=>8,2,goto(default,2001,1) exten=>9,1,playback(digits/9) exten=>9,2,goto(default,2001,1) exten=>0,1,playback(digits/0) exten=>0,2,goto(default,2001,1) exten=>*,1,playback(letters/asterisk) exten=>*,2,goto(default,2001,1) exten=>#,1,playback(letters/at) exten=>#,2,goto(default,2001,1) exten=>A,1,playback(letters/a) exten=>A,2,goto(default,2001,1) exten=>B,1,playback(letters/b) exten=>B,2,goto(default,2001,1) exten=>C,1,playback(letters/c) exten=>C,2,goto(default,2001,1) exten=>D,1,playback(letters/d)
In this configuration file we define dial-plan for incoming calls.
- Lets check this configuration with softphone like Xlite or other.
- Register with 2000 SIP account on Asterisk server.
- Call to 2001 SIP account.
- You should hear the IVR menu with a pretty voice.
- Now, if you press 1 - you will hear "one", if you press 2 - you will hear "two" and so on. If you press * - you will hear "asterisk".
It is simple voice menu, which you able to customize in the Asterisk-side.
- Now we able to test Flashphoner with this voice menu.
If you download Flashphoner, you can use default Flashphoner client with DTMF support- Register with 2000 SIP account on Asterisk server over Flashphoner.
- Call to 2001 SIP account.
- You will hear the same as if you call using Xlite or other softphone. You can press Flashphoner-client buttons 0..9 * [asterisk], # [hash] and hear voice representation of this buttons.
- Now about Javascript to Flashphoner bridge:
Flashphoner-client example uses swfobject.js for embed swf to HTML page.
positionStatus function uses for handling event about initializing swf complete:swfobject.embedSWF("flashphoner_client.swf", "flashphone", "580", "258", "10.0.12", "expressInstall.swf", flashvars, params,attributes,positionStatus); - So we get reference on flashphoner_client swf in:
var flashphoner; function positionStatus(e){ flashphoner = e.ref; } - Then we able to send DTMF, using js function:
function sendDtmf(dtmf){ //result==0 if error, result==1 if no errors var result = flashphoner.sendDtmf(dtmf); }
- And HTML buttons:
<input type="button" onclick="sendDtmf('0')" value="0"/> <input type="button" onclick="sendDtmf('1')" value="1"/> <input type="button" onclick="sendDtmf('2')" value="2"/> <input type="button" onclick="sendDtmf('3')" value="3"/> <input type="button" onclick="sendDtmf('4')" value="4"/> <input type="button" onclick="sendDtmf('5')" value="5"/> <input type="button" onclick="sendDtmf('6')" value="6"/> <input type="button" onclick="sendDtmf('7')" value="7"/> <input type="button" onclick="sendDtmf('8')" value="8"/> <input type="button" onclick="sendDtmf('9')" value="9"/> <input type="button" onclick="sendDtmf('*')" value="*"/> <input type="button" onclick="sendDtmf('#')" value="#"/> <input type="button" onclick="sendDtmf('A')" value="A"/> <input type="button" onclick="sendDtmf('B')" value="B"/> <input type="button" onclick="sendDtmf('C')" value="C"/> <input type="button" onclick="sendDtmf('D')" value="D"/>
- Now you can press HTML/js buttons and get the same result as when you press flash buttons 0 1 2 .. etc.
DTMF over RFC2833
You should use this properies:
codecs=alaw,ulaw,g729,h263,h264,speex16,telephone-event dtmf=rfc2833
rfc2833 related properties are:
- telephone-event - included by default in codec list
- dtmf=rfc2833 - force using of rfc2833(dtmf over info is default).
DTMF settings
DTMF can be configured in flashphoner.properties file using one of this values:
- dtmf=info
- dtmf=info_relay
- dtmf=rfc2833
See also configuring section