meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.23k stars 2.48k forks source link

Error compiling against master libsrtp #709

Closed zdila closed 7 years ago

zdila commented 7 years ago

We are using Debian testing and so we had to clone and compile master of libsrtp because referenced tarball versions of libsrtp don't compile when using --enable-openssl.

Unfortunately janus-gateway doesn't compile afterwards:

make  all-recursive
make[1]: Entering directory '/home/martin/janus-gateway'
Making all in html
make[2]: Entering directory '/home/martin/janus-gateway/html'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/martin/janus-gateway/html'
make[2]: Entering directory '/home/martin/janus-gateway'
  CC       plugins/plugins_libjanus_sip_la-janus_sip.lo
plugins/janus_sip.c:66:23: fatal error: srtp/srtp.h: No such file or directory
 #include <srtp/srtp.h>
                       ^
compilation terminated.
Makefile:1433: recipe for target 'plugins/plugins_libjanus_sip_la-janus_sip.lo' failed
make[2]: *** [plugins/plugins_libjanus_sip_la-janus_sip.lo] Error 1
make[2]: Leaving directory '/home/martin/janus-gateway'
Makefile:2018: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/martin/janus-gateway'
Makefile:1001: recipe for target 'all' failed
make: *** [all] Error 2

libsrtp headers are in /usr/include/srtp2:

auth.h  cipher.h  crypto_types.h  ekt.h  rtp.h  srtp.h
lminiero commented 7 years ago

Mh, I guess that when we added support for libsrtp2 last week we only applied this to the core, and not to the SIP plugin which also uses it and is still assuming libsrtp 1.5.x. I'll do the required changes there as well.

lminiero commented 7 years ago

This is going to take a bit longer than expected, as crypto_get_random is not available anymore in libsrtp2... I'll have to find an alternative that works on all the systems we support. Maybe OpenSSL has something like that built in?

lminiero commented 7 years ago

This commit fixes it for me. Let me know if that's not the case.

zdila commented 7 years ago

Better, but now there is problem with linking:

...
  CC       janus-turnrest.o
  CC       janus-utils.o
  CC       plugins/janus-plugin.o
  CCLD     janus
/usr/bin/ld: cannot find -lsrtp
collect2: error: ld returned 1 exit status
Makefile:1294: recipe for target 'janus' failed
make[2]: *** [janus] Error 1
make[2]: Leaving directory '/home/martin/janus-gateway'
Makefile:2018: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/martin/janus-gateway'
Makefile:1001: recipe for target 'all' failed
make: *** [all] Error 2
lminiero commented 7 years ago

Good catch... that's a leftover from before the libsrtp/libsrtp2 support. It doesn't fail for me as I have both installed and so never encountered it, will fix right away.

lminiero commented 7 years ago

Does this help?

zdila commented 7 years ago

Yes. Compiled, started and videoroom test works. Thanks!

lminiero commented 7 years ago

Cool!