From 6120351970995ba36799b7d9f6720ea7433b597e Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Mon, 4 Mar 2019 14:20:56 +0100 Subject: [PATCH] TT#54256 Fix dialplan errors if rwr contains avps Change-Id: I3b517da09315e9b33c696d832bf3d9ab21685d9d --- debian/patches/series | 1 + .../patches/sipwise/fix_dialplan_errors.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 debian/patches/sipwise/fix_dialplan_errors.patch diff --git a/debian/patches/series b/debian/patches/series index caa170611..948e6a1a7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,6 +22,7 @@ sipwise/cfgt_onsend_exit.patch sipwise/fix_error_in_cfgt_module.patch sipwise/pv_trans_eval_uri.patch sipwise/avpops_avp_subst_pvar.patch +sipwise/fix_dialplan_errors.patch ## SCA Patches sipwise/sca-line-seize.patch sipwise/sca-fallback-if-no-contact.patch diff --git a/debian/patches/sipwise/fix_dialplan_errors.patch b/debian/patches/sipwise/fix_dialplan_errors.patch new file mode 100644 index 000000000..6dea604d3 --- /dev/null +++ b/debian/patches/sipwise/fix_dialplan_errors.patch @@ -0,0 +1,35 @@ +--- a/src/modules/dialplan/dp_repl.c ++++ b/src/modules/dialplan/dp_repl.c +@@ -432,7 +432,7 @@ int rule_translate(sip_msg_t *msg, str * + /*search for the pattern from the compiled subst_exp*/ + if (pcre_exec(subst_comp, NULL, instr->s, instr->len, + 0, 0, ovector, 3 * (MAX_REPLACE_WITH + 1)) <= 0) { +- LM_ERR("the string %.*s matched " ++ LM_DBG("the string %.*s matched " + "the match_exp %.*s but not the subst_exp %.*s!\n", + instr->len, instr->s, + rule->match_exp.len, rule->match_exp.s, +@@ -700,7 +700,7 @@ repl: + } + } + if(rulep->tflags&DP_TFLAGS_PV_SUBST) { +- re_list = dpl_dynamic_pcre_list(msg, &rulep->match_exp); ++ re_list = dpl_dynamic_pcre_list(msg, &rulep->subst_exp); + if(re_list==NULL) { + /* failed to compile dynamic pcre -- ignore */ + LM_DBG("failed to compile dynamic pcre[%.*s]\n", +@@ -721,6 +721,14 @@ repl: + pkg_free(re_list); + re_list = rt; + } while(re_list); ++ ++ if(rez<0) { ++ LM_ERR("the string %.*s matched " ++ "the match_exp %.*s but not the subst_exp %.*s!\n", ++ input->len, input->s, ++ rulep->match_exp.len, rulep->match_exp.s, ++ rulep->subst_exp.len, rulep->subst_exp.s); ++ } + } + else { + if(rule_translate(msg, input, rulep, rulep->subst_comp, output)!=0){