[Asterisk-code-review] pjsip: replace 180 by 183 if SDP negotiation has completed (...asterisk[16])

Alexei Gradinari asteriskteam at digium.com
Mon May 13 16:09:42 CDT 2019


Alexei Gradinari has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11379


Change subject: pjsip: replace 180 by 183 if SDP negotiation has completed
......................................................................

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
---
M channels/chan_pjsip.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/11379/1

diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 9c27f33..8508631 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -1592,7 +1592,9 @@
 	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 {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11379
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73
Gerrit-Change-Number: 11379
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190513/ceb6b842/attachment.html>


More information about the asterisk-code-review mailing list