This is a documentation for Flashphoner version 1.0.5.973
We recommend you upgrade to the last version and check the actual documentation

DTMF

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:

  1. SIP INFO packets.
  2. As specially marked events in the RTP stream - see: RFC 2833.
  3. 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:

  1. 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=info

    Here 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.

  2. Lets check this configuration with softphone like Xlite or other.
    1. Register with 2000 SIP account on Asterisk server.
    2. Call to 2001 SIP account.
    3. You should hear the IVR menu with a pretty voice.
    4. 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.

  3. Now we able to test Flashphoner with this voice menu.
    If you download Flashphoner, you can use default Flashphoner client with DTMF support
    1. Register with 2000 SIP account on Asterisk server over Flashphoner.
    2. Call to 2001 SIP account.
    3. 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.

  4. 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);
    


  5. So we get reference on flashphoner_client swf in:
    var flashphoner;
    
    function positionStatus(e){
    	flashphoner = e.ref;
    }


  6. 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);
    }
    


  7. 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"/>
    


  8. 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:

flashphoner.properties
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

Labels

dtmf dtmf Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.