Module: sip-router Branch: kamailio_3.0 Commit: 5da493e4457dd97a0d9f3e453303c0aa98cdb30c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5da493e4...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@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 }
Hi Juha
Could you please check this commit? All my nightly builds of kamailio_3.0 branch have failed while compiling the lcr module and this commit seems to be responsible of that :)
lcr_mod.c:1698: error: expected identifier or ‘(’ before ‘<<’ token lcr_mod.c:1703:40: error: invalid suffix "nd" on integer constant lcr_mod.c:1716:40: error: invalid suffix "nd" on integer constant lcr_mod.c:1752:40: error: invalid suffix "nd" on integer constant lcr_mod.c:1866:40: error: invalid suffix "nd" on integer constant make[2]: *** [lcr_mod.o] Error 1 make[2]: se sale del directorio `/usr/src/kamailio/kamailiogitsrc-kamailio_3.0/modules/lcr' make[1]: *** [modules] Error 1 make[1]: se sale del directorio `/usr/src/kamailio/kamailiogitsrc-kamailio_3.0' make: *** [build-stamp] Error 2 dpkg-buildpackage: failure: debian/rules build gave error exit status 2
cheers,
Jon
Jon Bonilla (Manwe) writes:
Could you please check this commit? All my nightly builds of kamailio_3.0 branch have failed while compiling the lcr module and this commit seems to be responsible of that :)
jon,
i don't know what has happened. i already asked about it on sr-dev list. my kamailio_3.0 commit (below) didn't involve lcr module. andrei did an lcr related commit, but i don't know if that did anything wrong either.
-- juha
----------------------------------------------------------------
From: Juha Heinanen jh@tutpro.com Sender: sr-dev-bounces@lists.sip-router.org To: sr-dev@lists.sip-router.org Subject: [sr-dev] git:kamailio_3.0: modules_k/nathelper: replaced offending contact alias character Date: Wed, 25 Aug 2010 21:54:37 +0200 (CEST)
Module: sip-router Branch: kamailio_3.0 Commit: ca75bb5d4a327a0da4b720956dec3438513f2303 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ca75bb5d...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@tutpro.com Date: Wed Aug 25 22:52:42 2010 +0300
modules_k/nathelper: replaced offending contact alias character - Changed character ':' in contact alias paramater value to '~', because ':' is not allowed in value field of generic contact parameter. - I first tried to cherry pick the commit for master, but it resulted in conflicts. So i went and edited k branch manually.
---
modules_k/nathelper/nathelper.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/modules_k/nathelper/nathelper.c b/modules_k/nathelper/nathelper.c index 5f73031..2113e32 100644 --- a/modules_k/nathelper/nathelper.c +++ b/modules_k/nathelper/nathelper.c @@ -1441,7 +1441,7 @@ add_contact_alias_f(struct sip_msg* msg, char* str1, char* str2) LM_ERR("you can't call alias_contact twice, check your config!\n"); return -1; } - param_len = SALIAS_LEN + IP6_MAX_STR_SIZE + 1 /* : */ + 5 /* port */ + + param_len = SALIAS_LEN + IP6_MAX_STR_SIZE + 1 /* ~ */ + 5 /* port */ + 1 /* t */ + 1 /* proto */; param = (char*)pkg_malloc(param_len); if (!param) { @@ -1457,7 +1457,7 @@ add_contact_alias_f(struct sip_msg* msg, char* str1, char* str2) return -1; } at = at + ip_len; - append_chr(at, ':'); + append_chr(at, '~'); port = int2str(msg->rcv.src_port, &len); append_str(at, port, len); append_chr(at, 't'); @@ -1500,7 +1500,8 @@ static int handle_ruri_alias_f(struct sip_msg* msg, char* str1, char* str2) { str uri, proto; - char buf[MAX_URI_SIZE], *val, *sep, *trans, *at, *next, *cur_uri, *rest; + char buf[MAX_URI_SIZE], *val, *sep, *trans, *at, *next, *cur_uri, *rest, + *col; unsigned int len, rest_len, val_len, alias_len, proto_type, cur_uri_len, ip_port_len;
@@ -1543,6 +1544,13 @@ handle_ruri_alias_f(struct sip_msg* msg, char* str1, char* str2) append_str(at, "sip:", 4); ip_port_len = sep - val; alias_len = SALIAS_LEN + ip_port_len + 2 /* tn */; + /* replace ~ with : */ + col = memchr(val, 126 /* ~ */, ip_port_len); + if (col == NULL) { + LM_ERR("no '~' in alias param value\n"); + return -1; + } + *(col) = ':'; memcpy(at, val, ip_port_len); at = at + ip_port_len; trans = sep + 1;
_______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
2010/8/26 Juha Heinanen jh@tutpro.com:
Jon Bonilla (Manwe) writes:
Could you please check this commit? All my nightly builds of kamailio_3.0 branch have failed while compiling the lcr module and this commit seems to be responsible of that :)
jon,
i don't know what has happened. i already asked about it on sr-dev list. my kamailio_3.0 commit (below) didn't involve lcr module. andrei did an lcr related commit, but i don't know if that did anything wrong either.
Hi Juha. For sure your commit is the responsible of this error (I mean the commit whose mail has started this mail thread).
This is your commit: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5da493e4...
Note that in the commit comment there also appears: ------------------- Conflicts: modules/lcr/lcr_mod.c ------------------
And inspecting the diff or the resulting modules/lcr/lcr_mod.c it's clear that your commit included a git conflict. See line 1698 in http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules/l...
Regards.