[Freeswitch-users] Codec Negotiation Help

Spencer Thomason spencer at 5ninesolutions.com
Tue May 7 20:03:00 MSD 2013


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