[Asterisk-code-review] res_pjsip_session: Flip stream direction of outgoing stream. (asterisk[16])

Maximilian Fridrich asteriskteam at digium.com
Wed Apr 13 08:26:30 CDT 2022


Maximilian Fridrich has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18371 )


Change subject: res_pjsip_session: Flip stream direction of outgoing stream.
......................................................................

res_pjsip_session: Flip stream direction of outgoing stream.

When an outgoing ast_sip_session is created, the topology of the
incoming request is being cloned and used for the outgoing stream. This
creates issues when a one-way (video) stream is requested as the
stream state of the second call leg will be the same as the stream
state of the first call leg.

Now the stream state is flipped for the outgoing stream if the
requested topology is recvonly or sendonly which fixes one-way video.

ASTERISK-29655
Reported by: Michael Auracher

ASTERISK-29638
Reported by: Michael Auracher

Change-Id: I294dc834ac9a5f048b101b691669959e9df630e1
---
M res/res_pjsip_session.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/18371/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 3c55af7..e1ec085 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3422,6 +3422,12 @@
 				}
 			}
 
+			if (ast_stream_get_state(req_stream) == AST_STREAM_STATE_SENDONLY) {
+				ast_stream_set_state(clone_stream, AST_STREAM_STATE_RECVONLY);
+			} else if (ast_stream_get_state(req_stream) == AST_STREAM_STATE_RECVONLY) {
+				ast_stream_set_state(clone_stream, AST_STREAM_STATE_SENDONLY);
+			}
+
 			if (ast_stream_topology_append_stream(session->pending_media_state->topology, clone_stream) < 0) {
 				ast_stream_free(clone_stream);
 				continue;

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I294dc834ac9a5f048b101b691669959e9df630e1
Gerrit-Change-Number: 18371
Gerrit-PatchSet: 1
Gerrit-Owner: Maximilian Fridrich <m.fridrich at commend.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220413/a9d4d585/attachment.html>


More information about the asterisk-code-review mailing list