PJSIP TLS Sometimes RTP, Sometimes No RTP

Home » Asterisk Users » PJSIP TLS Sometimes RTP, Sometimes No RTP
Asterisk Users 2 Comments


I have a PJSIP account configured as below. I am testing with the Echo Test application on Asterisk 13 and using CSipSimple.

I can create a call with TLS and SRTP, however for some reason only 1 in every 5 calls has audio.

When I connect over WiFi, I have audio every single time. When I connect over 3G/4G I only get audio every now and then.

Sometimes pjsip shows: Probation passed – setting RTP source address to
[public ip:port] and I get audio when using a mobile network.

Most of the time though asterisk shows it’s playing the demo echotest file, but there doesn’t appear to be any RTP and I hear no audio.

I’m using TLS and SRTP (SDES) Mandatory. I’ve tried various codecs too. I’ve tried STUN and ICE but with little luck.

Ideas would be greatly appreciated!


type=endpoint context=some_context disallow=all allow=speex allow=gsm allow=alaw allow=ulaw allow=speex16
auth=someuser aors=someuser direct_media=no media_encryption=sdes media_encryption_optimistic=yes rtp_symmetric=yes force_rport=yes rewrite_contact=yes ice_support=yes

type=auth auth_type=userpass password=[redacted]

type=aor remove_existing=yes max_contacts=1



2 thoughts on - PJSIP TLS Sometimes RTP, Sometimes No RTP

  • With the exception of media_encryption_optimistic=yes and ice_support no, my setup looks like yours and I’m not having any problems with CSipSimple, even with SRTP mode = mandatory. I assume your server has a public IP address and there’s no NAT involved on the server side? Oddly enough, I have ICE and Aggressive ICE turned on in CSipSimple.

    CSipSimple in the Play store is a little stale. Have you tried the
    “nightly” version?

  • Hi George,

    I tried the nightly build and also Bria. I can replicate the same issue on both.

    This morning I made many successful calls in succession. This evening it was intermittent again.

    Could it be the mobile network is blocking the RTP but it seems odd it works sometimes and not others.

    That said I have another setup with Kamailio which talks to the same asterisk via pjsip. I get audio on this account every single time when using mobile networks. It’s very strange. It seems like PJSIP simply doesn’t set up the RTP when I connect to the asterisk directly.

    Any other suggestions?