Skip to content

Commit

Permalink
rtpengine: fix to_tag for copy offer
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jan 7, 2022
1 parent c16b8ed commit be18af6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/rtpengine/rtpengine.c
Expand Up @@ -3908,7 +3908,7 @@ static bencode_item_t *rtpengine_api_copy_op(struct rtp_relay_session *sess,
bencode_item_t *ret;
struct sip_msg *msg;
struct rtpe_set* rset;
str viabranch, *to_tag;
str viabranch;
char viabranch_buf[2/* br */ + INT2STR_MAX_LEN];

RTPE_START_READ();
Expand All @@ -3931,9 +3931,8 @@ static bencode_item_t *rtpengine_api_copy_op(struct rtp_relay_session *sess,
memcpy(viabranch.s, "br", 2);
bencode_dictionary_add_str(dict, "via-branch", &viabranch);
}
to_tag = copy_ctx?copy_ctx:sess->to_tag;
if (to_tag && to_tag->len)
bencode_dictionary_add_str(dict, "to_tag", to_tag);
if (copy_ctx && ((str *)copy_ctx)->len)
bencode_dictionary_add_str(dict, "to_tag", copy_ctx);
if (copy_flags & RTP_COPY_MODE_SIPREC) {
list = bencode_list(&bencbuf);
bencode_dictionary_add(dict, "flags", list);
Expand Down

0 comments on commit be18af6

Please sign in to comment.