DTMF Transmission Problem

Home » Asterisk Users » DTMF Transmission Problem
Asterisk Users 4 Comments

I am having difficulties with customer-bound DTMF being very short & clipped off (and basically unusable, as systems on the customer side aren’t recognizing the DTMF digits, and I can barely tell that DTMF is there when I listen on a handset).

My system set up as follows:

PSTN <--> Metaswitch <-SIP-> Asterisk <-SIP or IAX2-> CPE

Asterisk is running Asterisk 10.4.0 on a CentOS 6.2 VM residing on a CentOS 6.3 KVM host. Asterisk has one network interface connected to the Metaswitch without NAT to place/receive calls from the PSTN, and a separate interface to connect to CPE equipment. SIP and IAX are bound to both interfaces. Vocal call quality is fine, DTMF is fine from the customer to the PSTN, but DTMF from the PSTN to the customer isn’t. Asterisk is set to remain in the media path on all calls. The customer facing IP address on the Asterisk server is private and is being 1:1 NATed through a MikroTik RB 1100 to a public address that the customers are then connecting to. I have also placed test calls with the “customer equipment” inside the same LAN as the Asterisk server’s customer facing IP address (no NAT) with precisely the same symptoms. The same symptoms persist whether the PSTN or the CPE initiate the call.

My example configs are as follows:

SIP –
[general]
limitonpeer=yes notifyringing=yes notifyhold=yes allowsubscribe=yes disallow=all allow=g722
allow=ulaw allow=gsm allowoverlap=no callevents=yes allowguest=no directmedia=no

bindport=bind_here bindaddr=to_this_address srvlookup=yes maxexpiry=7200
defaultexpiry=3600

[authentication]
[test-voice]
type=friend host=dynamic secret=not_my_secret context=users disallow=all allow=ulaw nat=yes directmedia=no qualify=yes trunk=no

IAX2 –
[general]
bindport=bind_here bindaddr=to_this_address delayreject=yes disallow=all allow=g722
allow=ulaw allow=gsm jitterbuffer=no encryption=yes

[test-fax1]
type=friend host=dynamic username=test-fax1
secret=not_my_secret context=users disallow=all allow=ulaw qualify=yes trunk=no requirecalltoken=no

SIP peers are Zhone ZNID-2xxx series ONTs. IAX peers are ATCOM AG198 ATA gateways, either behind the ONTs (but on the same voice VLAN the ONTs use to talk to Asterisk) or on my Asterisk server’s local network. The voice VLAN is a different subnet than Asterisk is on, but no NAT exists between the subnets.

Thank you,

Noah Engelberth System Administration MetaLINK Technologies

4 thoughts on - DTMF Transmission Problem

  • [snip]

    [snip]

    What is the dtmf mode of Metaswitch in the above diagram? Is it possible that it’s muting the DTMF and then not generating the corresponding DTMF event messages? Everytime I’ve seen “clipped”
    DTMF in the past it was due to imperfect muting at the PSTN -> SIP
    interface.

    You should be able to take a packet trace on the interface of the Asterisk server communicating with the Metaswitch to determine whether the problem first appears at the switch or in your Asterisk server.

    Cheers, Shaun

  • According to the gentleman that manages the Metaswitch, it’s set to allow for either in or out of band dtmf. Based on the packet trace, the packets are coming across as RFC 2833 RTP events. Aside from the very first digit, which Wireshark shows as 7 “RTP Event” packets and 3 “RTP Event (end)” packets, all the other ones on my test call came across as 8 “RTP Event” packets and 3 “RTP Event (end)” packets. All of the RTP Event packets are in sequence for the call’s RTP stream.

    Also, when I’m monitoring in Asterisk, if I configure logger.conf to output DTMF events into the console, Asterisk is recognizing the DTMF:

    [Aug 2 12:25:25] DTMF[19319]: channel.c:4136 __ast_read: DTMF begin ‘4’ received on SIP/PSTN-SIP-PEER
    [Aug 2 12:25:25] DTMF[19319]: channel.c:4146 __ast_read: DTMF begin passthrough ‘4’ on SIP/ PSTN-SIP-PEER
    [Aug 2 12:25:25] DTMF[19319]: channel.c:4051 __ast_read: DTMF end ‘4’ received on SIP/ PSTN-SIP-PEER, duration 280 ms
    [Aug 2 12:25:25] DTMF[19319]: channel.c:4091 __ast_read: DTMF end accepted with begin ‘4’ on SIP/ PSTN-SIP-PEER
    [Aug 2 12:25:25] DTMF[19319]: channel.c:4120 __ast_read: DTMF end passthrough ‘4’ on SIP/ PSTN-SIP-PEER

  • Additional information I discovered after my previous reply:

    I have a separate Asterisk VM instance (in all other ways the same implementation as above) that is running an IVR. This instance has no issues with inbound DTMF within the IVR, but does exhibit the same symptoms for DTMF when bridged through to an IAX2 peer with the same settings as the first Asterisk VM. On the second Asterisk (with the IVR), DTMF to my Cisco/Linksys SPA942 SIP phones works properly, but not to the IAX or SIP ATAs that I am using (the same ones I’m having problems with on the first Asterisk). All of the live customers on the first Asterisk are ATAs, so I don’t know as of this time whether or not SPA phones are working correctly on the first server, though it’s reasonable to assume they are.

    In addition, calls from an SPA942 phone to the IAX or SIP ATAs are also not transmitting DTMF to the ATA device’s endpoint. DTMF from the ATA device’s endpoint to the SPA942 is working correctly, as is both directions of voice audio.