[sr-dev] git:3.3: msrp: return proper value for $msrp(code)
Daniel-Constantin Mierla
miconda at gmail.com
Mon Feb 25 14:05:59 CET 2013
Module: sip-router
Branch: 3.3
Commit: b4861e720ba432addd5c197c9994181168d292c0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4861e720ba432addd5c197c9994181168d292c0
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Mon Feb 11 23:40:53 2013 +0100
msrp: return proper value for $msrp(code)
- internally there is an offset of 10000 to the value in the msrp reply
- reported by Peter Dunkley
(cherry picked from commit 1690eafbb599842f0507ad41c1590fcbba8c7630)
---
modules/msrp/msrp_parser.h | 2 ++
modules/msrp/msrp_vars.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules/msrp/msrp_parser.h b/modules/msrp/msrp_parser.h
index 5117d60..9b26fe1 100644
--- a/modules/msrp/msrp_parser.h
+++ b/modules/msrp/msrp_parser.h
@@ -44,6 +44,8 @@
#define MSRP_REQ_RPLSTART 10000
+#define MSRP_RPL_CODE(n) ((n) - MSRP_REQ_RPLSTART)
+
typedef struct msrp_fline {
str buf;
int msgtypeid;
diff --git a/modules/msrp/msrp_vars.c b/modules/msrp/msrp_vars.c
index cb1dbb9..fdc277a 100644
--- a/modules/msrp/msrp_vars.c
+++ b/modules/msrp/msrp_vars.c
@@ -152,7 +152,8 @@ int pv_get_msrp(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
case 3:
if(mf->fline.msgtypeid==MSRP_REQUEST)
return pv_get_null(msg, param, res);
- return pv_get_intstrval(msg, param, res, mf->fline.rtypeid,
+ return pv_get_intstrval(msg, param, res,
+ MSRP_RPL_CODE(mf->fline.rtypeid),
&mf->fline.rtype);
case 4:
if(mf->hbody.s==NULL)
More information about the sr-dev
mailing list