No RTP packets

I’ve an ARI application (my-app). It is executed after a number is dialed. Everything is working fine (ARI application is registered), but after the number is called, no RTP packets are coming to my UDP server.
All the applications (asterisk, ARI. UDP server) are running on localhost.
In my ARI source code I do the following:

  • connect to asterisk with ARI
  • On channel Event StasisStart answer channel
  • Create bridge (type mixing)
  • Make externalMedia Channel
  • add channels to bridge

Added the following in /etc/asterisk/extensions_custom.conf

[custom-app]
exten => s,1,Answer()
  same => n,Stasis(my-app)
  same => n,Hangup()

Here is the asterisk log:

Creating the app:

 Creating Stasis app 'my-app'
  == WebSocket connection from '127.0.0.1:58098' for protocol '' accepted using version '13'

enabled rtp debugging

debian-freepbx*CLI> rtp set debug on
RTP Packet Debugging Enabled

Then calling the number:

    -- Goto (ext-did,s,1)
    -- Executing [s@ext-did:1] Set("PJSIP/peoplefone_FreePBX-00000004", "__DIRECTION=INBOUND") in new stack
    -- Executing [s@ext-did:2] Set("PJSIP/peoplefone_FreePBX-00000004", "CHANNEL(tonezone)=us") in new stack
    -- Executing [s@ext-did:3] ExecIf("PJSIP/peoplefone_FreePBX-00000004", "0?Set(__FROM_DID=s)") in new stack
    -- Executing [s@ext-did:4] Set("PJSIP/peoplefone_FreePBX-00000004", "returnhere=1") in new stack
    -- Executing [s@ext-did:5] Gosub("PJSIP/peoplefone_FreePBX-00000004", "app-blacklist-check,s,1()") in new stack
    -- Executing [s@app-blacklist-check:1] GotoIf("PJSIP/peoplefone_FreePBX-00000004", "0?blacklisted") in new stack
    -- Executing [s@app-blacklist-check:2] Set("PJSIP/peoplefone_FreePBX-00000004", "CALLED_BLACKLIST=1") in new stack
    -- Executing [s@app-blacklist-check:3] Return("PJSIP/peoplefone_FreePBX-00000004", "") in new stack
    -- Executing [s@ext-did:7] GotoIf("PJSIP/peoplefone_FreePBX-00000004", "0?") in new stack
    -- Executing [s@ext-did:8] ExecIf("PJSIP/peoplefone_FreePBX-00000004", "0 ?Set(CALLERID(name)=06423498392)") in new stack
    -- Executing [s@ext-did:9] Set("PJSIP/peoplefone_FreePBX-00000004", "__MOHCLASS=") in new stack
    -- Executing [s@ext-did:10] Set("PJSIP/peoplefone_FreePBX-00000004", "__REVERSAL_REJECT=FALSE") in new stack
    -- Executing [s@ext-did:11] GotoIf("PJSIP/peoplefone_FreePBX-00000004", "1?post-reverse-charge") in new stack
    -- Goto (ext-did,s,13)
    -- Executing [s@ext-did:13] NoOp("PJSIP/peoplefone_FreePBX-00000004", "") in new stack
    -- Executing [s@ext-did:14] Set("PJSIP/peoplefone_FreePBX-00000004", "__CALLINGNAMEPRES_SV=allowed_not_screened") in new stack
    -- Executing [s@ext-did:15] Set("PJSIP/peoplefone_FreePBX-00000004", "__CALLINGNUMPRES_SV=allowed_not_screened") in new stack
    -- Executing [s@ext-did:16] Set("PJSIP/peoplefone_FreePBX-00000004", "CALLERID(name-pres)=allowed_not_screened") in new stack
    -- Executing [s@ext-did:17] Set("PJSIP/peoplefone_FreePBX-00000004", "CALLERID(num-pres)=allowed_not_screened") in new stack
    -- Executing [s@ext-did:18] NoOp("PJSIP/peoplefone_FreePBX-00000004", "CallerID Entry Point") in new stack
    -- Executing [s@ext-did:19] Set("PJSIP/peoplefone_FreePBX-00000004", "__CRM_DIRECTION=INBOUND") in new stack
    -- Executing [s@ext-did:20] Set("PJSIP/peoplefone_FreePBX-00000004", "__CRM_SOURCE=06423498392") in new stack
    -- Executing [s@ext-did:21] Set("PJSIP/peoplefone_FreePBX-00000004", "__CRM_LINKEDID=1743921485.9") in new stack
    -- Executing [s@ext-did:22] AGI("PJSIP/peoplefone_FreePBX-00000004", "agi://127.0.0.1/sangomacrm.agi,true") in new stack
    -- <PJSIP/peoplefone_FreePBX-00000004>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
    -- Executing [s@ext-did:23] ExecIf("PJSIP/peoplefone_FreePBX-00000004", "1?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)") in new stack
    -- Executing [s@ext-did:24] Goto("PJSIP/peoplefone_FreePBX-00000004", "custom-app,s,1") in new stack
    -- Goto (custom-app,s,1)
    -- Executing [s@custom-app:1] Answer("PJSIP/peoplefone_FreePBX-00000004", "") in new stack
       > 0x7fbb502da110 -- Strict RTP learning after remote address set to: 95.128.80.2:52374
    -- Executing [s@custom-app:2] Stasis("PJSIP/peoplefone_FreePBX-00000004", "my-app") in new stack
       > 0x7fbb6408bca0 -- Strict RTP learning after remote address set to: 127.0.0.1:45001
    -- Called 127.0.0.1:45001/c(slin16)
    -- UnicastRTP/127.0.0.1:45001-0x7fbb6408b0f0 answered
       > Launching Stasis(my-app) on UnicastRTP/127.0.0.1:45001-0x7fbb6408b0f0
    -- Channel PJSIP/peoplefone_FreePBX-00000004 joined 'simple_bridge' stasis-bridge <b333e479-1a10-411d-b0b4-1b91e056a074>

What is wrong here? I still see no RTP packets when the RTP debug is enabled.

You’ve provided neither your stasis application, nor a log of its communication with Asterisk, however, I note that the the Unicast channel hasn’t joined the bridge.

Also, you have taken yourself out of the FreePBX environment, so the Asterisk forum may be a better place to ask, although it is possible they would like you to produced a test case without FreePBX at all.

If you are behind NAT, it is also possible that you haven’t set your media address, and the caller won’t know where to send its RTP until you have sent some to it. It doesn’t look like you have sent anything to it.

Thank you for the tip. It seems, that the channel didn’t join in the correct way to the bridge. After fixing this, I’m getting the RTP stream.