diff options
author | Liong Sauw Ming <ming@teluu.com> | 2015-05-15 06:20:02 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2015-05-15 06:20:02 +0000 |
commit | 00a113817f2481e3afcec96c946f3ae89243e6f5 (patch) | |
tree | 9d1a58c76ab1a85affa384dd414fc3a0b549351b /pjsip | |
parent | 106fbfcdcfe9978cacc1d466bf49f0ab223cb10e (diff) |
Fixed #1848: SDP failed to be created when provisional media has been cleared
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5094 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 7a82e3e1..537d3980 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -2413,6 +2413,13 @@ PJ_DEF(pj_status_t) pjsua_call_set_hold2(pjsua_call_id call_id, goto on_return; } + /* We may need to re-initialize media before creating SDP */ + if (call->med_prov_cnt == 0) { + status = apply_call_setting(call, &call->opt, NULL); + if (status != PJ_SUCCESS) + goto on_return; + } + status = create_sdp_of_call_hold(call, &sdp); if (status != PJ_SUCCESS) goto on_return; @@ -4156,6 +4163,13 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv, } #endif + /* We may need to re-initialize media before creating SDP */ + if (call->med_prov_cnt == 0) { + status = apply_call_setting(call, &call->opt, NULL); + if (status != PJ_SUCCESS) + goto on_return; + } + /* See if we've put call on hold. */ if (call->local_hold) { PJ_LOG(4,(THIS_FILE, @@ -4166,16 +4180,6 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv, PJ_LOG(4,(THIS_FILE, "Call %d: asked to send a new offer", call->index)); - if (call->med_prov_cnt == 0) { - status = pjsua_media_channel_init(call->index, inv->role, - call->secure_level, inv->pool_prov, - NULL, NULL, PJ_FALSE, NULL); - if (status != PJ_SUCCESS) { - pjsua_perror(THIS_FILE, "Unable to create offer", status); - goto on_return; - } - } - status = pjsua_media_channel_create_sdp(call->index, call->inv->pool_prov, NULL, offer, NULL); |