Module: sip-router
Branch: master
Commit: b00b771318bf0cc379649ad535b48970c5cf37a0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b00b771…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 22 17:08:12 2009 +0200
libkcore: moved core stats and mi stats to kex module
- core specific implementation for statistics api moved to kex module
- initialization of statistics collector is done while adding a
new statistic if not done before
- destroying the stats collector is done in mod_destroy from kex module
---
lib/kcore/core_stats.c | 71 ----------------
lib/kcore/core_stats.h | 79 ------------------
lib/kcore/statistics.c | 214 +++++-------------------------------------------
lib/kcore/statistics.h | 84 ++++++-------------
4 files changed, 46 insertions(+), 402 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b00…
Module: sip-router
Branch: master
Commit: a99baf2b9aad42d01b2bdef0dca8365d7b31c627
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a99baf2…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed Apr 22 14:59:59 2009 +0200
fix parameter name and doxygen comments for the description AVP
---
modules/carrierroute/cr_func.c | 24 ++++++++++++------------
modules/carrierroute/cr_func.h | 8 ++++----
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/modules/carrierroute/cr_func.c b/modules/carrierroute/cr_func.c
index 325c20b..6e69ad2 100644
--- a/modules/carrierroute/cr_func.c
+++ b/modules/carrierroute/cr_func.c
@@ -351,13 +351,13 @@ static int actually_rewrite(const struct route_rule *rs, str *dest,
* @param user the localpart of the uri to be rewritten
* @param hash_source the SIP header used for hashing
* @param alg the algorithm used for hashing
- * @param dstavp the name of the destination AVP where the used host name is stored
+ * @param descavp the name of the AVP where the description is stored
*
* @return 0 on success, -1 on failure, 1 on empty rule list
*/
static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest,
struct sip_msg * msg, const str * user, const enum hash_source hash_source,
- const enum hash_algorithm alg, gparam_t *dstavp) {
+ const enum hash_algorithm alg, gparam_t *descavp) {
struct route_flags * rf;
struct route_rule * rr;
int prob;
@@ -426,7 +426,7 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
LM_ERR("invalid hash algorithm\n");
return -1;
}
- return actually_rewrite(rr, dest, msg, user, dstavp);
+ return actually_rewrite(rr, dest, msg, user, descavp);
}
@@ -443,14 +443,14 @@ static int rewrite_on_rule(struct route_flags *rf_head, flag_t flags, str * dest
* @param user the localpart of the uri to be rewritten
* @param hash_source the SIP header used for hashing
* @param alg the algorithm used for hashing
- * @param dstavp the name of the destination AVP where the used host name is stored
+ * @param descavp the name of the AVP where the description is stored
*
* @return 0 on success, -1 on failure, 1 on no more matching child node and no rule list
*/
static int rewrite_uri_recursor(struct dtrie_node_t * node,
const str * pm, flag_t flags, str * dest, struct sip_msg * msg, const str * user,
const enum hash_source hash_source, const enum hash_algorithm alg,
- gparam_t *dstavp) {
+ gparam_t *descavp) {
str re_pm = *pm;
void **ret;
@@ -465,7 +465,7 @@ static int rewrite_uri_recursor(struct dtrie_node_t * node,
LM_INFO("URI or prefix tree nodes empty, empty rule list\n");
return 1;
}
- else return rewrite_on_rule(*ret, flags, dest, msg, user, hash_source, alg, dstavp);
+ else return rewrite_on_rule(*ret, flags, dest, msg, user, hash_source, alg, descavp);
}
@@ -633,17 +633,17 @@ int cr_load_user_carrier(struct sip_msg * _msg, gparam_t *_user, gparam_t *_doma
* @param _prefix_matching the user to be used for prefix matching
* @param _rewrite_user the localpart of the URI to be rewritten
* @param _hsrc the SIP header used for hashing
- * @param _dstavp the name of the destination AVP where the used host name is stored
+ * @param _descavp the name of the AVP where the description is stored
*
* @return 1 on success, -1 on failure
*/
int cr_route(struct sip_msg * _msg, gparam_t *_carrier,
gparam_t *_domain, gparam_t *_prefix_matching,
gparam_t *_rewrite_user, enum hash_source _hsrc,
- gparam_t *_dstavp)
+ gparam_t *_descavp)
{
return cr_do_route(_msg, _carrier, _domain, _prefix_matching,
- _rewrite_user, _hsrc, alg_crc32, _dstavp);
+ _rewrite_user, _hsrc, alg_crc32, _descavp);
}
@@ -657,17 +657,17 @@ int cr_route(struct sip_msg * _msg, gparam_t *_carrier,
* @param _prefix_matching the user to be used for prefix matching
* @param _rewrite_user the localpart of the URI to be rewritten
* @param _hsrc the SIP header used for hashing
- * @param _dstavp the name of the destination AVP where the used host name is stored
+ * @param _descavp the name of the AVP where the description is stored
*
* @return 1 on success, -1 on failure
*/
int cr_prime_route(struct sip_msg * _msg, gparam_t *_carrier,
gparam_t *_domain, gparam_t *_prefix_matching,
gparam_t *_rewrite_user, enum hash_source _hsrc,
- gparam_t *_dstavp)
+ gparam_t *_descavp)
{
return cr_do_route(_msg, _carrier, _domain, _prefix_matching,
- _rewrite_user, _hsrc, alg_prime, _dstavp);
+ _rewrite_user, _hsrc, alg_prime, _descavp);
}
diff --git a/modules/carrierroute/cr_func.h b/modules/carrierroute/cr_func.h
index 79ec230..226adfc 100644
--- a/modules/carrierroute/cr_func.h
+++ b/modules/carrierroute/cr_func.h
@@ -61,14 +61,14 @@ int cr_load_user_carrier(struct sip_msg * _msg, gparam_t *_user,
* @param _prefix_matching the user to be used for prefix matching
* @param _rewrite_user the localpart of the URI to be rewritten
* @param _hsrc the SIP header used for hashing
- * @param _dstavp the name of the destination AVP where the used host name is stored
+ * @param _descavp the name of the AVP where the description is stored
*
* @return 1 on success, -1 on failure
*/
int cr_route(struct sip_msg * _msg, gparam_t *_carrier,
gparam_t *_domain, gparam_t *_prefix_matching,
gparam_t *_rewrite_user, enum hash_source _hsrc,
- gparam_t *_dstavp);
+ gparam_t *_descavp);
/**
@@ -81,14 +81,14 @@ int cr_route(struct sip_msg * _msg, gparam_t *_carrier,
* @param _prefix_matching the user to be used for prefix matching
* @param _rewrite_user the localpart of the URI to be rewritten
* @param _hsrc the SIP header used for hashing
- * @param _dstavp the name of the destination AVP where the used host name is stored
+ * @param _descavp the name of the AVP where the description is stored
*
* @return 1 on success, -1 on failure
*/
int cr_prime_route(struct sip_msg * _msg, gparam_t *_carrier,
gparam_t *_domain, gparam_t *_prefix_matching,
gparam_t *_rewrite_user, enum hash_source _hsrc,
- gparam_t *_dstavp);
+ gparam_t *_descavp);
/**
Hi,
i'd like to use the PV $T_reply_code [1] to test my carrierroute configs. This
variable holds in k the numerical result code of the last reply. Is there any
equivalent available in the sr tm as well?
I read in the module README, there is something like 'status'. I've tried to
use this in the module, this obviously not work. Even assigning this to a
temporary AVP does not work.
Apr 22 11:08:00 ca ser: BUG: <core> [cfg.y:2798]: parse error in config file,
line 41, column 19: syntax error
Apr 22 11:08:00 ca ser: BUG: <core> [cfg.y:2798]: parse error in config file,
line 41, column 19: invalid operator, == , != or =~ expected
Is there any other variable available (in sr tm) that holds something like
this?
Thanks,
Henning
[1]
http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:devel#t_reply_code
according to wiki page, sip-router has improved while and switch syntax,
but how about if condition syntax?
can i write, for example,
if (script_function() == 2) ...
of do i still need to do
script_function();
if ($retcode == 2) ...
by the way, i didn't quite understand the case example (first case
expression):
switch($var(x)){
case / "^[abc]" :
what is the meaning of /?
-- juha