How to enable external srtp within the bundled pjsip project?

Hi, I want to enable WebRTC.

I have followed and

On the last step, in Asterisk, when I am performing a call in my browser, I have these logs :

[Oct 14 11:01:42] ERROR[24464]: res_rtp_asterisk.c:2079 ast_rtp_dtls_set_configuration: SRTP support module is not loaded or available. Try loading
[Oct 14 11:01:42] ERROR[24464]: res_pjsip_sdp_rtp.c:925 setup_dtls_srtp: Attempted to set an invalid DTLS-SRTP configuration on RTP instance '0x7f45a4033780'

So, I think I need to enable the module, that I don’t have, because I didn’t enabled it, in the menuselect, I found that it depends on srtp(E) (E = external ?).

After a little search, I found (maybe I am wrong) that I need to enable srtp on pjsip ? So I tried to define the variable PJPROJECT_CONFIGURE_OPTS for the configure script like so :

./configure --exec-prefix=/rdd2/programs/asterisk/$asterisk_version --prefix=/rdd2/programs/asterisk/$asterisk_version --with-jansson-bundled --with-ssl PJPROJECT_CONFIGURE_OPTS="--with-external-srtp=plip"

This result in this strange behaviour :

[pjproject]  Rebuilding
[pjproject]  Configuring with --with-external-srtp=plip --prefix=/opt/pjproject --disable-speex-codec --disable-speex-aec --disable-bcg729 --disable-gsm-codec --disable-ilbc-codec --disable-l16-codec --disable-g722-codec --disable-g7221-codec --disable-opencore-amr --disable-silk --disable-opus --disable-video --disable-v4l2 --disable-sound --disable-ext-sound --disable-sdl --disable-libyuv --disable-ffmpeg --disable-openh264 --disable-ipp --disable-libwebrtc --without-external-pa --without-external-srtp --disable-resample --disable-g711-codec --enable-epoll

It is at the same time enabled and disabled ?

Do I have to add srtp for webrtc ? is it the right way to do so ?

I am using Asterisk v17.4.0


We do not use the media implementation in the PJSIP library or project, so it does not need SRTP. The res_srtp module is strictly an Asterisk thing and it requires the srtp development package of your Linux distribution to be installed, or for libsrtp to be built manually and installed. Have you done this and re-run configure to have it detect libsrtp?

I didn’t want to use my distribution srtp package, that’s why I was searching how I could use an external srtp build path.

It would be passed to the Asterisk configure script. All options can be seen using “./configure --help”. I personally have no experience passing an explicit SRTP path to an installed copy.

Could this be this option ?

--with-srtp=PATH        use Secure RTP files in PATH

Let’s say that I would use the srtp package from my distribution, does the configure script will detect it automatically ?

Yes, the configure script will detect it automatically in that case. That option is likely it, but as I said I’ve never used it personally.

Ok, thanks a lot for you help, especially that fast.

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