@@ -1305,6 +1305,24 @@ static int lua_sr_sdpops_with_media(lua_State *L)
env_L = sr_lua_env_get();
+ if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_SDPOPS))
+ {
+ LM_WARN("weird: sdpops function executed but module not registered\n");
+ return app_lua_return_error(L);
+ }
+
+ if(env_L->msg==NULL)
+ LM_WARN("invalid parameters from Lua env\n");
+ if(lua_gettop(L)!=1)
+ LM_ERR("incorrect number of arguments\n");
media.s = (char*)lua_tostring(L, -1);
media.len = strlen(media.s);
@@ -15,7 +15,7 @@ int bind_sdpops(struct sdpops_binds*);
inline static int sdpops_load_api(sdpops_api_t *sob)
{
bind_sdpops_f bind_sdpops_exports;
- if (!(bind_sdpops_exports = (bind_sdpops_f)find_export("bind_sdpops", 0, 0)))
+ if (!(bind_sdpops_exports = (bind_sdpops_f)find_export("bind_sdpops", 1, 0)))
LM_ERR("Failed to import bind_sdpops\n");
return -1;
@@ -56,7 +56,7 @@ static cmd_export_t cmds[] = {
{"sdp_print", (cmd_function)w_sdp_print,
1, fixup_igp_null, 0, ANY_ROUTE},
{"bind_sdpops", (cmd_function)bind_sdpops,
- 0, 0, 0, 0},
+ 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0}
};