GitHubContribute in GitHub: Edit online

copyright: years: 2019 lastupdated: "2019-10-29"


Sending Dual-tone multi-frequency (DMTF) tones to a caller

You can use the vgwActSendDTMF action to send dual-tone multi-frequency (DTMF) tones to a caller as described in RFC 4733, section 3.2.

IBM® Voice Gateway supports RFC 4733, RTP Payload for DTMF Digits, SIP Info, Telephony Tones, and Telephony Signals.

To customize the DTMF sessions, you can specify action sequences in the Watson Assistant dialog and tailor your Voice Gateway configuration.

About the DTMF send action

DTMF sessions begin for Voice Gateway when an action sequence is triggered in Watson Assistant, starting with the vgwActSendDTMF action tag.

The vgwActSendDTMF action in the following example tells Voice Gateway to send a DTMF tone with 911 event codes. Sixty milliseconds elapses before another DTMF tone is sent.

{
  "vgwAction": {
    "command": "vgwActSendDTMF",
    "parameters": {
      "dtmfDigits": [
        {
          "code": "9",
          "volume" : -8
        },
        {
          "code": "1"
        },
        {
          "code": "1"
        }
      ],
      "sendInterval": 60
    }
  }
}

DTMF send attribute

Use the following attributes and event codes to configure the vgwActSendDTMF action tag.

Table 1. Attributes of the vgwActSendDTMF action tag.
Attribute Default value Description
dtmfDigits None A JSON array of JSON objects where each element represents a DTMF tone to be sent to a caller. See table 2 for the supported DTMF object attributes.
sendInterval 200 Optional. An interval in milliseconds (ms) to wait before sending the next DTMF tone in the list.
Table 2. DTMF object attributes
Attribute Default value Description
code None The event code to send. The supported range is 0 - 15. See table 3 for the DTMF events.
duration 200 Optional. The duration of the event in milliseconds (ms).
volume 0 The power level of the tone in dBm0. The supported range is 0 to -63 dBm0.
Table 3. DTMF events
Event Code
0 - 9 0 - 9
10

11
A - D 12 - 15

Receiving Dual-tone multi-frequency (DTMF) tones over SIP INFO from a caller

Starting with version 1.0.4, Voice Gateway supports the SIP INFO method that carries the Dual-tone multi-frequency (DTMF) information.

The following formats are supported:

Example 1

  • application/dtmf-relay mime-type

    INFO sip:user@example.com SIP/2.0
    Via: SIP/2.0/UDP example.com:5060
    From: <sip:alice@example.com>;tag=d3f423d
    To: <sip:user@example.com>;tag=8942
    Call-ID: 312352@myphone
    CSeq: 5 INFO
    Content-Length: 24
    Content-Type: application/dtmf-relay
    
    Signal=5
    Duration=160
    

    In this example the digit 5 is transmitted with an indicated duration of 160 milliseconds.

Example 2

  • application/dtmf mime-type

    In this format, the body of the message consists only of the DTMF digit.

    INFO sip:user@example.com SIP/2.0
    Via: SIP/2.0/UDP example.com:5060
    From: <sip:alice@example.com>;tag=d3f423d
    To: <sip:user@example.com>;tag=8942
    Call-ID: 312352@myphone
    CSeq: 5 INFO
    Content-Length: 1
    Content-Type: application/dtmf
    
    5
    

Example 3

  • application/dtmf and application/dtmf-relay formats are also supported when they are sent in a multi-part body, as shown in the example below:

    INFO sip:user@example.com SIP/2.0
    Via: SIP/2.0/UDP example.com:5060
    From: <sip:alice@example.com>;tag=d3f423d
    To: <sip:user@example.com>;tag=8942
    Call-ID: 312352@myphone
    CSeq: 5 INFO
    Content-Length: 89
    Content-Type: multipart/mixed;boundary=boundary
    
    --boundary
    Content-Type: application/dtmf-relay
    
    Signal=#
    Duration=160
    --boundary-