[Freeswitch-users] Codec Negotiation Help

Robert Hadley robert.hadley at teotech.com
Wed May 8 00:37:35 MSD 2013


Hi Spencer,

I also use late_negotiation and inherit_codec=true.  I configure outbound codecs to append ep_codec_string using originator_codec.

    <extension name="configure_outbound_codec" continue="true">
      <condition field="${ep_codec_string}" expression="^(.+)$">
        <action inline="true" application="set" data="originator_codec=${ep_codec_string}"/>
      </condition>
    </extension>

Regards,
Robert


-----Original Message-----
From: Spencer Thomason [mailto:spencer at 5ninesolutions.com] 
Sent: Tuesday, May 07, 2013 9:03 AM
To: FreeSWITCH Users Help
Subject: [Freeswitch-users] Codec Negotiation Help

Hello all,
I'm having a bit of trouble getting codec negotiation working the way I'd like to.  I'm trying to avoid transcoding unless its absolutely necessary for the call to be setup.  I use two profiles with late negotiation enabled, an internal facing registered user endpoints and an external facing the PSTN via various ITSPs.  For calls to users I've been setting codec_string=${ep_codec_string} in my dial strings and normal bridges work fine but I'm now reworking the hunt groups using enterprise originate and that doesn't seem to work correctly (the callee's preferences are always used).  So I'd like to do the the "right" way now :-)

The basic scenario is this:

On the internal profile I have:
CODECS IN        	G722,PCMU,G729,GSM
CODECS OUT       	G722,PCMU,G729,GSM

On the external profile I have:
CODECS IN        	G722,PCMU,G729
CODECS OUT       	G722,PCMU,G729

What I'm trying to accomplish is this:
Call from PSTN, use caller's codecs as priority for the bridge, i.e.
PSTN GW --- PCMU, G729 -->  FreeSWITCH --- PCMU,G729,G722, GSM ---> Local Endpoint PSTN GW --- G729,PCMU -->  FreeSWITCH --- G729,PCMU,G722, GSM ---> Local Endpoint PSTN GW --- G722,PCMU -->  FreeSWITCH --- G722,PCMU,G729, GSM ---> Local Endpoint


Call from local endpoint to PSTN, use callee's codecs as priority for the bridge, i.e.
Local Endpoint Offers G722, PCMU, G729
GW Responds PCMU,G729
Local Endpoint --- G722,PCMU,G729 ---> FreeSWITCH --- G722,PCMU, G729 --> PSTN Desired negotiation: Both legs use PCMU

Local Endpoint Offers G722, PCMU, G729
GW Responds G729,PCMU
Local Endpoint --- G722,PCMU,G729 ---> FreeSWITCH --- G722,PCMU,G729 --> PSTN Desired negotiation: Both legs use G729

Local Endpoint Offers GSM
GW Responds PCMU, G729
Local Endpoint --- GSM ---> FreeSWITCH --- G722,PCMU,G729 --> PSTN Desired negotiation: Leg A uses GSM, Leg B uses PCMU, FreeSWITCH transcodes.

Any help is greatly appreciated!


Thanks,
Spencer








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