Skip to content

Commit

Permalink
nathelper: support to use variable for flags param of add_rcv_param()
Browse files Browse the repository at this point in the history
(cherry picked from commit d2120da)
  • Loading branch information
miconda committed Nov 21, 2017
1 parent 6265734 commit 1d54d51
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/modules/nathelper/nathelper.c
Expand Up @@ -216,7 +216,7 @@ static cmd_export_t cmds[] = {
0, 0,
REQUEST_ROUTE },
{"add_rcv_param", (cmd_function)add_rcv_param_f, 1,
fixup_uint_null, 0,
fixup_igp_null, 0,
REQUEST_ROUTE },
{"is_rfc1918", (cmd_function)is_rfc1918_f, 1,
fixup_spve_null, 0,
Expand Down Expand Up @@ -2098,9 +2098,14 @@ static int add_rcv_param_f(struct sip_msg *msg, char *str1, char *str2)
struct lump *anchor;
char *param;
str uri;
int hdr_param;
int hdr_param = 0;

hdr_param = str1 ? 0 : 1;
if(str1) {
if(fixup_get_ivalue(msg, (gparam_t*))str1, &hdr_param)<0) {
LM_ERR("failed to get falgs parameter\n");
return -1;
}
}

if(create_rcv_uri(&uri, msg) < 0) {
return -1;
Expand Down

0 comments on commit 1d54d51

Please sign in to comment.