Module: kamailio
Branch: master
Commit: c1b4d442501591bd18e8130474eeb5c16101e549
URL: https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-15T13:42:13+01:00
core: parse_ppi_pai - free header parameters for PAI and PPI
- they are not considere in the compacted p_id_body_t and not freed
- specs don't mention headers parameters for PAI and PPI, but could come
as UA extensions
---
Modified: parser/parse_ppi_pai.c
---
Diff: https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c…
Patch: https://github.com/kamailio/kamailio/commit/c1b4d442501591bd18e8130474eeb5c…
---
diff --git a/parser/parse_ppi_pai.c b/parser/parse_ppi_pai.c
index db50dc9..a82b50e 100644
--- a/parser/parse_ppi_pai.c
+++ b/parser/parse_ppi_pai.c
@@ -62,6 +62,8 @@ int parse_pai_ppi_body(char *buf, int len, p_id_body_t **body)
LM_ERR("Error parsing PAI/PPI body %u '%.*s'\n", num_uri, len, buf);
return -1;
}
+ /* should be no header params, but in case there are, free them */
+ free_to_params(&uri_b[num_uri]);
num_uri++;
while ((*tmp == ',') && (num_uri < NUM_PAI_BODIES))
{
@@ -72,6 +74,8 @@ int parse_pai_ppi_body(char *buf, int len, p_id_body_t **body)
LM_ERR("Error parsing PAI/PPI body %u '%.*s'\n", num_uri, len, buf);
return -1;
}
+ /* should be no header params, but in case there are, free them */
+ free_to_params(&uri_b[num_uri]);
num_uri++;
}
if (num_uri >= NUM_PAI_BODIES)
subexpressions should not be checked when the expression has private variables
output of the error
```
0(10175) DEBUG: dialplan [dp_db.c:496]: build_rule(): building rule for [2:^(00|\+)([1-9][0-9]+)$/^(00|\+)([1-9][0-9]+)$/\2]
0(10175) DEBUG: dialplan [dp_db.c:533]: build_rule(): attrs are: ''
0(10175) DEBUG: dialplan [dp_db.c:580]: add_rule2hash(): new dpl_id 1
0(10175) DEBUG: dialplan [dp_db.c:593]: add_rule2hash(): new index , len 0
0(10175) DEBUG: dialplan [dp_db.c:629]: add_rule2hash(): added the rule id 1 index 0 pr 1 next (nil) to the index with 0 len
0(10175) DEBUG: dialplan [dp_repl.c:146]: repl_exp_parse(): replacement expression is [\1]
0(10175) DEBUG: dialplan [dp_db.c:102]: dpl_check_pv(): parsing [^$avp(s:caller_cc)$avp(s:caller_ac)([1-9][0-9]+)$]
0(10175) DEBUG: <core> [pvapi.c:419]: pv_spec_lookup(): PV <$avp(s:caller_cc)> is not in cache
0(10175) DEBUG: <core> [usr_avp.c:882]: parse_avp_ident(): Parsing 's:caller_cc'
0(10175) DEBUG: <core> [pvapi.c:293]: pv_cache_add(): pvar [$avp(s:caller_cc)] added in cache
0(10175) DEBUG: dialplan [dp_db.c:124]: dpl_check_pv(): string [^$avp(s:caller_cc)$avp(s:caller_ac)([1-9][0-9]+)$] has variables
0(10175) DEBUG: dialplan [dp_db.c:496]: build_rule(): building rule for [2:^$avp(s:caller_cc)$avp(s:caller_ac)([1-9][0-9]+)$/^$avp(s:caller_cc)$avp(s:caller_ac)([1-9][0-9]+)$/\1]
0(10175) ERROR: dialplan [dp_db.c:502]: build_rule(): repl_exp \1 refers to 1 sub-expressions, but subst_exp ^$avp(s:caller_cc)$avp(s:caller_ac)([1-9][0-9]+)$ has only 0
0(10175) DEBUG: dialplan [dp_db.c:685]: destroy_rule(): destroying rule with priority 1
```
You can merge this Pull Request by running:
git pull https://github.com/linuxmaniac/kamailio vseva/dialplan_fix
Or you can view, comment on it, or merge it online at:
https://github.com/kamailio/kamailio/pull/17
-- Commit Summary --
* dialplan: don't check subexpressions on expressions with pvs
-- File Changes --
M modules/dialplan/dp_db.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/17.patchhttps://github.com/kamailio/kamailio/pull/17.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/17