<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13823">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough<br><br>When moh_passthrough is used, asterisk is only generating invites<br>of type sendonly and sendrecv instead of taking fully into account<br>the on hold state of the local and remote parties<br><br>ASTERISK-28738 #close<br><br>Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761<br>---<br>M res/res_pjsip_sdp_rtp.c<br>1 file changed, 15 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c</span><br><span>index 8d9cece..dcdb827 100644</span><br><span>--- a/res/res_pjsip_sdp_rtp.c</span><br><span>+++ b/res/res_pjsip_sdp_rtp.c</span><br><span>@@ -1547,6 +1547,8 @@</span><br><span> static const pj_str_t STR_IP6 = { "IP6", 3};</span><br><span> static const pj_str_t STR_SENDRECV = { "sendrecv", 8 };</span><br><span> static const pj_str_t STR_SENDONLY = { "sendonly", 8 };</span><br><span style="color: hsl(120, 100%, 40%);">+ static const pj_str_t STR_INACTIVE = { "inactive", 8 };</span><br><span style="color: hsl(120, 100%, 40%);">+ static const pj_str_t STR_RECVONLY = { "recvonly", 8 };</span><br><span> pjmedia_sdp_media *media;</span><br><span> const char *hostip = NULL;</span><br><span> struct ast_sockaddr addr;</span><br><span>@@ -1811,9 +1813,20 @@</span><br><span> media->attr[media->attr_count++] = attr;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* Add the sendrecv attribute - we purposely don't keep track because pjmedia-sdp will automatically change our offer for us */</span><br><span> attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);</span><br><span style="color: hsl(0, 100%, 40%);">- attr->name = !session_media->locally_held ? STR_SENDRECV : STR_SENDONLY;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (session_media->locally_held) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (session_media->remotely_held) {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_INACTIVE; /* To place on hold a recvonly stream, send inactive */</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_SENDONLY; /* Send sendonly to initate a local hold */</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (session_media->remotely_held) {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_RECVONLY; /* Remote has sent sendonly, reply recvonly */</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_SENDRECV; /* No hold in either direction */</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> media->attr[media->attr_count++] = attr;</span><br><span> </span><br><span> /* If we've got rtcp-mux enabled, add it unless we received an offer without it */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13823">change 13823</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13823"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761 </div>
<div style="display:none"> Gerrit-Change-Number: 13823 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Torrey Searle <tsearle@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>