]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Change sip_get_codec() to return correct codec list
authorVitezslav Novy <a1@vnovy.net>
Mon, 8 May 2017 18:40:47 +0000 (20:40 +0200)
committerVitezslav Novy <a1@vnovy.net>
Mon, 8 May 2017 18:43:52 +0000 (20:43 +0200)
Return cahnnel nativeformats to fix bridge technology selection process.
Same approach as in pjsip module.

ASTERISK-26143
Reported-by: Henning Holtschneider
Change-Id: I64e863753954d6ad67a9e722df2ebc328705ad48

channels/chan_sip.c

index 2c5d3c31409be565bf758d39166d791eabdf7249..43084cebb64223ea7b55e03c737316278a593de7 100644 (file)
@@ -33481,9 +33481,7 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
 
 static void sip_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
 {
-       struct sip_pvt *p = ast_channel_tech_pvt(chan);
-
-       ast_format_cap_append_from_cap(result, !ast_format_cap_count(p->peercaps) ? p->caps : p->peercaps, AST_MEDIA_TYPE_UNKNOWN);
+       ast_format_cap_append_from_cap(result, ast_channel_nativeformats(chan), AST_MEDIA_TYPE_UNKNOWN);
 }
 
 static struct ast_rtp_glue sip_rtp_glue = {