Asterisk unable to recognize exten number pressed by user

I am using IPKall number to receive calls on my asterisk server. If i make a call from soft phone (Xlite, Ekiga) asterisk able to recognize dialed exten number(1 or 2). If i make a call from skype or normal phone asterisk unable to recognize dialed exten number (1 or 2) and unable to redirect to specific exten number.

Kindly let me know what went wrong in my case.

Below extension.conf file:

[general]
;autofallthrough=yes
static=yes
writeprotect=no

[mainmenu]
exten => 1002,1,Answer()
exten => 1002,n,Background(thanksrelgo)
;exten => 1002,n,set(number=${CALLERID(num)})
;exten => 1002,n,SayDigits(${number})
exten => 1002,n,WaitExten(10)

exten => 1,1,Playback(digits/1)
exten => 1,n,Dial(SIP/XXXXXX38,20)
exten => 2,1,Playback(digits/2)
exten => 2,n,Dial(SIP/XXXXXXX630,20)

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(mainmenu,1002,1)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()

below sip.conf

[general]
disallow=all
allow=alaw
allow=ulaw
allow=gsm
port=5060
bindaddr=0.0.0.0
externip=XXX.XX.161.83
localnet=192.168.1.XX/255.255.255.0
context=mainmenu
svrlookup=yes
;avpf=yes
dtmfmode=rfc2833
relaxdtmf=no

[1002]
context=mainmenu
type=peer
dtmfmode=rfc2833
;insecure=very
host=voiper.ipkall.com
nat=no

[XXXXXX638]
deny=0.0.0.0/0.0.0.0
secret=welcome
dtmfmode=rfc2833
canreinvite=no
context=mainmenu
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/XXXXXX638
mailbox=XXXXXX638
permit=0.0.0.0/0.0.0.0
callerid=RelgoSales
callcounter=yes
faxdetect=no

[XXXXXXX630]
deny=0.0.0.0/0.0.0.0
secret=welcome
dtmfmode=rfc2833
canreinvite=no
context=mainmenu
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
encryption=no
callgroup=
pickupgroup=
dial=SIP/XXXXXXX630
mailbox=XXXXXXX630
permit=0.0.0.0/0.0.0.0
callerid=RelgoSupport
callcounter=yes
faxdetect=no

below output of sip debug:

<— SIP read from UDP:66.54.140.46:5060 —>
INVITE sip:1002@183.83.161.83 SIP/2.0
Via: SIP/2.0/UDP 66.54.140.46:5060;branch=z9hG4bK5babae0c;rport
From: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
To: sip:1002@183.83.161.83
Contact: sip:4802539958@66.54.140.46
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 INVITE
User-Agent: IPKall
Max-Forwards: 70
Date: Sat, 24 Aug 2013 10:03:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 334

v=0
o=root 12881 12881 IN IP4 66.54.140.46
s=session
c=IN IP4 66.54.140.46
t=0 0
m=audio 19710 RTP/AVP 0 8 3 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
<------------->
— (14 headers 16 lines) —
Sending to 66.54.140.46:5060 (no NAT)
Sending to 66.54.140.46:5060 (no NAT)
Using INVITE request as basis request - 551543d432c279897d175df90be7b6ba@66.54.140.46
Found peer ‘1002’ for ‘4802539958’ from 66.54.140.46:5060
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 18
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format GSM for ID 3
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (gsm|ulaw|alaw), peer - audio=(gsm|ulaw|alaw|g729)/video=(nothing)/text=(nothing), combined - (gsm|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 66.54.140.46:19710
Looking for 1002 in mainmenu (domain 183.83.161.83)
list_route: hop: sip:4802539958@66.54.140.46

<— Transmitting (no NAT) to 66.54.140.46:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 66.54.140.46:5060;branch=z9hG4bK5babae0c;received=66.54.140.46;rport=5060
From: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
To: sip:1002@183.83.161.83
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 INVITE
Server: Asterisk PBX 11.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:1002@183.83.161.83:5060
Content-Length: 0

<------------>
Audio is at 20566
Adding codec 100004 (alaw) to SDP
Adding codec 100003 (ulaw) to SDP
Adding codec 100002 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (no NAT) to 66.54.140.46:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 66.54.140.46:5060;branch=z9hG4bK5babae0c;received=66.54.140.46;rport=5060
From: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
To: sip:1002@183.83.161.83;tag=as1c342fd1
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 INVITE
Server: Asterisk PBX 11.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:1002@183.83.161.83:5060
Content-Type: application/sdp
Content-Length: 282

v=0
o=root 850136683 850136683 IN IP4 183.83.161.83
s=Asterisk PBX 11.5.0
c=IN IP4 183.83.161.83
t=0 0
m=audio 20566 RTP/AVP 8 0 3 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

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

<— SIP read from UDP:66.54.140.46:5060 —>
ACK sip:1002@183.83.161.83:5060 SIP/2.0
Via: SIP/2.0/UDP 66.54.140.46:5060;branch=z9hG4bK51c8e83e;rport
From: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
To: sip:1002@183.83.161.83;tag=as1c342fd1
Contact: sip:4802539958@66.54.140.46
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 ACK
User-Agent: IPKall
Max-Forwards: 70
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Scheduling destruction of SIP dialog ‘551543d432c279897d175df90be7b6ba@66.54.140.46’ in 32000 ms (Method: ACK)
set_destination: Parsing sip:4802539958@66.54.140.46 for address/port to send to
set_destination: set destination to 66.54.140.46:5060
Reliably Transmitting (no NAT) to 66.54.140.46:5060:
BYE sip:4802539958@66.54.140.46 SIP/2.0
Via: SIP/2.0/UDP 183.83.161.83:5060;branch=z9hG4bK322895aa;rport
Max-Forwards: 70
From: sip:1002@183.83.161.83;tag=as1c342fd1
To: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 BYE
User-Agent: Asterisk PBX 11.5.0
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


<— SIP read from UDP:66.54.140.46:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 183.83.161.83:5060;branch=z9hG4bK322895aa;received=183.83.161.83;rport=5060
From: sip:1002@183.83.161.83;tag=as1c342fd1
To: “TEMPE AZ” sip:4802539958@66.54.140.46;tag=as703ba7d5
Call-ID: 551543d432c279897d175df90be7b6ba@66.54.140.46
CSeq: 102 BYE
User-Agent: IPKall
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0

<------------->
— (10 headers 0 lines) —
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog ‘551543d432c279897d175df90be7b6ba@66.54.140.46’ Method: ACK

There is insufficient verbosity to see what the dialplan is doing and the SIP trace shows a successful call cleared by Asterisk. I’d guess a DTMF handling issue.

thanks for reply… any issue with config files? How would i handle DTMF?

every time when i press extension 2 or 1 going to “exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()”.

I guess asterisk server unable to recognize extension number pressed from mobile phone or skype.

The setting of dtmfmode and the available choice of codecs, including the equvalent settings at the caller’s end (and intermdiate nodes) will determine whether or not DTMFwill work. The details will depend on your specific case.