Description: This patch ensures that Asterisk does not increment the session version in SDP of "200 OK" (in response to the initial INVITE) if a "183 Session in Progress" has already been sent with SDP in response to the INVITE. Author: Nitesh Bansal --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7266,15 +7266,21 @@ { int res = 0; struct sip_pvt *p = ast_channel_tech_pvt(ast); + int oldsdp = FALSE; sip_pvt_lock(p); if (ast_channel_state(ast) != AST_STATE_UP) { try_suggested_sip_codec(p); + if (ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT)) + { + oldsdp = TRUE; + } + ast_setstate(ast, AST_STATE_UP); ast_debug(1, "SIP answering channel: %s\n", ast_channel_name(ast)); ast_rtp_instance_update_source(p->rtp); - res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, FALSE, TRUE); + res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, oldsdp, TRUE); ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED); } sip_pvt_unlock(p);