Module: kamailio Branch: master Commit: 72efa93cbf5926402f008180c026d0afbd2c0f9f URL: https://github.com/kamailio/kamailio/commit/72efa93cbf5926402f008180c026d0af...
Author: Yasin CANER caner_yaso@hotmail.com Committer: Henning Westerholt hw@skalatan.de Date: 2019-11-25T20:33:30+01:00
nathelper : new function set_alias_to_avp_f is renamed
function set_alias_to_avp_f is renamed to w_set_alias_to_avp added kemi interface
---
Modified: src/core/parser/parse_uri.h Modified: src/modules/nathelper/nathelper.c
---
Diff: https://github.com/kamailio/kamailio/commit/72efa93cbf5926402f008180c026d0af... Patch: https://github.com/kamailio/kamailio/commit/72efa93cbf5926402f008180c026d0af...
---
diff --git a/src/core/parser/parse_uri.h b/src/core/parser/parse_uri.h index 7def5becf3..a3c8c7142c 100644 --- a/src/core/parser/parse_uri.h +++ b/src/core/parser/parse_uri.h @@ -47,4 +47,5 @@ int parse_orig_ruri(struct sip_msg* msg); int normalize_tel_user(char* res, str* src); void uri_type_to_str(uri_type type, str *s); void proto_type_to_str(unsigned short type, str *s); + #endif /* PARSE_URI_H */ diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c index 681606bb5b..3f820fb02c 100644 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -125,8 +125,8 @@ static int add_rcv_param_f(struct sip_msg *, char *, char *); static int nh_sip_reply_received(sip_msg_t *msg); static int test_sdp_cline(struct sip_msg *msg);
-static int ki_set_alias_to_avp(struct sip_msg *msg, char *uri_avp); -static int set_alias_to_avp_f(struct sip_msg *msg, str *uri_avp); +static int w_set_alias_to_avp(struct sip_msg *msg, char *uri_avp, char *hollow); +static int ki_set_alias_to_avp(struct sip_msg *msg, str *uri_avp); static int alias_to_uri(str *contact_header, str *alias_uri); static int write_to_avp(struct sip_msg *msg, str *data, str *uri_avp);
@@ -228,7 +228,7 @@ static cmd_export_t cmds[] = { {"is_rfc1918", (cmd_function)is_rfc1918_f, 1, fixup_spve_null, 0, ANY_ROUTE }, - {"set_alias_to_avp", (cmd_function)ki_set_alias_to_avp, 1, + {"set_alias_to_avp", (cmd_function)w_set_alias_to_avp, 1, 0, 0, ANY_ROUTE }, {0, 0, 0, 0, 0, 0} }; @@ -2453,14 +2453,14 @@ static int sel_rewrite_contact(str *res, select_t *s, struct sip_msg *msg) return 0; } /*! -* @function ki_set_alias_to_avp +* @function w_set_alias_to_avp * @abstract wrapper of set_alias_to_avp_f * @param msg sip message * @param uri_avp given avp name * * @result 1 successful , -1 fail */ -static int ki_set_alias_to_avp(struct sip_msg *msg, char *uri_avp){ +static int w_set_alias_to_avp(struct sip_msg *msg, char *uri_avp, char *hollow){ str dest_avp={0,0};
if(!uri_avp) @@ -2469,11 +2469,11 @@ static int ki_set_alias_to_avp(struct sip_msg *msg, char *uri_avp){ dest_avp.s=uri_avp; dest_avp.len=strlen(dest_avp.s);
- return set_alias_to_avp_f(msg,&dest_avp); - + return ki_set_alias_to_avp(msg,&dest_avp); } + /*! -* @function set_alias_to_avp_f +* @function ki_set_alias_to_avp * @abstract reads from msg then write to given avp uri_avp as sip uri * * @param msg sip message @@ -2481,7 +2481,7 @@ static int ki_set_alias_to_avp(struct sip_msg *msg, char *uri_avp){ * * @result 1 successful , -1 fail */ -static int set_alias_to_avp_f(struct sip_msg *msg, str *uri_avp){ +static int ki_set_alias_to_avp(struct sip_msg *msg, str *uri_avp){ str contact; str alias_uri={0,0};
@@ -2700,6 +2700,11 @@ static sr_kemi_t sr_kemi_nathelper_exports[] = { { SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("nathelper"), str_init("set_alias_to_avp"), + SR_KEMIP_INT, ki_set_alias_to_avp, + { SR_KEMIP_STR, 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 } } };