Asterisk DTMF not detected in Asterisk 13.10.0

Hello everyone,

I am trying to get input from user. My dialplan looks like this

same => n,Read(phonenumber,enter_destination,8,i,1,3)

My sip.conf file is

[general]
context=simplecall
allowguest=yes
alwaysauthreject=yes
srvlookup=yes
udpbindaddr=0.0.0.0
tcpenable=no
match_auth_username=yes
allowoverlap=no
allowtransfer=no
canreinvite=no
disallow=all
allow=g729
allow=ulaw
allow=alaw
allow=gsm
allow=all
directmedia=no
;nat=force_rport,comedia
externip=x.x.x.x
;localnet=192.168.0.3/255.255.0.0
;allow=speex
dtmfmode=rfc2833

But DTMF is not detected or working unless I code it specifically in the dialplan like this.

same => n,SIPDtmfMode(RFC2833)
same => n,Read(phonenumber,enter_destination,8,i,1,3)

And this has a wait time of 12 seconds even when I have added a max digit of 8. It wait for 12 seconds before proceeding to the next statement

You will need to provide the output of “sip set debug on” to ensure that it is negotiated normally, as well as console output and the output of “rtp set debug on”.

The sip debug on output data is much. What part of it should I provide. Every response keep popping in that I find it hard to trace anything.

The INVITE for the call and the 200 OK.

-- Accepting a maximum of 4 digits.

Audio is at 17380
Adding codec g729 to SDP
Adding codec ulaw to SDP
Adding codec alaw to SDP

<— Reliably Transmitting (NAT) to 46.19.209.14:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 46.19.209.14;branch=z9hG4bK6vxvLaBc;received=46.19.209.14;rport =5060
From: 16353733949 sip:16173730982@46.19.209.14;tag=3B8DECC2-58A132ED0008B979-D 29D1700
To: sip:17818100188@xx.xx.xx.xx:5060;tag=as6ad8c2be
Call-ID: 16-471011CE-58A132ED0008BA04-D29D1700
CSeq: 10 INVITE
Server: Asterisk PBX 13.10.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Contact: sip:17818100188@xx.xx.xx.xx:5060
Content-Type: application/sdp
Content-Length: 269

v=0
o=root 876537524 876537524 IN IP4 xx.xx.xx.xx
s=Asterisk PBX 13.10.0
c=IN IP4 xx.xx.xx.xx
t=0 0
m=audio 17380 RTP/AVP 18 0 8
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

<— SIP read from UDP:46.19.209.14:5060 —>
ACK sip:17818100188@xx.xx.xx.xx:5060 SIP/2.0
Via: SIP/2.0/UDP 46.19.209.14;branch=z9hG4bKtk4jVaWe;rport
From: 16353733949 sip:16173730982@46.19.209.14;tag=3B8DECC2-58A132ED0008B979-D 29D1700
To: sip:17818100188@xx.xx.xx.xx:5060;tag=as6ad8c2be
CSeq: 10 ACK
Call-ID: 16-471011CE-58A132ED0008BA04-D29D1700
Contact: sip:46.19.209.14:5060
Max-Forwards: 70
Content-Length: 0

<------------->

-- <SIP/46.19.209.14-0000023b> Playing '/var/lib/asterisk/sounds/es/enter_PI                                                                                        N.slin' (language 'es')

Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027986, ts 000320, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027987, ts 000480, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027988, ts 000640, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027989, ts 000800, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027990, ts 000960, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027991, ts 001120, len 000020)
> 0x7fb8f0019460 – Probation passed - setting RTP source address to 46.1 9.209.79:51054
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021627, ts 2308319632, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027992, ts 001280, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021628, ts 2308319792, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027993, ts 001440, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021629, ts 2308319952, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027994, ts 001600, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021630, ts 2308320112, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027995, ts 001760, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021631, ts 2308320272, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027996, ts 001920, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021632, ts 2308320432, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027997, ts 002080, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021633, ts 2308320592, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027998, ts 002240, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021634, ts 2308320752, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 027999, ts 002400, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021635, ts 2308320912, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 028000, ts 002560, len 000020)
Got RTP packet from 46.19.209.79:51054 (type 18, seq 021636, ts 2308321072, len 000020)
Sent RTP packet to 46.19.209.79:51054 (type 18, seq 028001, ts 002720, len 000020)

I didnt activate the localnet option in the sip.conf file. I do not know how to get the localnet ip of the asterisk server. Do you think that might be cause

An error with localnet would affect all audio from the device to Asterisk.

I was actually under the impression that Asterisk pre-populated localnets with the one to which it is immediately connected, but, in any case, I don’t understand how you can design a NATted VoIP system without knowing the identity of the unNATted networks.

@david551 Thank you for your response. I still have to do on getting the basics. Most time I just duplicate sip files. This sip file is the one I worked with for the first Asterisk server I built. So I just duplicate it.I admit I am way behind. I think to get the localnet IP. I just do ifconfig, right?

I got the value of the localnet using hostname -i and when I added it to the localnet value in the sip.conf file. It still didnt work. The one I added when I did ifconfig belongs to eth0.