DTMF not working with transferred calls

Hi,

As a simple test, I’ve configured my Asterisk server to forward all incoming calls to my ITSP’s IVR.

When I call my ITSP directly from a PSTN phone, I can enter my PIN etc without any problems. However, when I call my DID from a PSTN which diverts to my ITSP then nothing happens when I press the keys on my phone.

I’ve tried setting dtmfmode=inband in the general context of sip.conf as it looked like it might be relevant from searching these forums. I’ve noticed that the inbound and outbound calls appear to be gsm if that makes any difference, and that my Asterisk server appears to hand-off the call to the ITSP’s.

So why can’t I get DTMF to work?

Here’s a trace of what’s happening …
pr 20 20:25:15 NOTICE[1547]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
– Accepting UNAUTHENTICATED call from 204.11.194.34:
> requested format = g729,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm|ilbc),
> priority = mine
– Executing GotoIf(“IAX2/204.11.194.34:4569-4”, “0?200:10”) in new stack
– Goto (shanghai,s,10)
– Executing Playback(“IAX2/204.11.194.34:4569-4”, “pls-wait-connect-call”) in new stack
– Playing ‘pls-wait-connect-call’ (language ‘en’)
– Executing Dial(“IAX2/204.11.194.34:4569-4”, “IAX2/trunk_3/15551234567|30”) in new stack
– Called trunk_3/15551234567
– Call accepted by 62.4.81.180 (format gsm)
– Format for call is gsm
– IAX2/trunk_3-6 is making progress passing it to IAX2/204.11.194.34:4569-4
– IAX2/trunk_3-6 is ringing
– IAX2/trunk_3-6 is making progress passing it to IAX2/204.11.194.34:4569-4
– IAX2/trunk_3-6 stopped sounds
– IAX2/trunk_3-6 answered IAX2/204.11.194.34:4569-4
– Attempting native bridge of IAX2/204.11.194.34:4569-4 and IAX2/trunk_3-6
– Channel ‘IAX2/trunk_3-6’ ready to transfer
– Channel ‘IAX2/204.11.194.34:4569-4’ ready to transfer
– Releasing IAX2/204.11.194.34:4569-4 and IAX2/trunk_3-6
Apr 20 20:31:45 NOTICE[1547]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
– Hungup ‘IAX2/trunk_3-6’
== Spawn extension (shanghai, s, 11) exited non-zero on ‘IAX2/204.11.194.34:4569-4’
– Hungup ‘IAX2/204.11.194.34:4569-4’

NOTE: That after the Hungup appears in the trace, the call is still connected between the 2 endpoints (presumably without my Asterisk server in the middle any more).

And after my server bows out of the connection, DTMF still doesn’t work.

[quote=“banjo67xxx”]I’ve tried setting dtmfmode=inband in the general context of sip.conf as it looked like it might be relevant from searching these forums. I’ve noticed that the inbound and outbound calls appear to be gsm if that makes any difference, and that my Asterisk server appears to hand-off the call to the ITSP’s.
[/quote]

I bet GSM distort DTMF too much, especially as inband signal must go in and out. You can try force G.711

disallow=all allow=ulaw; or alaw depending on your region
if inband must be used. But ask your ITSP if you can use out-band DTMF. (More and more support out-band now.) That’s far more reliable.

For diagnosis purposes, you don’t even need to hook to your ITSP’s IVR. Simply use your dial plan to read DTMF and see if Asterisk can recognized your digits.

voip-info.org/wiki/view/Asterisk+DTMF

So now I’m using outband DTMF and everything works whilst the DID is talking to my Asterisk server, but as soon as the call gets transferred DTMF no longer works with the terminating IVR.

Here’s my DID entry in iax.conf

[fromshanghai]
type=user
dtmfmode=rfc2833
dtmf=rfc2833
disallow=all
;allow=ulaw
allow=gsm
allow=ilbc
context=shanghai

Here’s my outbound entry in iax.conf

[trunk_3]
type = peer
secret = xxxxxxxxxxx
provider =
trunkstyle = customvoip
username = xxxxx
trunkname = Custom - DiamondCard
callerid = xxxxxxxxxxxx
hasexten = no
hassip = no
hasiax = yes
registeriax = yes
registersip = no
host = eugw.ast.diamondcard.us
dialformat = ${EXTEN:1}
context = DID_trunk
group =
insecure =
fromuser =
fromdomain =
dtmfmode = rfc2833
dtmf = rfc2833

I reprogrammed extensions.conf to

[shanghai]
exten => s,1,GotoIf($[${CALLERIDNUM:-11} = 55512345678]?200:10)
exten => s,10,Playback(pls-wait-connect-call)
exten => s,11,Dial(${trunk_3}/8655512345678,30)
exten => s,12,VoiceMail(u20@default)
exten => s,13,Hangup()
exten => s,112,VoiceMail(b20@default)
exten => s,113,Hangup()
exten => s,200,Answer()
exten => s,201,Set(TIMEOUT(digit)=10)
exten => s,202,Set(TIMEOUT(response)=60)
exten => s,203,Playback(pls-entr-num-uwish2-call)
exten => s,204,Playback(followed-by)
exten => s,205,Read(NUMBER,hash)
exten => s,206,Dial(${trunk_3}/${NUMBER},30)
exten => s,207,Congestion()
exten => s,307,Congestion()

So now I can call my Shanghai DID, enter the phone number of my bank, and althougth my IVR could hear the DTMF and transfer me, my bank’s IVR can’t hear the DTMF

What is see in the trace is that Asterisk has sucessfully transferred the call and hung up, and my bank’s IVR is still saying “Please enter your account number” and ignoring what I press on the cellphone.

– Call accepted by 62.4.81.180 (format gsm)
– Format for call is gsm
– IAX2/trunk_3-8 is making progress passing it to IAX2/204.11.194.34:4569-5
– IAX2/trunk_3-8 answered IAX2/204.11.194.34:4569-5
– Attempting native bridge of IAX2/204.11.194.34:4569-5 and IAX2/trunk_3-8
– Channel ‘IAX2/trunk_3-8’ ready to transfer
– Channel ‘IAX2/204.11.194.34:4569-5’ ready to transfer
– Releasing IAX2/204.11.194.34:4569-5 and IAX2/trunk_3-8
– Hungup ‘IAX2/trunk_3-8’
== Spawn extension (shanghai, s, 206) exited non-zero on ‘IAX2/204.11.194.34:4569-5’
– Hungup ‘IAX2/204.11.194.34:4569-5’

Any ideas what’s happening here?

If your own box can detect DTMF from the same cell phone, there’s not much you can do on your side. Ask your provider why they cannot transmit DTMF correctly to the bank. (Likely they are using someone else’s gateway, and need to sort things out down the stream.)