I hope that you already imported the "api" package in your app (it makes
easier things because all constants are there and there is also helpful
methods). If not done, import it.
Then, you'll have access to SipConfigManager.getCodecKey() method.
It's this one that gives an access to the key where codec priority is
stored.
So for GSM 8kHz Mono (GSM/8000/1);
the key can be retrieved :
String key = SipConfigManager.getCodecKey("GSM/8000/1",
SipConfigManager.CODEC_WB);
The value should be a string representing a short. "255" is the max, "0"
mean disabled.
Like all core settings it's only take into account after restart of the
sip stack. So one you have finished with your setup you should launch a
restart intent : example :
Intent intent = new
Intent(SipManager.ACTION_SIP_REQUEST_RESTART);
getActivity().sendBroadcast(intent);