[Home]

Summary:ASTERISK-24380: core: Native formats are set to h264 with certain audio/video codec configuration, resulting in path translation WARNINGs
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2014-10-01 03:33:16Date Closed:2015-04-10 11:26:33
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/Channels Resources/res_pjsip
Versions:12.6.0 13.0.0-beta2 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-21777 Asterisk tries to transcode video instead of audio
Environment:Attachments:( 0) codecs_log.txt
Description:Given the following codec configuration in {{res_pjsip}}:

{noformat}
allow=!all,g722,ulaw,h263,h264
{noformat}

And two endpoints that support the following codecs:
* 1010 - ulaw,h264
* 2001 - g722,h264

Asterisk incorrectly sets the native format on the channel to h264. This causes WARNING statements as the channel core scrambles to set the native formats to valid audio codecs (g722 on one leg, ulaw on the other):

{noformat}
[Oct  1 02:57:10] DEBUG[11799][C-00000010] res_rtp_asterisk.c: 0x7f78602c9ae0 -- Probation learning mode pass with source address 132.177.252.156:5000
[Oct  1 02:57:10] WARNING[11798][C-00000010] channel.c: Codec mismatch on channel PJSIP/1010-0000002b setting write format to g722 from h264 native formats (ulaw|h264)
[Oct  1 02:57:10] DEBUG[11798][C-00000010] channel.c: Set channel PJSIP/1010-0000002b to write format g722
[Oct  1 02:57:10] DEBUG[11798][C-00000010] translate.c: Sample size different 320 vs 160
[Oct  1 02:57:10] DEBUG[11798][C-00000010] res_rtp_asterisk.c: Ooh, format changed from none to ulaw
[Oct  1 02:57:10] DEBUG[11798][C-00000010] res_rtp_asterisk.c: Starting RTCP transmission on RTP instance '0x7f78601636d8'
[Oct  1 02:57:10] DEBUG[11798][C-00000010] translate.c: Sample size different 320 vs 160
[Oct  1 02:57:10] DEBUG[11798][C-00000010] res_rtp_asterisk.c: 0x7f786029e670 -- Probation learning mode pass with source address 132.177.252.228:5553
[Oct  1 02:57:10] WARNING[11799][C-00000010] channel.c: Codec mismatch on channel PJSIP/2001-0000002d setting write format to ulaw from h264 native formats (g722|h264)
[Oct  1 02:57:10] DEBUG[11799][C-00000010] channel.c: Set channel PJSIP/2001-0000002d to write format ulaw
[Oct  1 02:57:10] DEBUG[11799][C-00000010] translate.c: Sample size different 240 vs 480
{noformat}

Generally, we should be setting up the formats correctly on the channel before getting RTP that corrects our issues.
Comments:By: Richard Mudgett (rmudgett) 2014-10-01 12:19:33.943-0500

There is a comment in the v13 version of chan_pjsip.c:chan_pjsip_new() that likely applies to this issue:
{code}
/*
* XXX Probably should pick the first audio codec instead
* of simply the first codec.  The first codec may be video.
*/
{code}