[asterisk-dev] Sip call consciously without audio

Gunnar Hellstrom gunnar.hellstrom at omnitor.se
Sun May 25 14:33:18 CDT 2014


Hi,

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.

There are very valid cases when a call is wanted with any combination of 
video and text, but no audio.

One place where calls without audio are blocked is in the function:
sip_request_call

Where a comment in the beginning says:
     /* mask request with some set of allowed formats.
      * XXX this needs to be fixed.
      * The original code uses AST_FORMAT_AUDIO_MASK, but it is
      * unclear what to use here. We have global_capabilities, which is
      * configured from sip.conf, and sip_tech.capabilities, which is
      * hardwired to all audio formats.
      */
And then an audio-less call is blocked by this statement:

if (!(ast_format_cap_has_type(cap, AST_FORMAT_TYPE_AUDIO))) {
         ast_log(LOG_NOTICE, "Asked to get a channel of unsupported 
format %s while capability is %s\n",
         ast_getformatname_multiple(tmp, sizeof(tmp), cap),
         ast_getformatname_multiple(tmp2, sizeof(tmp2), sip_cfg.caps));
         *cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;    /* Can't find 
codec to connect to host */
         return NULL;

---------

There is a similar check for outgoing calls in chan-sip.c function 
sip_call :
/* If there are no audio formats left to offer, punt */
     if (!(ast_format_cap_has_type(p->jointcaps, AST_FORMAT_TYPE_AUDIO))) {
         ast_log(LOG_WARNING, "No audio format found to offer. 
Cancelling call to %s\n", p->username);
         res = -1;

I suggest that the check in both these places is replaced with a check 
for any common supported media and codec.

Something like:

if (!(ast_format_cap_has_type(cap, 
(AST_FORMAT_TYPE_AUDIO||AST_FORMAT_TYPE_VIDEO||AST_FORMAT_TYPE_TEXT))) {


Or would it be preferred to create a combined mask for all valid SIP 
media formats in frame.h  ?

(Pjsip should be checked for the same problem.)

Regards

Gunnar


-- 
------------------------------------------------------------------------
Gunnar Hellström
Omnitor
gunnar.hellstrom at omnitor.se

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140525/682869bb/attachment.html>


More information about the asterisk-dev mailing list