Module: kamailio
Branch: master
Commit: 4c65f4fd4dda697e48757e06e011fa58a2000588
URL:
https://github.com/kamailio/kamailio/commit/4c65f4fd4dda697e48757e06e011fa5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-26T09:21:59+02:00
dialplan: added append_branch parameter
- control if the module should do append branch if r-uri or r-uri
username are changed inside failure route
- default value is 1 (append branch - preserves compatibility)
---
Modified: src/modules/dialplan/dialplan.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4c65f4fd4dda697e48757e06e011fa5…
Patch:
https://github.com/kamailio/kamailio/commit/4c65f4fd4dda697e48757e06e011fa5…
---
diff --git a/src/modules/dialplan/dialplan.c b/src/modules/dialplan/dialplan.c
index cac1df7124..5a94e8c21c 100644
--- a/src/modules/dialplan/dialplan.c
+++ b/src/modules/dialplan/dialplan.c
@@ -85,6 +85,7 @@ dp_param_p default_par2 = NULL;
int dp_fetch_rows = 1000;
int dp_match_dynamic = 0;
+int dp_append_branch = 1;
static param_export_t mod_params[]={
{ "db_url", PARAM_STR, &dp_db_url },
@@ -100,6 +101,7 @@ static param_export_t mod_params[]={
{ "attrs_pvar", PARAM_STR, &attr_pvar_s },
{ "fetch_rows", PARAM_INT, &dp_fetch_rows },
{ "match_dynamic", PARAM_INT, &dp_match_dynamic },
+ { "append_branch", PARAM_INT, &dp_append_branch },
{0,0,0}
};
@@ -267,11 +269,15 @@ static int dp_update(struct sip_msg * msg, pv_spec_t * dest,
return -1;
}
- if(is_route_type(FAILURE_ROUTE)
- && (dest->type==PVT_RURI || dest->type==PVT_RURI_USERNAME)) {
- if (append_branch(msg, 0, 0, 0, Q_UNSPECIFIED, 0, 0, 0, 0, 0, 0) != 1) {
- LM_ERR("append_branch action failed\n");
- return -1;
+ if(dp_append_branch!=0) {
+ if(is_route_type(FAILURE_ROUTE)
+ && (dest->type == PVT_RURI
+ || dest->type == PVT_RURI_USERNAME)) {
+ if(append_branch(msg, 0, 0, 0, Q_UNSPECIFIED, 0, 0, 0, 0, 0, 0)
+ != 1) {
+ LM_ERR("append branch action failed\n");
+ return -1;
+ }
}
}