<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2014-05-25 21:33, Gunnar Hellstrom
wrote:<br>
</div>
<blockquote cite="mid:5382457E.2070704@omnitor.se" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi,<br>
<br>
chan-sip.c in release 11 and 12 is dropping sip calls in which no
common audio media is negotiated, regardless of if other media are
negotiated. <br>
<br>
There are very valid cases when a call is wanted with any
combination of video and text, but no audio.<br>
<br>
One place where calls without audio are blocked is in the
function:<br>
sip_request_call<br>
<br>
Where a comment in the beginning says:<br>
/* mask request with some set of allowed formats.<br>
* XXX this needs to be fixed.<br>
* The original code uses AST_FORMAT_AUDIO_MASK, but it is<br>
* unclear what to use here. We have global_capabilities,
which is<br>
* configured from sip.conf, and sip_tech.capabilities, which
is<br>
* hardwired to all audio formats.<br>
*/<br>
And then an audio-less call is blocked by this statement:<br>
<br>
if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {<br>
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported
format %s while capability is %s\n",<br>
ast_getformatname_multiple(tmp, sizeof(tmp), cap),<br>
ast_getformatname_multiple(tmp2, sizeof(tmp2),
sip_cfg.caps));<br>
*cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL; /* Can't
find codec to connect to host */<br>
return NULL;<br>
<br>
---------<br>
<br>
There is a similar check for outgoing calls in chan-sip.c function
sip_call :<br>
/* If there are no audio formats left to offer, punt */<br>
if (!(ast_format_cap_has_type(p->jointcaps,
AST_FORMAT_TYPE_AUDIO))) {<br>
ast_log(LOG_WARNING, "No audio format found to offer.
Cancelling call to %s\n", p->username);<br>
res = -1;<br>
<br>
I suggest that the check in both these places is replaced with a
check for any common supported media and codec.<br>
<br>
Something like:<br>
<br>
if (!(ast_format_cap_has_type(cap,
(AST_FORMAT_TYPE_AUDIO||AST_FORMAT_TYPE_VIDEO||AST_FORMAT_TYPE_TEXT)))
{<br>
</blockquote>
Yes, it works with this modification in the two mentioned locations:<br>
<br>
if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO) || <br>
ast_format_cap_has_type(cap, AST_FORMAT_TYPE_VIDEO) ||<br>
ast_format_cap_has_type(cap, AST_FORMAT_TYPE_TEXT))) {<br>
<br>
<br>
Is this sufficient? <br>
Are there other cases than calls with video and text media that
should have the same possibility to have calls without audio?<br>
Does anyone know if audio-less calls are already supported in the
new stack pjsip?<br>
<br>
Regards<br>
Gunnar <br>
<blockquote cite="mid:5382457E.2070704@omnitor.se" type="cite"> <br>
<br>
Or would it be preferred to create a combined mask for all valid
SIP media formats in frame.h ?<br>
<br>
(Pjsip should be checked for the same problem.)<br>
<br>
Regards<br>
<br>
Gunnar<br>
<br>
<br>
<div class="moz-signature">-- <br>
<hr> Gunnar Hellström<br>
Omnitor<br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:gunnar.hellstrom@omnitor.se">gunnar.hellstrom@omnitor.se</a><br>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>