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
This commit is contained in:
Benny Prijono 2008-02-18 12:16:23 +00:00
parent a1179ca4b6
commit fe5a694cc6
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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,