Module: kamailio Branch: master Commit: 5b0449b583f722b070e59b0735e26aa16ca413ee URL: https://github.com/kamailio/kamailio/commit/5b0449b583f722b070e59b0735e26aa1...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-04-29T08:32:21+02:00
pua: exported functions to kemi framework
---
Modified: src/modules/pua/hash.c Modified: src/modules/pua/hash.h Modified: src/modules/pua/pua.c
---
Diff: https://github.com/kamailio/kamailio/commit/5b0449b583f722b070e59b0735e26aa1... Patch: https://github.com/kamailio/kamailio/commit/5b0449b583f722b070e59b0735e26aa1...
---
diff --git a/src/modules/pua/hash.c b/src/modules/pua/hash.c index d364651..de818e5 100644 --- a/src/modules/pua/hash.c +++ b/src/modules/pua/hash.c @@ -504,7 +504,7 @@ int is_dialog(ua_pres_t* dialog)
}
-int update_contact(struct sip_msg* msg, char* str1, char* str2) +int ki_pua_update_contact(struct sip_msg* msg) { ua_pres_t* p, hentity; str contact; @@ -636,6 +636,11 @@ int update_contact(struct sip_msg* msg, char* str1, char* str2) return -1; }
+int w_pua_update_contact(struct sip_msg* msg, char* str1, char* str2) +{ + return ki_pua_update_contact(msg); +} + list_entry_t *get_subs_list(str *did) { int i; diff --git a/src/modules/pua/hash.h b/src/modules/pua/hash.h index b9a81b4..ee4c01f 100644 --- a/src/modules/pua/hash.h +++ b/src/modules/pua/hash.h @@ -178,6 +178,7 @@ static inline int get_event_flag(str* event) return -1; }
-int update_contact(struct sip_msg* msg, char* str1, char* str2); +int w_pua_update_contact(struct sip_msg* msg, char* str1, char* str2); +int ki_pua_update_contact(struct sip_msg* msg);
#endif diff --git a/src/modules/pua/pua.c b/src/modules/pua/pua.c index 360ba2d..e86c54d 100644 --- a/src/modules/pua/pua.c +++ b/src/modules/pua/pua.c @@ -36,6 +36,7 @@ #include "../../core/str.h" #include "../../core/mem/mem.h" #include "../../core/pt.h" +#include "../../core/kemi.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" #include "../../lib/srdb1/db.h" @@ -114,10 +115,10 @@ static int pua_rpc_init(void);
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} + {"pua_update_contact", (cmd_function)w_pua_update_contact, 0, 0, 0, REQUEST_ROUTE}, + {"bind_libxml_api", (cmd_function)bind_libxml_api, 1, 0, 0, 0}, + {"bind_pua", (cmd_function)bind_pua, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0} };
static param_export_t params[]={ @@ -1231,3 +1232,27 @@ static int pua_rpc_init(void) } return 0; } + +/** + * + */ +/* clang-format off */ +static sr_kemi_t sr_kemi_pua_exports[] = { + { str_init("pua"), str_init("pua_update_contact"), + SR_KEMIP_INT, ki_pua_update_contact, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + + { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } } +}; +/* clang-format on */ + +/** + * + */ +int mod_register(char *path, int *dlflags, void *p1, void *p2) +{ + sr_kemi_modules_add(sr_kemi_pua_exports); + return 0; +} \ No newline at end of file