I am using Pjsip Library for the call and as I am changing codec from my code and its getting change with the new priority but it not updating in FreeSWITCH call logs as it showing me older codec. Not updating with new priority codec. For suppose i have change Codec priority from PCMU 8 kHz to G729 8 kHz. but it showing me logs with PCMU only not with G729.
I have used following PJSIP inbuilt method to change CodecPriority as it changes internally in the device but not reflecting to FreeSWITCH logs.
public short getCodecPriority(String codecName, String type, String defaultValue) {
String key = SipConfigManager.getCodecKey(codecName, type);
if (key != null) {
String val = getPreferenceStringValue(key, defaultValue);
if (!TextUtils.isEmpty(val)) {
try {
return (short) Integer.parseInt(val);
} catch (NumberFormatException e) {
Log.e(THIS_FILE, "Impossible to parse " + val);
}
}
}
return (short) Integer.parseInt(defaultValue);
}
/**
* Set the priority for the codec for a given bandwidth type
*
* @param codecName the name of the codec as announced by codec
* @param type bandwidth type <br/>
* For now, valid constants are :
* {@link SipConfigManager#CODEC_NB} and
* {@link SipConfigManager#CODEC_WB}
* @param newValue Short value for preference as a string.
*/
public void setCodecPriority(String codecName, String type, String newValue) {
String key = SipConfigManager.getCodecKey(codecName, type);
if (key != null) {
setPreferenceStringValue(key, newValue);
}
// TODO : else raise error
}
I have used reference code from CSipSimple GitHub code.
If anyone has an idea about changing codec priority in FreeSWITCH call logs then please share Your answer.
Thanks.