[Freeswitch-users] Different codec negotiation behaviour

Torsten Hantzsche thantzsche at petitenet.de
Fri Apr 11 18:21:21 MSD 2014



Hi,

i have noticed a difference in the codec negotiation between version 1.2.stable and current master
and would like to ask if this is intentional or a bug.


My FS codec string in vars.xml contains this:

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=opus,speex,silk,G722"/>


The UAC (CSIPsimple) sends the following SDP:


v=0
o=- 3606049718 3606049718 IN IP4 10.0.0.30
s=pjmedia
c=IN IP4 10.0.0.30
t=0 0
m=audio 4000 RTP/AVP 106 99 9 8 3 101
c=IN IP4 10.0.0.30
a=rtpmap:106 speex/16000
a=rtpmap:99 SILK/24000
a=fmtp:99 useinbandfec=0
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtcp:4001 IN IP4 10.0.0.30


FS 1.2 accepts SPEEX with 16kHz:

[DEBUG] sofia_glue.c:5282 Audio Codec Compare [speex:106:16000:20:0]/[opus:116:48000:20:0]
[DEBUG] sofia_glue.c:5282 Audio Codec Compare [speex:106:16000:20:0]/[SPEEX:99:8000:20:24600]
[DEBUG] sofia_glue.c:5282 Audio Codec Compare [speex:106:16000:20:0]/[G722:9:8000:20:64000]
[DEBUG] sofia_glue.c:5355 Substituting codec SPEEX at 20i@16000h
[DEBUG] sofia_glue.c:3190 Set Codec sofia/internal/ally.mcbeal at petitenet.prv SPEEX/16000 20 ms 320 samples 42200 bits


while FS 1.5 seems only to check for SPEEX with 8kHz and then jumps to G722 as closest match:


[DEBUG] switch_core_media.c:3389 Audio Codec Compare [speex:106:16000:20:0]/[opus:116:48000:20:0]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [speex:106:16000:20:0]/[SPEEX:99:8000:20:24600]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [speex:106:16000:20:0]/[SILK:117:8000:20:20000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [speex:106:16000:20:0]/[G722:9:8000:20:64000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [SILK:99:24000:20:0]/[opus:116:48000:20:0]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [SILK:99:24000:20:0]/[SPEEX:99:8000:20:24600]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [SILK:99:24000:20:0]/[SILK:117:8000:20:20000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [SILK:99:24000:20:0]/[G722:9:8000:20:64000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [G722:9:8000:20:64000]/[opus:116:48000:20:0]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [G722:9:8000:20:64000]/[SPEEX:99:8000:20:24600]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [G722:9:8000:20:64000]/[SILK:117:8000:20:20000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [G722:9:8000:20:64000]/[G722:9:8000:20:64000]
[DEBUG] switch_core_media.c:3443 Audio Codec Compare [G722:9:8000:20:64000] ++++ is saved as a match
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [PCMA:8:8000:20:64000]/[opus:116:48000:20:0]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [PCMA:8:8000:20:64000]/[SPEEX:99:8000:20:24600]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [PCMA:8:8000:20:64000]/[SILK:117:8000:20:20000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [PCMA:8:8000:20:64000]/[G722:9:8000:20:64000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [GSM:3:8000:20:13200]/[opus:116:48000:20:0]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [GSM:3:8000:20:13200]/[SPEEX:99:8000:20:24600]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [GSM:3:8000:20:13200]/[SILK:117:8000:20:20000]
[DEBUG] switch_core_media.c:3389 Audio Codec Compare [GSM:3:8000:20:13200]/[G722:9:8000:20:64000]
[DEBUG] switch_core_media.c:3315 Set telephone-event payload to 101
[DEBUG] switch_core_media.c:2343 Set Codec sofia/internal/ally.mcbeal at petitenet.prv G722/8000 20 ms 160 samples 64000 bits


The same occurs with SILK too.

Is this the new behaviour in FS 1.5 ? Does now the codec string always have to be
exactly defined to work for SPEEX or SILK like "speex at 16000h,silk at 24000h" ?


Torsten



Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list