Friday, February 25, 2011

DTMF issue on Asterisk

IVR and DTMF doesn't work very well if you have VoIP and PSTN connectivity.

IVR to work with VoIP<-->PSTN system perfectly, DTMF coding must be precise which can't be achieved perfectly with VoIP system (no matter if it is CISCO, AVAYA or Asterisk) all the time.

VoIP<-->VoIP is not a problem as DTMF code is passed as RTP payload and they know what to do with it.

VoIP<----RTP Payload------------RTP Payload------>VoIP


But with VoIP<-->PSTN, those DTMF tone has to be converted to RTP payload or RTP payload has to be converted back to DTMF tone, which doesn't happen precisely all the time.
VoIP <----RTP Payload--------------------DTMF------>PSTN

Q: How can I troubleshoot DTMF on asterisk?

Ans: You can go to /etc/asterisk/logger.conf and add dtmf for logging.

#vi /etc/asterisk/logger.conf
[logfiles]
full => verbose,debug,dtmf

Reload logger in asterisk

#asterisk -rv
CLI> logger reload

Perform test calls.

#tail -f /var/log/asterisk/full [ to see the realtime data logging ]

Press Ctrl + C to get out of the real time data monitoring

Q: I am having issues with duplicate DTMF. It appears that my asterisk box is receiving doubled DTMF signals. What could I do to fix it?

Ans: You have to change the setting in /etc/asterisk/chan_dahdi.conf. Add relaxdtmf=yes in that file.

Please ignore trunkgroups setting if that's not applicable in your environment. You simply need is relaxdtmf=yes under [channels] context

#vi /etc/asterisk/chan_dahdi.conf
[trunkgroups]
trunkgroup => 2,24,48

spanmap => 1,2,l
spanmap => 2,2,0

[channels]

usecallerid=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
callerid=asreceived
relaxdtmf=yes


;This is PSTN Connection (G2)
context=From_Dahdi
switchtype=national
signalling=pri_cpe
group=2
channel => 1-23
channel => 25-47

Q: What kind of DTMF signalling should I prefer?

Ans: Out-of-band technique or RFT2833 is the most appropriate one and it's default on asterisk. You can explicitly specify
dtmfmode=auto [ Use rfc2833 if offered, inband otherwise ]
or
dtmfmode=rfc2833

If you are using SIP channels/trunks, define dtmfmode in sip.conf under [general] context

For more info you can visit www.voip-info.org

1 comment:

  1. Hello Sir,

    I am Using Dahdi and confbridge to create conference but i press any key in ongoing conference its not showing in asterisk cmd i want to stored it in database

    Looking forward from your side

    Thanks you
    Laxman Parmar

    ReplyDelete