<p>Torrey Searle has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13802">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/02/13802/1</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 36b6044..843bafc 100644</span><br><span>--- a/res/res_pjsip_sdp_rtp.c</span><br><span>+++ b/res/res_pjsip_sdp_rtp.c</span><br><span>@@ -1188,6 +1188,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>@@ -1371,9 +1373,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;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_SENDONLY;</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;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ attr->name = STR_SENDRECV;</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/+/13802">change 13802</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/+/13802"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761 </div>
<div style="display:none"> Gerrit-Change-Number: 13802 </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-MessageType: newchange </div>