diff options
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_call.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 733bc599..db8bfa11 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -34,7 +34,6 @@ */ #define LOCK_CODEC_MAX_RETRY 5 - /* * The INFO method. */ @@ -2392,6 +2391,12 @@ PJ_DEF(pj_status_t) pjsua_call_reinvite2(pjsua_call_id call_id, if (status != PJ_SUCCESS) goto on_return; + if (pjsua_call_media_is_changing(call)) { + PJ_LOG(1,(THIS_FILE, "Unable to reinvite" ERR_MEDIA_CHANGING)); + status = PJ_EINVALIDOP; + goto on_return; + } + if (call->inv->state != PJSIP_INV_STATE_CONFIRMED) { PJ_LOG(3,(THIS_FILE, "Can not re-INVITE call that is not confirmed")); status = PJSIP_ESESSIONSTATE; @@ -2499,6 +2504,12 @@ PJ_DEF(pj_status_t) pjsua_call_update2(pjsua_call_id call_id, if (status != PJ_SUCCESS) goto on_return; + if (pjsua_call_media_is_changing(call)) { + PJ_LOG(1,(THIS_FILE, "Unable to send UPDATE" ERR_MEDIA_CHANGING)); + status = PJ_EINVALIDOP; + goto on_return; + } + status = apply_call_setting(call, opt, NULL); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Failed to apply call setting", status); @@ -3878,8 +3889,14 @@ static void pjsua_call_on_rx_offer(pjsip_inv_session *inv, /* Supply candidate answer */ PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", call->index)); + pj_log_push_indent(); + if (pjsua_call_media_is_changing(call)) { + PJ_LOG(1,(THIS_FILE, "Unable to process offer" ERR_MEDIA_CHANGING)); + goto on_return; + } + if (pjsua_var.ua_cfg.cb.on_call_rx_offer) { pjsip_status_code code = PJSIP_SC_OK; pjsua_call_setting opt = call->opt; @@ -3969,6 +3986,11 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv, pj_log_push_indent(); call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; + if (pjsua_call_media_is_changing(call)) { + *offer = NULL; + PJ_LOG(1,(THIS_FILE, "Unable to create offer" ERR_MEDIA_CHANGING)); + goto on_return; + } /* See if we've put call on hold. */ if (call->local_hold) { |