diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2011-05-20 10:29:45 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2011-05-20 10:29:45 +0000 |
commit | 6d9136ebc170264062f57ff5eb064e2e775be7b8 (patch) | |
tree | 52ec99934871b2da27a3e5e9c55dab22d8d236a1 /pjsip | |
parent | b3b5ef9fdc2de0cd513f5b9da218a0b6bba469da (diff) |
Fixed #1291:
- fixed bug in SIP invite module, SDP negotiator state should be reverted back after an SDP re-offer is rejected by application.
- fixed bug in pjsua_call_on_rx_offer(), evaluating call->audio_index should be done after pjsua_media_channel_create_sdp() is successful.
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3574 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_inv.c | 10 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 12 |
2 files changed, 16 insertions, 6 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 4d1723c1..377dc147 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -4013,6 +4013,16 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) /* Not Acceptable */ const pjsip_hdr *accept; + /* The incoming SDP is unacceptable. If the SDP negotiator + * state has just been changed, i.e: DONE -> REMOTE_OFFER, + * revert it back. + */ + if (pjmedia_sdp_neg_get_state(inv->neg) == + PJMEDIA_SDP_NEG_STATE_REMOTE_OFFER) + { + pjmedia_sdp_neg_cancel_offer(inv->neg); + } + status = pjsip_dlg_create_response(inv->dlg, rdata, 488, NULL, &tdata); if (status != PJ_SUCCESS) diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index b58fd758..646f60a1 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -3778,12 +3778,6 @@ static void pjsua_call_on_rx_offer(pjsip_inv_session *inv, call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; - if (call->audio_idx < (int)offer->media_count) - conn = offer->media[call->audio_idx]->conn; - - if (!conn) - conn = offer->conn; - /* Supply candidate answer */ PJ_LOG(4,(THIS_FILE, "Call %d: received updated media offer", call->index)); @@ -3797,6 +3791,12 @@ static void pjsua_call_on_rx_offer(pjsip_inv_session *inv, return; } + if (call->audio_idx >= 0 && call->audio_idx < (int)offer->media_count) + conn = offer->media[call->audio_idx]->conn; + + if (!conn) + conn = offer->conn; + /* Check if offer's conn address is zero */ if (pj_strcmp2(&conn->addr, "0.0.0.0")==0 || pj_strcmp2(&conn->addr, "0")==0) |