Module: sip-router
Branch: master
Commit: 9051ab74c9f6b97580a832e66385747c94c94380
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9051ab74c9f6b97580a832e66385747c94c94380

Author: Juha Heinanen <[email protected]>
Committer: Juha Heinanen <[email protected]>
Date:   Sun Apr 20 15:17:22 2014 +0300

modules/tmx: added $T_reply_flags pv and fixed bug in t_reuse_branch()

---

 modules/tmx/t_var.c   |   15 +++++++++++++++
 modules/tmx/t_var.h   |    2 ++
 modules/tmx/tmx_mod.c |    5 ++++-
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/modules/tmx/t_var.c b/modules/tmx/t_var.c
index 897f156..4fe974e 100644
--- a/modules/tmx/t_var.c
+++ b/modules/tmx/t_var.c
@@ -322,6 +322,21 @@ int pv_get_t_var_rpl(struct sip_msg *msg,  pv_param_t 
*param,
        return pv_get_spec_value(&_pv_trpl.msg, pv, res);
 }
 
+int pv_get_t_var_branch(struct sip_msg *msg,  pv_param_t *param,
+               pv_value_t *res)
+{
+       pv_spec_t *pv=NULL;
+
+       if(pv_t_update_rpl(msg))
+               return pv_get_null(msg, param, res);
+
+       pv = (pv_spec_t*)param->pvn.u.dname;
+       if(pv==NULL || pv_alter_context(pv))
+               return pv_get_null(msg, param, res);
+
+       return pv_get_spec_value(&_pv_trpl.msg, pv, res);
+}
+
 int pv_get_t_var_inv(struct sip_msg *msg,  pv_param_t *param,
                pv_value_t *res)
 {
diff --git a/modules/tmx/t_var.h b/modules/tmx/t_var.h
index 46e8a50..3fedb60 100644
--- a/modules/tmx/t_var.h
+++ b/modules/tmx/t_var.h
@@ -40,6 +40,8 @@ int pv_get_tm_branch_idx(struct sip_msg *msg, pv_param_t 
*param,
                pv_value_t *res);
 int pv_get_tm_reply_ruid(struct sip_msg *msg, pv_param_t *param,
                pv_value_t *res);
+int pv_get_tm_reply_flags(struct sip_msg *msg, pv_param_t *param,
+               pv_value_t *res);
 int pv_get_tm_reply_code(struct sip_msg *msg, pv_param_t *param,
                pv_value_t *res);
 int pv_get_tm_reply_reason(struct sip_msg *msg, pv_param_t *param,
diff --git a/modules/tmx/tmx_mod.c b/modules/tmx/tmx_mod.c
index 5b2d490..affc53c 100644
--- a/modules/tmx/tmx_mod.c
+++ b/modules/tmx/tmx_mod.c
@@ -124,6 +124,9 @@ static pv_export_t mod_pvs[] = {
        { {"T_reply_ruid", sizeof("T_reply_ruid")-1}, PVT_OTHER,
                pv_get_tm_reply_ruid, 0,
                 0, 0, 0, 0 },
+       { {"T_reply_flags", sizeof("T_reply_flags")-1}, PVT_OTHER,
+               pv_get_tm_reply_flags, 0,
+                0, 0, 0, 0 },
        { {"T_reply_code", sizeof("T_reply_code")-1}, PVT_OTHER,
                pv_get_tm_reply_code, 0,
                 0, 0, 0, 0 },
@@ -611,7 +614,7 @@ static int w_t_reuse_branch(struct sip_msg* msg, char *p1, 
char *p2)
            } else {
                reset_path_vector(msg);
            }
-           setbflagsval(0, t->uac[branch].flags);
+           setbflagsval(0, t->uac[branch].branch_flags);
            set_instance(msg, &(t->uac[branch].instance));
            return 1;
        default:


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to