[asterisk-dev] Sip call consciously without audio

Gunnar Hellstrom gunnar.hellstrom at omnitor.se
Tue May 27 16:59:59 CDT 2014


On 2014-05-25 21:33, Gunnar Hellstrom wrote:
> 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))) {
Yes, it works with this modification in the two mentioned locations:

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


Is this sufficient?
Are there other cases than calls with video and text media  that should 
have the same possibility to have calls without audio?
Does anyone know if audio-less calls are already supported in the new 
stack pjsip?

Regards
Gunnar
>
>
> 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/20140527/6d06d5a7/attachment-0001.html>


More information about the asterisk-dev mailing list