[asterisk-app-dev] Debugging ARI apps and mixing bridge with DTMF events

Joshua Colp jcolp at digium.com
Thu Oct 16 09:27:54 CDT 2014


Nick Horelik wrote:
> Hello,

Kia ora,

> I've been using ARI for a few months to build some basic apps with some
> success - I definitely like the interface!

Glad to hear it! If there's any improvements you can think of don't 
hesitate to make them known. It's important to get feedback from people 
actually using it.

> Lately I've run into an issue that I'm not sure how to solve, and I
> wanted to ask about best ways to debug.  I'm still a little new to
> Asterisk in general, so I apologize in advance if I'm missing something
> simple.
>
> Right now I'm trying to build a simple app to test the registration of
> DTMF events over a specific trunk that doesn't use rfc4733 for dtmf_mode
> - they only support rfc2833 and sip-info.  I figured out by looking at
> the source of res/res_pjsip/pjsip_configuration.c that I can set
> dmtf_mode=info on my endpoint in pjsip.conf (I had trouble finding
> documentation on this - is there somewhere I can look for more info
> about dtmf_mode?), so I'm hoping that this will work for me.  I didn't
> see the option to use rfc2833 with pjsip.

The rfc4733 option is rfc2833 pretty much, you can use that without any 
problem.

<snip>

>
> Everything works fine if I send the 'outgoing' channel over
> <working_dtmf_trunk>:  the cellphones are connected successfully (I can
> hear audio from one to the other) and my function registered to
> ChannelDtmfReceived successfully gets triggered when I press keys on
> cellphone_2.  The cellphones are also successfully connected when using
> <bad_dtmf_trunk> for the 'outgoing' channel, when I use a bridge created
> with:
>
> client.bridges.create(type='mixing')
>
> Of course in this case the dtmf events are not captured.  Here's where
> I'm stuck: when I use 'mixing,dtmf_events' for the bridge to connect the
> 'outgoing' channel over <bad_dtmf_trunk>, the phones do not seem to be
> successfully connected.  The second cellphone rings and I can answer the
> call, but I can't hear audio between the phones and my function
> registered to ChannelDtmfReceived is never triggered.
>
> Am I missing something fundamental with what I'm trying to do here?  I'm
> happy to post my pjsip.conf if you think my issue might lie there.  If
> everything looks good I can try working with support at this specific
> trunk, but I want to make sure the issue isn't on my end before pursuing
> that.

I don't think you are having an ARI problem, it sounds like you are 
having a NAT issue. Are you behind one by chance? For reliable media 
flow there's extra configuration and port forwarding that should occur. 
If it doesn't then you'll get exactly that behavior. In the working case 
Asterisk will, by default, have media flow directly between both sides 
which if they are both public and outside your network will have it 
work. Your pjsip.conf would also provide a better glimpse into the exact 
setup.

>
> Separately from the specifics of this example, what's the right way to
> debug these sorts of issues?  I've tried checking
> /var/log/asterisk/messages, setting up logs with cel_custom.conf,
> watching the CLI while I try to test - I haven't yet found the right way
> to get any more visibility into why it's not working.  At this point I'm
> considering capturing packets to investigate it, but I feel like there
> must be a better way. Also, is there an easy way to dump to a log all
> events that flow through an ARI application, and not just ones I've
> registered functions to in the app itself?

A packet capture and looking at the SIP signaling + SDP is the easiest 
way for no media flow scenarios.

Cheers,

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-app-dev mailing list