Asterisk 20.1.0 on Alma 9 - res_srtp.so issue

Greetings all, I am attempting to run the latest version of Asterisk (20.1.0) on Alma Linux 9, but am running into an issue, not during installation, but when Asterisk is started. It doesn’t entered a crashed state though, when checking the service status, it is still running. The log /var/log/asterisk/messages.log gets continuously spammed with:

WARNING[62394] res_srtp.c: Failed to initialize libsrtp
ERROR[62394] loader.c: *** Failed to load module res_srtp.so
ERROR[62394] asterisk.c: Module initialization failed. ASTERISK EXITING!!

If I disable the module, or uninstall libsrtp-devel / libsrtp packages before compiling, asterisk runs just fine. If anyone has any suggestions, it would be greatly appreciated. If any further info is needed, will be happy to provide.

The code in question is simple and this:

        if (srtp_init() != err_status_ok) {
                ast_log(AST_LOG_WARNING, "Failed to initialize libsrtp\n");
                return -1;
        }

Call the function libsrtp provides to initialize it, which fails. I would say the issue is with libsrtp itself somehow - what that may be, I don’t know.

Don’t know about 20, but 18 is not compatible with srtp from 9.
I installed libsrtp-1.5.4-8.el8.x86_64.rpm and the same devel

May be this will help…

https://github.com/cisco/libsrtp
git@github.com:cisco/libsrtp.git
make uninstall
make clean
./configure CFLAGS=-fPIC --prefix=/usr/local/lib
make
make runtest
make install

./configure --with-jansson-bundled --with-srtp=/usr/local/lib

Thank you for the suggestion @Vinayak, I did get things working late last night by a very similar method of downloading and installing libsrtp from source:

cd /usr/src
git clone https://github.com/cisco/libsrtp.git
cd libsrtp/
./configure --enable-openssl -–libdir=/usr/lib64
make shared_library
make install
ldconfig

Then compiling asterisk with:
./configure --libdir=/usr/lib64 --with-jansson-bundled=yes