From fe5a694cc66da35ea9f580435eefcb0a42e1c55d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 18 Feb 2008 12:16:23 +0000 Subject: [PATCH] Fixed build error if SRTP is disabled in compile time (thanks Helmut Wolf) git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1802 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/pjsua_app.c | 3 ++- pjsip-apps/src/samples/pcaputil.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index f9dd1a310..39560f11e 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -1324,6 +1324,7 @@ static int write_settings(const struct app_config *config, pj_strcat2(&cfg, "\n#\n# Media settings:\n#\n"); /* SRTP */ +#if PJMEDIA_HAS_SRTP if (app_config.cfg.use_srtp != PJSUA_DEFAULT_USE_SRTP) { pj_ansi_sprintf(line, "--use-srtp %d\n", app_config.cfg.use_srtp); @@ -1336,7 +1337,7 @@ static int write_settings(const struct app_config *config, app_config.cfg.srtp_secure_signaling); pj_strcat2(&cfg, line); } - +#endif /* Media */ if (config->media_cfg.enable_ice) diff --git a/pjsip-apps/src/samples/pcaputil.c b/pjsip-apps/src/samples/pcaputil.c index e5954105b..9ea77a02e 100644 --- a/pjsip-apps/src/samples/pcaputil.c +++ b/pjsip-apps/src/samples/pcaputil.c @@ -154,6 +154,7 @@ static void read_rtp(pj_uint8_t *buf, pj_size_t bufsize, } /* Decrypt SRTP */ +#if PJMEDIA_HAS_SRTP if (app.srtp) { int len = sz; status = pjmedia_transport_srtp_decrypt_pkt(app.srtp, PJ_TRUE, @@ -177,6 +178,7 @@ static void read_rtp(pj_uint8_t *buf, pj_size_t bufsize, continue; } } +#endif /* Update RTP session */ pjmedia_rtp_session_update(&app.rtp_sess, r, &seq_st); @@ -246,6 +248,7 @@ static void pcap2wav(const char *wav_filename, const pj_str_t *srtp_crypto, #endif /* PJMEDIA_HAS_L16_CODEC */ /* Create SRTP transport is needed */ +#if PJMEDIA_HAS_SRTP if (srtp_crypto->slen) { pjmedia_srtp_crypto crypto; @@ -255,6 +258,10 @@ static void pcap2wav(const char *wav_filename, const pj_str_t *srtp_crypto, T( pjmedia_transport_srtp_create(app.mept, NULL, NULL, &app.srtp) ); T( pjmedia_transport_srtp_start(app.srtp, &crypto, &crypto) ); } +#else + PJ_UNUSED_ARG(srtp_crypto); + PJ_UNUSED_ARG(srtp_key); +#endif /* Read first packet */ read_rtp(pkt0.buffer, sizeof(pkt0.buffer), &pkt0.rtp,