Hello,

On 14.02.25 19:13, Temilolu Fayomi via sr-users wrote:
Hello,

I am working with inbound calls on kamailio (specifically fax), and was wondering if there was a way to re-prioritize the codecs found in the sdp of an invite. I've looked at using the sdpops module, but haven't been able to re-arrange the priority of the codecs listed. I've tried removing codecs to help incoming faxes switch over to t38 per my upstream providers instructions (calls will do a t38 re-invite if the g729a is the highest priority). I am just looking for which direction to go from here or if I misunderstand the nature of faxing and kamailio.

the option I would consider right now is to use the sdp iterator from sdpops module. Most likely I would use an embedded scripting languge (e.g., javasapp_jsdtcript or lua via app_jsdt or app_lua) to reorder the codecs by getting the m= line, reorder codecs, remove old one and add the new variant. The embedded scripting languages can be used inline, all the kemi API being available. Some references:

- https://www.kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#sdpops

* inline execution inside kamailio.cfg can be done with:

- https://www.kamailio.org/docs/modules/stable/modules/app_lua.html#app_lua.f.lua_run

- https://www.kamailio.org/docs/modules/stable/modules/app_jsdt.html#app_jsdt.f.jsdt_run

There is also option to use python3.

Cheers, Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio Advanced Training, March 24-28, 2025 -- asipto.com
Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com