[Asterisk-code-review] chan_pjsip: (asterisk[18])

Henning Westerholt asteriskteam at digium.com
Mon Mar 20 12:35:40 CDT 2023


Henning Westerholt has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19979 )


Change subject: chan_pjsip:
......................................................................

chan_pjsip:

Bugfix for feature introduced in ASTERISK-30193
We should also return all codecs on an re-INVITE without SDP
for a call that used late offer (e.g. no SDP in the initial INVITE,
SDP in the ACK).

ASTERISK-30473

Change-Id: I0c132202eef4f6746212559d0e936951e17adc6c
---
M res/res_pjsip_session.c
1 file changed, 21 insertions(+), 3 deletions(-)



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

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index ae2e0e4..63177e1 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -5348,14 +5348,16 @@
 	/* Some devices send a re-INVITE offer with empty SDP. Asterisk by default return
 	 * an answer with the current used codecs, which is not strictly compliant to RFC
 	 * 3261 (SHOULD requirement). So we detect this condition and include all
-	 * configured codecs in the answer if the workaround is activated.
+	 * configured codecs in the answer if the workaround is activated. The actual
+	 * logic is in the create_local_sdp function. We can't detect here that we have
+	 * no SDP body in the INVITE, as we don't have access to the message.
 	 */
 	if (inv->invite_tsx && inv->state == PJSIP_INV_STATE_CONFIRMED
 			&& inv->invite_tsx->method.id == PJSIP_INVITE_METHOD) {
 		ast_trace(-1, "re-INVITE\n");
-		if (inv->invite_tsx->role == PJSIP_ROLE_UAS && !pjmedia_sdp_neg_was_answer_remote(inv->neg)
+		if (inv->invite_tsx->role == PJSIP_ROLE_UAS
 				&& ast_sip_get_all_codecs_on_empty_reinvite()) {
-			ast_trace(-1, "no codecs in re-INIVTE, include all codecs in the answer\n");
+			ast_trace(-1, "UAS role, include all codecs in the answer on empty SDP\n");
 			ignore_active_stream_topology = 1;
 		}
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I0c132202eef4f6746212559d0e936951e17adc6c
Gerrit-Change-Number: 19979
Gerrit-PatchSet: 1
Gerrit-Owner: Henning Westerholt <hw at gilawa.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230320/bd18c958/attachment.html>


More information about the asterisk-code-review mailing list