Changeset 5417 for pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
- Timestamp:
- Aug 12, 2016 3:47:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5297 r5417 1267 1267 } 1268 1268 1269 void Endpoint::on_create_media_transport_srtp(pjsua_call_id call_id, 1270 unsigned media_idx, 1271 pjmedia_srtp_setting *srtp_opt) 1272 { 1273 Call *call = Call::lookup(call_id); 1274 if (!call) { 1275 pjsua_call *in_call = &pjsua_var.calls[call_id]; 1276 if (in_call->incoming_data) { 1277 /* This can happen when there is an incoming call but the 1278 * on_incoming_call() callback hasn't been called. So we need to 1279 * call the callback here. 1280 */ 1281 on_incoming_call(in_call->acc_id, call_id, in_call->incoming_data); 1282 1283 /* New call should already be created by app. */ 1284 call = Call::lookup(call_id); 1285 if (!call) { 1286 return; 1287 } 1288 } else { 1289 return; 1290 } 1291 } 1292 1293 OnCreateMediaTransportSrtpParam prm; 1294 prm.mediaIdx = media_idx; 1295 prm.srtpUse = srtp_opt->use; 1296 for (int i = 0; i < srtp_opt->crypto_count; i++) { 1297 SrtpCrypto crypto; 1298 1299 crypto.key = pj2Str(srtp_opt->crypto[i].key); 1300 crypto.name = pj2Str(srtp_opt->crypto[i].name); 1301 crypto.flags = srtp_opt->crypto[i].flags; 1302 prm.cryptos.push_back(crypto); 1303 } 1304 1305 call->onCreateMediaTransportSrtp(prm); 1306 1307 srtp_opt->use = prm.srtpUse; 1308 srtp_opt->crypto_count = prm.cryptos.size(); 1309 for (int i = 0; i < srtp_opt->crypto_count; i++) { 1310 srtp_opt->crypto[i].key = str2Pj(prm.cryptos[i].key); 1311 srtp_opt->crypto[i].name = str2Pj(prm.cryptos[i].name); 1312 srtp_opt->crypto[i].flags = prm.cryptos[i].flags; 1313 } 1314 } 1315 1269 1316 /////////////////////////////////////////////////////////////////////////////// 1270 1317 /*
Note: See TracChangeset
for help on using the changeset viewer.