[Asterisk-code-review] res pjsip session: Reinvite using active stream topology if ... (asterisk[master])
Jenkins2
asteriskteam at digium.com
Thu Dec 14 15:22:21 CST 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7548 )
Change subject: res_pjsip_session: Reinvite using active stream topology if none requested.
......................................................................
res_pjsip_session: Reinvite using active stream topology if none requested.
When a connected line update is sent to an endpoint we do not request
a specific stream topology to be used. Previously this resulted in the
configured stream topology being used which may actually differ from the
currently negotiated topology. PJSIP is helpful in this regard in that
it will fill in any missing streams with removed ones. This results in
our own state not matching the SDP, though, and we do not apply the
negotiated SDP.
This change tweaks the code to use the actively negotiated stream
topology if it is present with a fallback to the configured one. This
results in the SDP and the state having matching information and the
world is happy.
ASTERISK*27397
Change-Id: I7a57117f0183479e6884b7bf3a53bb8c7464f604
---
M res/res_pjsip_session.c
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 781d3e4..b0f6197 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3872,10 +3872,15 @@
if (!session->pending_media_state->topology || !ast_stream_topology_get_count(session->pending_media_state->topology)) {
/* We've encountered a situation where we have been told to create a local SDP but noone has given us any indication
- * of what kind of stream topology they would like. As a fallback we use the topology from the configured endpoint.
+ * of what kind of stream topology they would like. We try to not alter the current state of the SDP negotiation
+ * by using what is currently negotiated. If this is unavailable we fall back to what is configured on the endpoint.
*/
ast_stream_topology_free(session->pending_media_state->topology);
- session->pending_media_state->topology = ast_stream_topology_clone(session->endpoint->media.topology);
+ if (session->active_media_state->topology) {
+ session->pending_media_state->topology = ast_stream_topology_clone(session->active_media_state->topology);
+ } else {
+ session->pending_media_state->topology = ast_stream_topology_clone(session->endpoint->media.topology);
+ }
if (!session->pending_media_state->topology) {
return NULL;
}
--
To view, visit https://gerrit.asterisk.org/7548
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a57117f0183479e6884b7bf3a53bb8c7464f604
Gerrit-Change-Number: 7548
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171214/37806628/attachment.html>
More information about the asterisk-code-review
mailing list