Module: sip-router
Branch: master
Commit: 70e4496102ebdb83f6abfa65b14481752bc73ffc
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=70e4496…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Feb 10 11:13:49 2012 +0100
pv: new pv $sid returning server_id value
- server_id can be set via global parameter with same name
---
modules_k/pv/pv.c | 3 +++
modules_k/pv/pv_core.c | 8 ++++++++
modules_k/pv/pv_core.h | 2 ++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/modules_k/pv/pv.c b/modules_k/pv/pv.c
index bc47e1a..d907fe5 100644
--- a/modules_k/pv/pv.c
+++ b/modules_k/pv/pv.c
@@ -339,6 +339,9 @@ static pv_export_t mod_pvs[] = {
{{"si", (sizeof("si")-1)}, /* */
PVT_OTHER, pv_get_srcip, 0,
0, 0, 0, 0},
+ { {"sid", (sizeof("sid")-1)}, /* server id */
+ PVT_OTHER, pv_get_server_id, 0,
+ 0, 0, 0, 0},
{{"sp", (sizeof("sp")-1)}, /* */
PVT_OTHER, pv_get_srcport, 0,
0, 0, 0, 0},
diff --git a/modules_k/pv/pv_core.c b/modules_k/pv/pv_core.c
index 1edaa77..d29b87c 100644
--- a/modules_k/pv/pv_core.c
+++ b/modules_k/pv/pv_core.c
@@ -1592,6 +1592,14 @@ int pv_get_scriptvar(struct sip_msg *msg, pv_param_t *param,
}
return 0;
}
+
+int pv_get_server_id(struct sip_msg *msg, pv_param_t *param,
+ pv_value_t *res)
+{
+ return pv_get_sintval(msg, param, res, server_id);
+}
+
+
/********* end PV get functions *********/
/********* start PV set functions *********/
diff --git a/modules_k/pv/pv_core.h b/modules_k/pv/pv_core.h
index f222f59..4fb83d5 100644
--- a/modules_k/pv/pv_core.h
+++ b/modules_k/pv/pv_core.h
@@ -199,6 +199,8 @@ int pv_get_true(struct sip_msg *msg, pv_param_t *param,
int pv_get_version(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res);
+int pv_get_server_id(struct sip_msg *msg, pv_param_t *param,
+ pv_value_t *res);
/********* end PV get functions *********/
/********* start PV set functions *********/