--- main/channel.c (Asterisk 13.38.1) +++ main/channel.c (working copy) @@ -6387,4 +6387,9 @@ struct ast_channel *ast_request(const ch tmp_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT); - if (tmp_cap) { - ast_format_cap_append_from_cap(tmp_cap, request_cap, AST_MEDIA_TYPE_AUDIO); + if (!tmp_cap) { + AST_RWLIST_UNLOCK(&backends); + return NULL; + } + + ast_format_cap_append_from_cap(tmp_cap, request_cap, AST_MEDIA_TYPE_AUDIO); + if (!ast_format_cap_empty(tmp_cap)) { /* We have audio - is it possible to connect the various calls to each other? @@ -6421,3 +6426,5 @@ struct ast_channel *ast_request(const ch ast_format_cap_remove_by_type(joint_cap, AST_MEDIA_TYPE_AUDIO); - ast_format_cap_append(joint_cap, best_audio_fmt, 0); + if (best_audio_fmt) { /* text+video call? then, this is NULL */ + ast_format_cap_append(joint_cap, best_audio_fmt, 0); + }