- Timestamp:
- Jun 24, 2010 8:46:12 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r3219 r3221 313 313 } 314 314 315 315 316 static int get_crypto_idx(const pj_str_t* crypto_name) 316 317 { … … 329 330 return -1; 330 331 } 332 333 334 static int srtp_crypto_cmp(const pjmedia_srtp_crypto* c1, 335 const pjmedia_srtp_crypto* c2) 336 { 337 int r; 338 339 r = pj_strcmp(&c1->key, &c2->key); 340 if (r != 0) 341 return r; 342 343 r = pj_stricmp(&c1->name, &c2->name); 344 if (r != 0) 345 return r; 346 347 return (c1->flags != c2->flags); 348 } 349 331 350 332 351 PJ_DEF(void) pjmedia_srtp_setting_default(pjmedia_srtp_setting *opt) … … 1491 1510 1492 1511 /* Got policy_local & policy_remote, let's initalize the SRTP */ 1493 status = pjmedia_transport_srtp_start(tp, &srtp->tx_policy_neg, &srtp->rx_policy_neg); 1494 if (status != PJ_SUCCESS) 1495 return status; 1512 1513 /* Ticket #1075: media_start() is called whenever media description 1514 * gets updated, e.g: call hold, however we should restart SRTP only 1515 * when the SRTP policy settings are updated. 1516 */ 1517 if (srtp_crypto_cmp(&srtp->tx_policy_neg, &srtp->tx_policy) || 1518 srtp_crypto_cmp(&srtp->rx_policy_neg, &srtp->rx_policy)) 1519 { 1520 status = pjmedia_transport_srtp_start(tp, 1521 &srtp->tx_policy_neg, 1522 &srtp->rx_policy_neg); 1523 if (status != PJ_SUCCESS) 1524 return status; 1525 } 1496 1526 1497 1527 goto PROPAGATE_MEDIA_START;
Note: See TracChangeset
for help on using the changeset viewer.