- Timestamp:
- Feb 19, 2014 4:11:43 AM (11 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r4592 r4750 636 636 pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); 637 637 638 /* 639 * Error message when media operation is requested while another is in progress 640 */ 641 #define ERR_MEDIA_CHANGING " because another media operation is in progress" 642 643 pj_bool_t pjsua_call_media_is_changing(pjsua_call *call); 638 644 pj_status_t pjsua_call_media_init(pjsua_call_media *call_med, 639 645 pjmedia_type type, -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4728 r4750 34 34 */ 35 35 #define LOCK_CODEC_MAX_RETRY 5 36 37 36 38 37 /* … … 2393 2392 goto on_return; 2394 2393 2394 if (pjsua_call_media_is_changing(call)) { 2395 PJ_LOG(1,(THIS_FILE, "Unable to reinvite" ERR_MEDIA_CHANGING)); 2396 status = PJ_EINVALIDOP; 2397 goto on_return; 2398 } 2399 2395 2400 if (call->inv->state != PJSIP_INV_STATE_CONFIRMED) { 2396 2401 PJ_LOG(3,(THIS_FILE, "Can not re-INVITE call that is not confirmed")); … … 2499 2504 if (status != PJ_SUCCESS) 2500 2505 goto on_return; 2506 2507 if (pjsua_call_media_is_changing(call)) { 2508 PJ_LOG(1,(THIS_FILE, "Unable to send UPDATE" ERR_MEDIA_CHANGING)); 2509 status = PJ_EINVALIDOP; 2510 goto on_return; 2511 } 2501 2512 2502 2513 status = apply_call_setting(call, opt, NULL); … … 3879 3890 PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", 3880 3891 call->index)); 3892 3881 3893 pj_log_push_indent(); 3894 3895 if (pjsua_call_media_is_changing(call)) { 3896 PJ_LOG(1,(THIS_FILE, "Unable to process offer" ERR_MEDIA_CHANGING)); 3897 goto on_return; 3898 } 3882 3899 3883 3900 if (pjsua_var.ua_cfg.cb.on_call_rx_offer) { … … 3970 3987 3971 3988 call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 3989 if (pjsua_call_media_is_changing(call)) { 3990 *offer = NULL; 3991 PJ_LOG(1,(THIS_FILE, "Unable to create offer" ERR_MEDIA_CHANGING)); 3992 goto on_return; 3993 } 3972 3994 3973 3995 /* See if we've put call on hold. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r4749 r4750 1303 1303 1304 1304 return status; 1305 } 1306 1307 /* Determine if call's media is being changed, for example when video is being 1308 * added. Then we can reject incoming re-INVITE, for example. This is the 1309 * solution for https://trac.pjsip.org/repos/ticket/1738 1310 */ 1311 pj_bool_t pjsua_call_media_is_changing(pjsua_call *call) 1312 { 1313 /* The problem in #1738 occurs because we do handle_events() loop while 1314 * adding media, which could cause incoming re-INVITE to be processed and 1315 * cause havoc. Since the handle_events() loop only happens while adding 1316 * media, it is sufficient to only check if "prov > cnt" for now. 1317 */ 1318 return call->med_prov_cnt > call->med_cnt; 1305 1319 } 1306 1320 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r4560 r4750 1536 1536 return PJ_ETOOMANY; 1537 1537 1538 if (pjsua_call_media_is_changing(call)) { 1539 PJ_LOG(1,(THIS_FILE, "Unable to add video" ERR_MEDIA_CHANGING)); 1540 return PJ_EINVALIDOP; 1541 } 1542 1538 1543 /* Get active local SDP and clone it */ 1539 1544 status = pjmedia_sdp_neg_get_active_local(call->inv->neg, ¤t_sdp); … … 1636 1641 pjmedia_sdp_session *sdp; 1637 1642 pj_status_t status; 1643 1644 if (pjsua_call_media_is_changing(call)) { 1645 PJ_LOG(1,(THIS_FILE, "Unable to modify video" ERR_MEDIA_CHANGING)); 1646 return PJ_EINVALIDOP; 1647 } 1638 1648 1639 1649 /* Verify and normalize media index */
Note: See TracChangeset
for help on using the changeset viewer.