[Freeswitch-users] Codec negotiation with carriers

Anto potxoka at gmail.com
Wed Mar 7 01:30:51 MSK 2012


Hi

I am following the steps in this direction
"http://wiki.freeswitch.org/wiki/SBC_Setup" and
"http://wiki.freeswitch.org/wiki/Provider_Configuration:_Broadvoice",
I reread the whole entire wiki (or so I lack), but do not quite
assimilate or finding the right formula to operate the bridge :-S.

I captured traffic with ngrep, I enabled sip-trace, console logconsole
8, etc., but unless the transcoding error (only two of the hundreds of
combinations of settings that I have), I have not seen anything
"weird" :-S

I have 3 suppliers, each with this codec:

1)           2)              3)
G729        G729        G729
G711u      G711A      G711A
G711A     G711u       G711u
                G723         G723
                                  G722
                                  GSM

I think I understand that when making an outside call, FreeSWITCH
follow these steps:

USER -> (   Dialplan -> profile (internal) -> bridge (external) ->
profile (external)   ) -> PROVIDER

PROVIDER -> (   Dialplan -> profile (external) -> bridge (internal) ->
profile (internal)  ) -> USER

right?

Internal and external I set as follows (and not many changes have
done, and not remember it, because I've been testing days). If
outbound (outbound-codec-prefs) all codecs specified system does not
handle the call, I have to specify these by hand. If active
inbound-proxy-media, not the caller. Some of the time I worked, but
gave me an error that it can do transcoding G729 codec (I do
passthrough), but the proxy does not work half.

If the outbound property (outbound-codec-prefs) all codecs specified
system does not handle the call, I have to specify these by hand. If
active inbound-proxy-media, not the caller. Some of the time I worked,
but gave me an error that it can do transcoding G729 codec (I want to
make passthrough), but the "proxy media" does not work.

Basically, what I do is that local users can use all the codecs
allowed (iLBC, GSM, ...) and make an outside call, use the carrier
that will indicate the priority but the free codec.

With this configuration works for me, but I would like to understand
why so if it works and otherwise no. Coming to understand how to
configure properly and so as not to disturb the mail list ;-). Thanks
!

Best regards
Anto

vars.xml

<X-PRE-PROCESS cmd="set"
data="global_codec_prefs=iLBC,G7221,speex,PCMU,PCMA,BV16,G726-32,GSM,G729,G723,AMR"/>
<X-PRE-PROCESS cmd="set"
data="carriers_codec_prefs=PCMU,PCMA,G729,G723,AMR,iLBC,G7221,speex,BV16,G726-32,GSM"/>

internal.xml

<param name="codec-prefs" value="$${global_codec_prefs}"/>
<!--param name="inbound-codec-prefs" value="$${global_codec_prefs}"/>
<param name="outbound-codec-prefs" value="$${global_codec_prefs}"/-->
<!--param name="inbound-codec-negotiation" value="generous"/-->
<param name="inbound-codec-negotiation" value="greedy"/>
<param name="inbound-late-negotiation" value="true"/>
<param name="renegotiate-codec-on-reinvite" value="true"/>
<!--param name="inbound-proxy-media" value="true"/-->

external.xml

<param name="codec-prefs" value="$${carriers_codec_prefs}"/>
<param name="inbound-codec-prefs" value="$${carriers_codec_prefs}"/>
<!--param name="outbound-codec-prefs" value="$${carriers_codec_prefs}"/-->
<param name="outbound-codec-prefs" value="PCMU,PCMA,G729,G723"/>
<!--param name="inbound-codec-negotiation" value="generous"/-->
<param name="inbound-codec-negotiation" value="greedy"/>
<param name="inbound-late-negotiation" value="true"/>
<param name="renegotiate-codec-on-reinvite" value="true"/>
<!--param name="inbound-proxy-media" value="true"/-->

dialplan/outbound.xml

<include>
	<context name="internal">
		<extension name="outbound">
		  <condition field="destination_number" expression="^(\d+)$">
			<!--action application="set" data="inherit_codec=true"/-->
			<!--action application="set" data="hangup_after_bridge=true"/-->
		  	<!--action application="set" data="proxy_media=true"/-->
			<action application="bridge" data="sofia/gateway/provider-2/$1"/>
		  </condition>
		</extension>	
	</context>



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list