You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/863
-- Commit Summary --
* test/unit: update unit test 60 * modules/sdpops: add optional media parameter to sdp_remove_line_by_prefix() * test/unit: update unit test 60
-- File Changes --
M modules/sdpops/api.h (2) M modules/sdpops/doc/sdpops_admin.xml (2) M modules/sdpops/sdpops_mod.c (146) A test/unit/60-message-sdp9.sip (31) M test/unit/60.cfg (7) M test/unit/60.sh (36) M test/unit/include/common (2) M test/unit/include/require.sh (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/863.patch https://github.com/kamailio/kamailio/pull/863.diff
Is the change affecting the modules using the sdpops api -- the app_lua is using the function:
``` $ ag --cc sdp_remove_line_by_prefix modules/app_lua/app_lua_exp.c 2186: ret = _lua_sdpopsb.sdp_remove_line_by_prefix(env_L->msg, &media); 2279: {"sdp_remove_line_by_prefix", lua_sr_sdpops_remove_line_by_prefix}, ```
Didn't see that coming... yes, I modified modules/sdpops/api.h: ``` @@ -41,7 +41,7 @@ typedef struct sdpops_binds { sdp_keep_media_t sdp_keep_codecs_by_name; sdp_remove_media_t sdp_remove_media; sdp_remove_media_t sdp_remove_transport; - sdp_remove_media_t sdp_remove_line_by_prefix; + sdp_remove_media_type_t sdp_remove_line_by_prefix; ```
@mslehto pushed 1 commit.
18c7eaf modules/app_lua: sdpops API changed
Is it now requiring two parameters from Lua?
If the second is not provided (e.g., using an old script with previous version of the function prototype), then I think it will crash, because it is doing a strlen(NULL).
I think I get it. I will prepare full Lua environment and test more thoroughly. Thanks for patience!
@mslehto pushed 2 commits.
0ede53d modules/app_lua: support 1 or 2 parameters with sr.sdpops.sdp_remove_line_by_prefix() 892ab27 test/unit: create unit test 61
Now I handle original single parameter version as well as the new functionality with two parameters.
Maybe publishing functions via kemi would require less code for different language bindings, right?
Yes, kemi should simplify and do the export only inside the sdpops module, then lua and python (at this moment, other languages to be added soon) will pick from there everything, without any change in lua/python modules.
Merged #863.