Unable to detect DTMF tones over SIP INFO(ARI enabled)

BRIEF DESCRIPTION: Unable to detect DTMF tones over SIP INFO or rfc4733(pjsip channel driver) and receive information in websocket.

ASTERISK: 20.5.2

CONFIGURATION: We have Asterisk configured to run with ARI(http/websocket) channels. We wish to create a context for routing calls to specific endpoints to a dial plan where we can detect DTMF tones on either channel(two-way) using WAITEXTEN(). To do this, based on the Asterisk Documentation we have configured the dial plan as below to Answer() the call, Store the incoming Channel_ID, Dial() the target extension, Store the outgoing Channel_ID, Bridge() the 2 Channel_IDs and then Waitexten(300). We wish to force this call to be bridged over either ‘native_rtp’ or ‘simple_bridging’ as we understand both these modes puts Asterisk in the Media path(RTP) or Signaling path(SIP INFO) and would then enable use to detect DTMF tones. The test SIP client we are using supports rfc2833 or SIP INFO. We have pjsip channel drivers managing SIP so, we elected to enable dtmf_mode=info and also configured direct_media=no in pjsip.conf.

Our objective is to bridge calls(using contexts and dial plans) through Asterisk and then have Asterisk detect ChannelDTMFReceived and post the event in the ARI websocket connection. We can listen for these events and react as desired.

ADDITIONAL: We tested IVRDemo and it detects DTMF tones just fine.

REQUEST: Can someone advise us based on out configuration below, what we could be doing wrong? Thanks in advance.

SNAPSHOT: ( Dialplan)

exten => 3000,1,NoOp(Starting call handling for extension 1234) ;just log a message that call has been initiated

same => n,Answer() ;Answer the incoming call

same => n,Set(CALLER_CHANNEL=${CHANNEL(channel)});Save the caller’s channel ID

;same => n,Dial(Local/2500@default)

same => n,Dial(PJSIP/user2) ;

same => 2500,1,NoOp(Redirecting the call to extension no. 2500) ; If the call to the target SIP channel is answered, create a bridge and add both the channels

same => n,GotoIf($[“${DIALSTATUS}” = “ANSWER”]?bridge:hangup)

same => n(bridge),NoOp(Creating native RTP bridge)

same => n,Set(CHANNEL(bothways)=yes) ;Set both-ways audio if needed

same => n,Bridge(${CALLER_CHANNEL},${CHANNEL(channel)}) ;Bridge the two channels

same => n,Noop( Channels joined Bridge) ;

same => n,Stasis(bridge-dtmf); Start the Stasis application

same => n,WaitExten(60) ;listen for DTMF tones for 5 minutes

same => n,Noop( Wait Exten executed) ; Handle DTMF inputs to destroy the bridge

same => 0,1,NoOp(Received DTMF 0, destroying bridge);log received DTMF ‘1’, destroying bridge

same => 0,n,Hangup(); Hang up after destroying the bridge ;

same => i,1,NoOp(Invalid DTMF, hanging up)

same => i,n,Hangup(); Hangup handling

same => 1(hangup),NoOp(Call was not answered or ended); log call was unanswered

same => n,Hangup();clean up resources

This sounds overly complicated and hurts my head.

  1. Is DTMF working?
  2. What is the ARI application actually doing? You won’t see events for things, unless the ARI application is subscribed to the channel in some way

Hi Jcolp :slight_smile:

  1. DTMF is working when we use IVRDemo Application to test if Asterisk is detecting them. We also see these posted as ‘ChannelDTMFReceived’ events posted in websocket( using wscat to look at what events are posted ) so I assume ARI is doing its job when events are detected.

  2. We simply want the ARI application to listen for DTMF events being posted in the websocket ‘channel’. Asterisk seems to execute our Dialplan and also bridge the 2 channels. The call works as per the Dial plan. But then we invoke Waitexten(300) to detect DTMF tones on a bridged call( native_rtp and simple_bridging attempted ). This part is not working. We don’t detect any digits we are typing at either end.

Your thoughts?

My honest thought is to just write an ARI application to do this, instead of trying to bend dialplan and dialplan applications to your will.

Appreciate your logic. We do


need help here as ‘proof of concept’ to do exactly that. As you can see in the image, we do see DTMF events being posted when we use IVRDemo. If we can prove the same can be done on a bridged call(internally), we will develop.

FYI…it’s
wscat -c “wss://asterisk.xxx.xxx.xxxx:8089/ari/events?api_key=asterisk-admin:pil35aivaUXic3feed9c&app=app-world”

Someone else may respond, but I think I’m going to bow out of this thread.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.