Module: sip-router
Branch: kamailio_3.0
Commit: 5da493e4457dd97a0d9f3e453303c0aa98cdb30c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5da493e…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Wed Aug 25 22:42:33 2010 +0300
lcr: fix load_gws() 2nd param
load_gws() 2nd optional parameter was treated like a fparam
instead of a pv_spec_t (the fixup_igp_pvar function converts the
first parameter to a fparam and the second one to a pv_spec).
(cherry picked from commit ef56e6bc119e982dc305bfa4b7508ca9226a1287)
Conflicts:
modules/lcr/lcr_mod.c
---
modules/lcr/lcr_mod.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/modules/lcr/lcr_mod.c b/modules/lcr/lcr_mod.c
index 65c65d1..c0df7ab 100644
--- a/modules/lcr/lcr_mod.c
+++ b/modules/lcr/lcr_mod.c
@@ -1695,7 +1695,12 @@ void add_gws_into_avps(struct gw_info *gws, struct matched_gw_info
*matched_gws,
/*
* Load info of matching GWs into gw_uri_avps
*/
+<<<<<<< HEAD
static int load_gws(struct sip_msg* _m, char *_lcr_id, char *_from_uri)
+=======
+static int load_gws(struct sip_msg* _m, fparam_t *_lcr_id,
+ pv_spec_t* _from_uri)
+>>>>>>> ef56e6b... lcr: fix load_gws() 2nd param
{
str ruri_user, from_uri;
int i, j, lcr_id;
@@ -1704,6 +1709,11 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char
*_from_uri)
struct matched_gw_info matched_gws[MAX_NO_OF_GWS + 1];
struct lcr_info **lcrs, *lcr_rec, *pl;
struct gw_info *gws;
+<<<<<<< HEAD
+=======
+ struct target *t;
+ pv_value_t pv_val;
+>>>>>>> ef56e6b... lcr: fix load_gws() 2nd param
/* Get and check parameter values */
if (get_int_fparam(&lcr_id, _m, (fparam_t *)_lcr_id) != 0) {
@@ -1714,6 +1724,7 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char
*_from_uri)
LM_ERR("invalid lcr_id parameter value %d\n", lcr_id);
return -1;
}
+<<<<<<< HEAD
if (get_str_fparam(&from_uri, _m, (fparam_t *)_from_uri) != 0) {
LM_ERR("no from_uri parameter value\n");
@@ -1722,6 +1733,23 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char
*_from_uri)
if (from_uri.len == 0) {
LM_ERR("empry from_uri param value\n");
return -1;
+=======
+ if (_from_uri) {
+ if (pv_get_spec_value(_m, _from_uri, &pv_val) == 0) {
+ if (pv_val.flags & PV_VAL_STR)
+ from_uri = pv_val.rs;
+ else {
+ LM_ERR("non string from_uri parameter value\n");
+ return -1;
+ }
+ } else {
+ LM_ERR("could not get from_uri pvar value\n");
+ return -1;
+ }
+ } else {
+ from_uri.len = 0;
+ from_uri.s = (char *)0;
+>>>>>>> ef56e6b... lcr: fix load_gws() 2nd param
}
/* Use gws and lcr rules with index lcr_id */
@@ -1815,7 +1843,27 @@ static int load_gws(struct sip_msg* _m, char *_lcr_id, char
*_from_uri)
add_avp(lcr_id_avp_type, lcr_id_avp, val);
}
+<<<<<<< HEAD
return 1;
+=======
+ if (gw_index > 0) {
+ return 1;
+ } else {
+ return 2;
+ }
+}
+
+
+static int load_gws_1(struct sip_msg* _m, char *_lcr_id, char *_s2)
+{
+ return load_gws(_m, (fparam_t *)_lcr_id, 0);
+}
+
+
+static int load_gws_2(struct sip_msg* _m, char *_lcr_id, char *_from_uri)
+{
+ return load_gws(_m, (fparam_t *)_lcr_id, (pv_spec_t *)_from_uri);
+>>>>>>> ef56e6b... lcr: fix load_gws() 2nd param
}