[Asterisk-code-review] res_pjsip_session.c: Check topology on re-invite. (asterisk[certified/16.8])

Benjamin Keith Ford asteriskteam at digium.com
Mon Feb 15 12:27:46 CST 2021


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15429 )


Change subject: res_pjsip_session.c: Check topology on re-invite.
......................................................................

res_pjsip_session.c: Check topology on re-invite.

Adds additional logic to see if there is an active_media_state on the
session so that the topologies can be compared to see if they are equal,
suppressing the re-invite. When a call is received that offers codecs
different than what the phones supports, a re-invite will be sent with
all the phone's supported codecs if the call is put on hold by that
phone.

Change-Id: I04dc91befb2387904e28a9aaeaa3bcdbcaa7fa63
---
M res/res_pjsip_session.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/29/15429/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index dfbc9a6..1f2eba2 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2439,7 +2439,7 @@
 				 * change.  If it was the result of some other change, like connected line, then
 				 * we don't want to suppress it even though the topologies are equal.
 				 */
-				if (topology_change_request && ast_stream_topology_equal(session->active_media_state->topology, pending_media_state->topology)) {
+				if ((topology_change_request || session->active_media_state) && ast_stream_topology_equal(session->active_media_state->topology, pending_media_state->topology)) {
 					ast_trace(-1, "%s: CA: %s\n", ast_sip_session_get_name(session), ast_str_tmp(256, ast_stream_topology_to_str(session->active_media_state->topology, &STR_TMP)));
 					ast_trace(-1, "%s: NP: %s\n", ast_sip_session_get_name(session), ast_str_tmp(256, ast_stream_topology_to_str(pending_media_state->topology, &STR_TMP)));
 					ast_sip_session_media_state_free(pending_media_state);

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

Gerrit-Project: asterisk
Gerrit-Branch: certified/16.8
Gerrit-Change-Id: I04dc91befb2387904e28a9aaeaa3bcdbcaa7fa63
Gerrit-Change-Number: 15429
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210215/8cc8888c/attachment.html>


More information about the asterisk-code-review mailing list