Module: sip-router
Branch: master
Commit: 9a8bc0242200508f325b723d7c210b1e0dd6bf77
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9a8bc02…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Dec 9 10:41:36 2014 +0100
tmx: consistency to return $null when a $T_branch(id) value is not available
---
modules/tmx/t_var.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/tmx/t_var.c b/modules/tmx/t_var.c
index fa2a804..1bc86c6 100644
--- a/modules/tmx/t_var.c
+++ b/modules/tmx/t_var.c
@@ -729,7 +729,7 @@ int pv_get_t_branch(struct sip_msg *msg, pv_param_t *param,
}
switch(param->pvn.u.isname.name.n) {
- case 5:
+ case 5: /* $T_branch(flags) */
switch (get_route_type()) {
case FAILURE_ROUTE:
case BRANCH_FAILURE_ROUTE:
@@ -737,7 +737,7 @@ int pv_get_t_branch(struct sip_msg *msg, pv_param_t *param,
if ((branch=_tmx_tmb.t_get_picked_branch()) < 0) {
LM_CRIT("no picked branch (%d) for a final response"
" in MODE_ONFAILURE\n", branch);
- return -1;
+ return pv_get_null(msg, param, res);
}
res->ri = t->uac[branch].branch_flags;
res->flags = PV_VAL_INT;
@@ -745,10 +745,10 @@ int pv_get_t_branch(struct sip_msg *msg, pv_param_t *param,
break;
default:
LM_ERR("unsupported route_type %d\n", get_route_type());
- return -1;
+ return pv_get_null(msg, param, res);
}
break;
- case 6:
+ case 6: /* $T_branch(uri) */
if (get_route_type() != TM_ONREPLY_ROUTE) {
LM_ERR("$T_branch(uri) - unsupported route_type %d\n",
get_route_type());