Skip to content

Commit

Permalink
MT#60476 sdp_create: properly detect session_last_sdp_orig
Browse files Browse the repository at this point in the history
For the sdp_create approach, currently given monologue
is actually the holder of `session_last_sdp_orig` for
currently processed direction of SDP preparation.
So this -> other, whereas other keeps the required last orig.

Change-Id: Id1bdb80ecc0401be5fd430cd4369b8588de4379b
  • Loading branch information
zenichev committed Sep 30, 2024
1 parent a14cf18 commit 508ce68
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions daemon/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3540,14 +3540,16 @@ static void sdp_out_add_origin(GString *out, struct call_monologue *monologue,
if (ms && ms->monologue)
ml = ms->monologue;

/* orig username */
str * orig_username = (ml->session_last_sdp_orig &&
/* orig username
* session_last_sdp_orig is stored on the other media always,
* so if origin is meant for the A media, then it is stored on the B one */
str * orig_username = (monologue->session_last_sdp_orig &&
(flags->replace_username || flags->replace_origin_full)) ?
&ml->session_last_sdp_orig->username : &ml->session_sdp_orig->username;
&monologue->session_last_sdp_orig->username : &ml->session_sdp_orig->username;

/* orig session id */
str * orig_session_id = (ml->session_last_sdp_orig && flags->replace_origin_full) ?
&ml->session_last_sdp_orig->session_id : &ml->session_sdp_orig->session_id;
str * orig_session_id = (monologue->session_last_sdp_orig && flags->replace_origin_full) ?
&monologue->session_last_sdp_orig->session_id : &ml->session_sdp_orig->session_id;

/* orig session ver
* replacement is handled later in sdp_create() based on SDP changes */
Expand Down

0 comments on commit 508ce68

Please sign in to comment.