Skip to content

Commit

Permalink
pua: port script functions to new param interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu authored and liviuchircu committed Apr 4, 2019
1 parent 7bd63b7 commit 5934768
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions modules/pua/pua.c
Expand Up @@ -102,12 +102,20 @@ static int db_restore(void);
static void db_update(unsigned int ticks,void *param);
static void hashT_clean(unsigned int ticks,void *param);

static cmd_export_t cmds[]=
{
{"bind_libxml_api", (cmd_function)bind_libxml_api, 1, 0, 0, 0},
{"bind_pua", (cmd_function)bind_pua, 1, 0, 0, 0},
{"pua_update_contact", (cmd_function)update_contact, 0, 0, 0, REQUEST_ROUTE},
{0, 0, 0, 0, 0, 0}
// static cmd_export_t cmds[]=
// {
// {"bind_libxml_api", (cmd_function)bind_libxml_api, 1, 0, 0, 0},
// {"bind_pua", (cmd_function)bind_pua, 1, 0, 0, 0},
// {"pua_update_contact", (cmd_function)update_contact, 0, 0, 0, REQUEST_ROUTE},
// {0, 0, 0, 0, 0, 0}
// };

static cmd_export_t cmds[]={
{"bind_libxml_api", (cmd_function)bind_libxml_api, {{0,0,0}}, 0},
{"bind_pua", 0, {{0,0,0}}, 0},
{"pua_update_contact",(cmd_function)bind_pua, {{0,0,0}},
REQUEST_ROUTE},
{0,0,{{0,0,0}},0}
};

static param_export_t params[]={
Expand Down Expand Up @@ -167,7 +175,7 @@ static int mod_init(void)
default_expires= 3600;

/* import the TM auto-loading function */
if((load_tm=(load_tm_f)find_export("load_tm", 0, 0))==NULL)
if((load_tm=(load_tm_f)find_export("load_tm", 0))==NULL)
{
LM_ERR("can't import load_tm\n");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion modules/pua/pua_bind.h
Expand Up @@ -45,7 +45,7 @@ static inline int load_pua_api( pua_api_t *api)
bind_pua_t bind_pua;

/* import the pua auto-loading function */
if ( !(bind_pua= (bind_pua_t)find_export("bind_pua", 1,0))) {
if ( !(bind_pua= (bind_pua_t)find_export("bind_pua",0))) {
LM_ERR("failed to import bind_pua\n");
return -1;
}
Expand Down

0 comments on commit 5934768

Please sign in to comment.