From 7632d1186a9ec6b4d1693b6e1398c802cdc30415 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 11 Mar 2014 07:45:29 +0000 Subject: Fix #1747: Don't process message body in the incoming 200/UPDATE if we don't send offer in the UPDATE. Note this also fixes another issue: session timer should always inspect 200/UPDATE response (for session refresh) regardless availability of message body. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4791 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_inv.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 4b361e3c..52cab52c 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -3340,13 +3340,23 @@ static pj_bool_t inv_handle_update_response( pjsip_inv_session *inv, /* Process 2xx response */ else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && - tsx->status_code/100 == 2 && - e->body.tsx_state.src.rdata->msg_info.msg->body) + tsx->status_code/100 == 2) { - status = handle_timer_response(inv, e->body.tsx_state.src.rdata, - PJ_FALSE); - status = inv_check_sdp_in_incoming_msg(inv, tsx, - e->body.tsx_state.src.rdata); + pjsip_rx_data *rdata = e->body.tsx_state.src.rdata; + status = handle_timer_response(inv, rdata, PJ_FALSE); + + if (rdata->msg_info.msg->body) { + /* Only process remote SDP if we have sent local offer */ + if (inv->neg && pjmedia_sdp_neg_get_state(inv->neg) == + PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) + { + status = inv_check_sdp_in_incoming_msg(inv, tsx, rdata); + } else { + PJ_LOG(5,(THIS_FILE, "Ignored message body in %s as no local " + "offer was sent", + pjsip_rx_data_get_info(rdata))); + } + } handled = PJ_TRUE; } -- cgit v1.2.3