diff options
author | Benny Prijono <bennylp@teluu.com> | 2014-02-19 04:11:43 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2014-02-19 04:11:43 +0000 |
commit | 7c7dd8a6151a607ac7fda3da0a657fddd07be8d1 (patch) | |
tree | 96398ce995f9af19d04c35c6f85cf3efaf8d1b19 /pjsip/src/pjsua-lib/pjsua_call.c | |
parent | f9317b810877c3cab6bda8ea07dc94eb3ecb7c20 (diff) |
Fixed #1738: Infinite loop when re-INVITE is received while adding new media
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4750 74dad513-b988-da41-8d7b-12977e46ad98
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) { |