From: Alexei Gradinari Date: Mon, 13 May 2019 20:37:50 +0000 (-0400) Subject: pjsip: replace 180 by 183 if SDP negotiation has completed X-Git-Tag: 13.28.0-rc1~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=595d60846aed4517dfdbebce8284954e7293add4;p=thirdparty%2Fasterisk.git pjsip: replace 180 by 183 if SDP negotiation has completed The caller endpoint hears dead silence if a callee replies 180 (without SDP) and the caller already received 183 (with SDP). It happens because Asterisk sends 180 (WITH SDP) to the caller, there are not incoming RTP packets from the callee and Asterisk does not generate inband ringing, so there are not any outgoing RTP packets to the caller. This patch replaces 180 by 183 if SDP negotiation has completed, as if the caller endpoint is configured with "inband_progress=yes". In this case Asterisk will generate inband ringing untill Asterisk receive incoming RTP packets from the callee. ASTERISK-27994 #close Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73 --- diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index 6d027b32f0..0d565dfe7a 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -1363,7 +1363,9 @@ static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const voi switch (condition) { case AST_CONTROL_RINGING: if (ast_channel_state(ast) == AST_STATE_RING) { - if (channel->session->endpoint->inband_progress) { + if (channel->session->endpoint->inband_progress || + (channel->session->inv_session && channel->session->inv_session->neg && + pjmedia_sdp_neg_get_state(channel->session->inv_session->neg) == PJMEDIA_SDP_NEG_STATE_DONE)) { response_code = 183; res = -1; } else {