You try to establsish a call but it got disconnected and there is following message in Asterisk console from PJSIP Couldn’t add sdp streams for stream:
1 |
res_pjsip_session.c:5160 create_local_sdp: PJSIP/teams_out-0000000b: Couldn't add sdp streams for stream 0:audio-0:audio:sendrecv (ulaw|alaw|gsm) |
Two most common cases can cause this:
- You specified encryption for one of the endpoints while the endpoint does not support it, or there are no common codecs.
- You see the addititonal error messages in debug output of the Asterisk’s console right before the abovementioned “No SRTP module loaded, can’t setup SRTP session” “Couldn’t add crypto” “Coudn’t create sdp stream“:
1 2 3 4 5 |
[Mar 18 08:58:05] DEBUG[204553]: sdp_srtp.c:44 ast_sdp_srtp_alloc: No SRTP module loaded, can't setup SRTP session. [Mar 18 08:58:05] DEBUG[204553]: res_pjsip_sdp_rtp.c:1820 create_outgoing_sdp_stream: Couldn't add crypto [Mar 18 08:58:05] DEBUG[204553]: res_pjsip_session.c:5001 add_sdp_streams: Coudn't create sdp stream [Mar 18 08:58:05] ERROR[204553]: res_pjsip_session.c:5160 create_local_sdp: PJSIP/teams_out-00000009: Couldn't add sdp streams for stream 0:audio-0:audio:sendrecv (ulaw|alaw|gsm) [Mar 18 08:58:05] DEBUG[204553]: res_pjsip_session.c:5160 create_local_sdp: PJSIP/teams_out-00000009: Couldn't add sdp streams for stream 0:audio-0:audio:sendrecv (ulaw|alaw|gsm) |
In this case res_srtp.so module is not loaded or missing.
Try to load it first in Asterisk console:
1 |
module load res_srtp.so |
In case you see “Cannot open shared object: no such file or directory” you need to compile and install it.
Make sure you have dependencies installed.
In CentOS 8 install them
1 |
dnf install libsrtp-devel |
Then go to directory with Asterisk sources codes and issue ./configure
command. After it completes generate menu with make menuselect
command and choose res_srtp
:
Then press Tab -> Save&Exit -> Enter.
Do make && make install
Now restart Asterisk and try to call again.
Good luck!