<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15411">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Allow [peer] without audio (text+video).<br><br>Two previous commits, 620d9f4 and 6d980de, allow to set up a call<br>without audio, again. That was introduced originally with commit f04d5fb<br>but changed and broke over time. The original commit missed one<br>scenario: A [peer] section in sip.conf, which does not allow audio at<br>all. In that case, chan_sip rejected the call, although even when the<br>requester offered no audio. Now, chan_sip does not check whether there<br>is no audio format but checks whether there is no format in general. In<br>other words, if there is at least one format to offer, the call succeeds.<br><br>However, to prevent calls with no-audio, chan_sip still rejects calls<br>when both call parties (caller = requester of the call *and* callee =<br>[peer] section in sip.conf) included audio. In such a case, it is<br>expected that the call should have audio.<br><br>ASTERISK-29280<br><br>Change-Id: I0fb74faf51ef22a60c10b467df6a4d1c1943b73e<br>---<br>M channels/chan_sip.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/11/15411/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index 7aa5581..2abfb93 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -6555,8 +6555,21 @@</span><br><span> ast_rtp_instance_available_formats(p->rtp, p->caps, p->prefcaps, p->jointcaps);</span><br><span> p->jointnoncodeccapability = p->noncodeccapability;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* If there are no audio formats left to offer, punt */</span><br><span style="color: hsl(0, 100%, 40%);">- if (!(ast_format_cap_has_type(p->jointcaps, AST_MEDIA_TYPE_AUDIO))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If there are no formats left to offer, punt */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_format_cap_empty(p->jointcaps)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "No format found to offer. Cancelling call to %s\n", p->username);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = -1;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If audio was requested (prefcaps) and the [peer] section contains</span><br><span style="color: hsl(120, 100%, 40%);">+ * audio (caps) the user expects audio. In that case, if jointcaps</span><br><span style="color: hsl(120, 100%, 40%);">+ * contain no audio, punt. Furthermore, this check allows the [peer]</span><br><span style="color: hsl(120, 100%, 40%);">+ * section to have no audio. In that case, the user expects no audio</span><br><span style="color: hsl(120, 100%, 40%);">+ * and we can pass. Finally, this check allows the requester not to</span><br><span style="color: hsl(120, 100%, 40%);">+ * offer any audio. In that case, the call is expected to have no audio</span><br><span style="color: hsl(120, 100%, 40%);">+ * and we can pass, as well.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if ((ast_format_cap_empty(p->caps) || ast_format_cap_has_type(p->caps, AST_MEDIA_TYPE_AUDIO)) &&</span><br><span style="color: hsl(120, 100%, 40%);">+ (ast_format_cap_empty(p->prefcaps) || ast_format_cap_has_type(p->prefcaps, AST_MEDIA_TYPE_AUDIO)) &&</span><br><span style="color: hsl(120, 100%, 40%);">+ !ast_format_cap_has_type(p->jointcaps, AST_MEDIA_TYPE_AUDIO)) {</span><br><span> ast_log(LOG_WARNING, "No audio format found to offer. Cancelling call to %s\n", p->username);</span><br><span> res = -1;</span><br><span> } else {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15411">change 15411</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/+/15411"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I0fb74faf51ef22a60c10b467df6a4d1c1943b73e </div>
<div style="display:none"> Gerrit-Change-Number: 15411 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>