Module: sip-router
Branch: master
Commit: fab99dce51ef9674c1bb4c50c0c1fefd47cc2d7e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fab99dc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Apr 28 14:54:58 2009 +0200
pv: fix of tobody.params transformation
- reported by Alex Hermann
---
modules_k/pv/pv_trans.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c
index 4988687..3401edd 100644
--- a/modules_k/pv/pv_trans.c
+++ b/modules_k/pv/pv_trans.c
@@ -995,7 +995,12 @@ int tr_eval_tobody(struct sip_msg *msg, tr_param_t *tp, int subtype,
if(_tr_tobody.param_lst!=NULL)
{
val->rs.s = _tr_tobody.param_lst->name.s;
- val->rs.len = _tr_tobody.body.s+_tr_tobody.body.len-val->rs.s;
+ if(_tr_tobody.last_param->value.s!=NULL)
+ val->rs.len = _tr_tobody.last_param->value.s
+ +_tr_tobody.last_param->value.len - val->rs.s;
+ else
+ val->rs.len = _tr_tobody.last_param->name.s
+ +_tr_tobody.last_param->name.len - val->rs.s;
} else val->rs = _tr_empty;
break;