Module: sip-router
Branch: treimann/acc-cdr
Commit: c021559e414892b9bafae0f1ce40081945fff49a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c021559…
Author: Timo Reimann <timo.reimann(a)1und1.de>
Committer: Timo Reimann <timo.reimann(a)1und1.de>
Date: Tue Aug 2 18:29:05 2011 +0200
modules_k/dialog: Add multiple features.
- Set and get dialog variables programmatically (needed in certain
cases where PV access does not suffice).
- Change dialog callback signature to pass both request and
response message instead of just the request. This is to enable
access to at least one type of message when the other is not
available; e.g., DLGCB_FAILED callbacks due to a local timeout
(408) do not provide requests but responses only.
Also, adapt callback usages accordingly at multiple spots.
- Provide additional callback DLGCB_TERMINATED_CONFIRMED that is
executed whenever the response to a BYE request is sent.
- Move unreference_dialog() to a more suitable location.
- Provide functions to add and remove a dialog from a transaction
(required for referencing at certain occassions).
- Move spiral detection functionality into dlg_new_dialog() to
faciliate spiral detection when dlg_manage() is used.
- Add a dialog's reference count to list of printable statistics.
Credits to Sven Knoblich, sven.knoblich(a)1und1.de .
---
modules_k/dialog/dialog.c | 4 +-
modules_k/dialog/dlg_cb.c | 18 +-
modules_k/dialog/dlg_cb.h | 19 ++-
modules_k/dialog/dlg_handlers.c | 429 ++++++++++++++++++++++++-------------
modules_k/dialog/dlg_hash.c | 21 ++-
modules_k/dialog/dlg_load.h | 2 +
modules_k/dialog/dlg_profile.c | 39 ++--
modules_k/dialog/dlg_profile.h | 6 +
modules_k/dialog/dlg_req_within.c | 2 +-
modules_k/dialog/dlg_var.c | 59 +++++-
modules_k/dialog/dlg_var.h | 2 +
11 files changed, 421 insertions(+), 180 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=c02…
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Timo Reimann (tr)
Attached to Project - sip-router
Summary - DLGCB_CONFIRMED triggered on 200/OK, not ACK
Task Type - Bug Report
Category - dialog
Status - Assigned
Assigned To - Timo Reimann
Operating System - All
Severity - Medium
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - As can be observed from dialog's documentation and the dialog state machine (in modules_k/dialog/dlg_hash.c), DLG_CONFIRMED is to be triggered on detection of a handshake-concluding ACK message, i.e., the finalization of the message triple INVITE/200/ACK. However, the callback is executed when the state transitions to DLG_STATE_CONFIRMED_NA (NA = No Ack; see dlg_handlers.c:dlg_onreply()) which is when the 200 has been received only.
There are two possible fixes:
- Move execution of DLGCB_CONFIRMED from dlg_onreply() to dlg_onroute(), not providing a callback anymore for when 200 is received.
- Rename DLGCB_CONFIRMED to DLGCB_CONFIRMED_NA and implement another callback DLGCB_CONFIRMED in dlg_onroute().
I favor the second approach as it does not remove an existing functionality (even if it's implemented erroneously from a logical point of view) and allows dialog callback users to run code at all (three) relevant moments during dialog establishment.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=143
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 411de126aa30dd67663b790df7aaa9b303189be5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=411de12…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Tue Jul 19 15:24:11 2011 +0200
modules_k/nathelper: Add is_rfc1918(ip_addr) function to test ip_addr for rfc1918addresses.
---
modules_k/nathelper/README | 46 ++++++++++++++++----------
modules_k/nathelper/doc/nathelper_admin.xml | 13 +++++++
modules_k/nathelper/nathelper.c | 18 ++++++++++
3 files changed, 59 insertions(+), 18 deletions(-)
diff --git a/modules_k/nathelper/README b/modules_k/nathelper/README
index a911951..7497492 100644
--- a/modules_k/nathelper/README
+++ b/modules_k/nathelper/README
@@ -64,8 +64,9 @@ Ovidiu Sas
5.4. add_rcv_param([flag]),
5.5. fix_nated_register()
5.6. nat_uac_test(flags)
- 5.7. add_contact_alias()
- 5.8. handle_ruri_alias()
+ 5.7. is_rfc1918(ip_address)
+ 5.8. add_contact_alias()
+ 5.9. handle_ruri_alias()
6. Exported Pseudo Variables
@@ -131,8 +132,9 @@ Chapter 1. Admin Guide
5.4. add_rcv_param([flag]),
5.5. fix_nated_register()
5.6. nat_uac_test(flags)
- 5.7. add_contact_alias()
- 5.8. handle_ruri_alias()
+ 5.7. is_rfc1918(ip_address)
+ 5.8. add_contact_alias()
+ 5.9. handle_ruri_alias()
6. Exported Pseudo Variables
@@ -235,7 +237,7 @@ modparam("nathelper", "natping_interval", 10)
4.2. ping_nated_only (integer)
- If this variable is set then only contacts that have “behind_NAT” flag
+ If this variable is set then only contacts that have "behind_NAT" flag
in user location database set will get ping.
Default value is 0.
@@ -310,7 +312,7 @@ modparam("nathelper", "sipping_bflag", 7)
feature, you have to set this parameter. The SIP request pinging will
be used only for requests marked so.
- Default value is “NULL”.
+ Default value is "NULL".
Example 1.7. Set sipping_from parameter
...
@@ -322,7 +324,7 @@ modparam("nathelper", "sipping_from", "sip:pinger@siphub.net")
The parameter sets the SIP method to be used in generating the SIP
requests for NAT ping purposes.
- Default value is “OPTIONS”.
+ Default value is "OPTIONS".
Example 1.8. Set sipping_method parameter
...
@@ -340,7 +342,7 @@ Note
The string must be a complete SDP line, including the EOH (\r\n).
- Default value is “a=nortpproxy:yes\r\n”.
+ Default value is "a=nortpproxy:yes\r\n".
Example 1.9. Set nortpproxy_str parameter
...
@@ -355,8 +357,9 @@ modparam("nathelper", "nortpproxy_str", "a=sdpmangled:yes\r\n")
5.4. add_rcv_param([flag]),
5.5. fix_nated_register()
5.6. nat_uac_test(flags)
- 5.7. add_contact_alias()
- 5.8. handle_ruri_alias()
+ 5.7. is_rfc1918(ip_address)
+ 5.8. add_contact_alias()
+ 5.9. handle_ruri_alias()
5.1. fix_nated_contact()
@@ -373,15 +376,15 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
5.2. fix_nated_sdp(flags [, ip_address])
Alters the SDP information in orer to facilitate NAT traversal. What
- changes to be performed may be controled via the “flags” parameter.
+ changes to be performed may be controled via the "flags" parameter.
Meaning of the parameters is as follows:
* flags - the value may be a bitwise OR of the following flags:
- + 0x01 - adds “a=direction:active” SDP line;
+ + 0x01 - adds "a=direction:active" SDP line;
+ 0x02 - rewrite media IP address (c=) with source address of
the message or the provided IP address (the provide IP address
take precedence over the source address).
- + 0x04 - adds “a=nortpproxy:yes” SDP line;
+ + 0x04 - adds "a=nortpproxy:yes" SDP line;
+ 0x08 - rewrite IP from origin description (o=) with source
address of the message or the provided IP address (the provide
IP address take precedence over the source address).
@@ -476,7 +479,14 @@ fix_nated_register();
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
FAILURE_ROUTE, BRANCH_ROUTE.
-5.7. add_contact_alias()
+5.7. is_rfc1918(ip_address)
+
+ Determines if the address in the parameter is an rfc1918 address. The
+ parameter allows pseudo-variables usage.
+
+ This function can be used from ANY_ROUTE.
+
+5.8. add_contact_alias()
Adds ;alias=ip:port parameter to contact URI containing received
ip:port if contact uri ip:port does not match received ip:port.
@@ -495,7 +505,7 @@ fix_nated_register();
};
...
-5.8. handle_ruri_alias()
+5.9. handle_ruri_alias()
Checks if Request URI has alias param and if so, removes it and sets
$du based on its value. Note that this means that routing of request is
@@ -576,16 +586,16 @@ $ kamctl fifo nh_enable_ping 1
Chapter 2. Frequently Asked Questions
- 2.1. What happend with “rtpproxy_disable” parameter?
+ 2.1. What happend with "rtpproxy_disable" parameter?
2.2. Where can I find more about Kamailio?
2.3. Where can I post a question about this module?
2.4. How can I report a bug?
2.1.
- What happend with “rtpproxy_disable” parameter?
+ What happend with "rtpproxy_disable" parameter?
- It was removed as it became obsolete - now “rtpproxy_sock” can take
+ It was removed as it became obsolete - now "rtpproxy_sock" can take
empty value to disable the rtpproxy functionality.
2.2.
diff --git a/modules_k/nathelper/doc/nathelper_admin.xml b/modules_k/nathelper/doc/nathelper_admin.xml
index 4d7947b..f01a4c7 100644
--- a/modules_k/nathelper/doc/nathelper_admin.xml
+++ b/modules_k/nathelper/doc/nathelper_admin.xml
@@ -552,6 +552,19 @@ fix_nated_register();
<section>
<title>
+ <function>is_rfc1918(ip_address)</function>
+ </title>
+ <para>
+ Determines if the address in the parameter is an rfc1918 address.
+ The parameter allows pseudo-variables usage.
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ </section>
+
+ <section>
+ <title>
<function moreinfo="none">add_contact_alias()</function>
</title>
<para>
diff --git a/modules_k/nathelper/nathelper.c b/modules_k/nathelper/nathelper.c
index bc3784a..ad9954f 100644
--- a/modules_k/nathelper/nathelper.c
+++ b/modules_k/nathelper/nathelper.c
@@ -289,6 +289,7 @@ static int handle_ruri_alias_f(struct sip_msg *, char *, char *);
static int pv_get_rr_count_f(struct sip_msg *, pv_param_t *, pv_value_t *);
static int pv_get_rr_top_count_f(struct sip_msg *, pv_param_t *, pv_value_t *);
static int fix_nated_sdp_f(struct sip_msg *, char *, char *);
+static int is_rfc1918_f(struct sip_msg *, char *, char *);
static int extract_mediaip(str *, str *, int *, char *);
static int alter_mediaip(struct sip_msg *, str *, str *, int, str *, int, int);
static int fix_nated_register_f(struct sip_msg *, char *, char *);
@@ -378,6 +379,9 @@ static cmd_export_t cmds[] = {
{"add_rcv_param", (cmd_function)add_rcv_param_f, 1,
fixup_uint_null, 0,
REQUEST_ROUTE },
+ {"is_rfc1918", (cmd_function)is_rfc1918_f, 1,
+ fixup_spve_null, 0,
+ ANY_ROUTE },
{0, 0, 0, 0, 0, 0}
};
@@ -1272,6 +1276,20 @@ nat_uac_test_f(struct sip_msg* msg, char* str1, char* str2)
}
+static int
+is_rfc1918_f(struct sip_msg* msg, char* str1, char* str2)
+{
+ str address;
+
+ if(fixup_get_svalue(msg, (gparam_p)str1, &address)!=0 || address.len==0)
+ {
+ LM_ERR("invalid address parameter\n");
+ return -2;
+ }
+
+ return (is1918addr(&address) == 1) ? 1 : -1;
+}
+
#define ADD_ADIRECTION 0x01
#define FIX_MEDIP 0x02
#define ADD_ANORTPPROXY 0x04
Module: sip-router
Branch: 3.1
Commit: 956e4c18955ea0d9ddd5c85d4d11a05452b6be32
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=956e4c1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat May 21 12:33:00 2011 +0200
core: added some binary operators
- not, xor, left shift and right shift
(cherry picked from commit 508ad1c0011352e6d24234dbef70a3f6abbdc276)
---
cfg.lex | 8 ++++++++
cfg.y | 9 ++++++++-
rvalue.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rvalue.h | 4 ++++
4 files changed, 76 insertions(+), 1 deletions(-)
diff --git a/cfg.lex b/cfg.lex
index 11822ea..3f677d3 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -297,6 +297,10 @@ LOG_AND "and"|"&&"
BIN_AND "&"
LOG_OR "or"|"||"
BIN_OR "|"
+BIN_NOT "~"
+BIN_XOR "^"
+BIN_LSHIFT "<<"
+BIN_RSHIFT ">>"
PLUS "+"
MINUS "-"
MODULO "mod"
@@ -927,6 +931,10 @@ SUBST subst
<INITIAL>{BIN_AND} { count(); return BIN_AND; }
<INITIAL>{LOG_OR} { count(); return LOG_OR; }
<INITIAL>{BIN_OR} { count(); return BIN_OR; }
+<INITIAL>{BIN_NOT} { count(); return BIN_NOT; }
+<INITIAL>{BIN_XOR} { count(); return BIN_XOR; }
+<INITIAL>{BIN_LSHIFT} { count(); return BIN_LSHIFT; }
+<INITIAL>{BIN_RSHIFT} { count(); return BIN_RSHIFT; }
<INITIAL>{PLUS} { count(); return PLUS; }
<INITIAL>{MINUS} { count(); return MINUS; }
<INITIAL>{MODULO} { count(); return MODULO; }
diff --git a/cfg.y b/cfg.y
index dee2e2d..d0bf748 100644
--- a/cfg.y
+++ b/cfg.y
@@ -564,11 +564,14 @@ extern char *finame;
%left LOG_AND
%left BIN_OR
%left BIN_AND
+%left BIN_XOR
+%left BIN_LSHIFT
+%left BIN_RSHIFT
%left EQUAL_T DIFF MATCH INTEQ INTDIFF STREQ STRDIFF
%left GT LT GTE LTE
%left PLUS MINUS
%left STAR SLASH MODULO
-%right NOT UNARY
+%right NOT UNARY BIN_NOT
%right DEFINED
%right INTCAST STRCAST
%left DOT
@@ -2733,6 +2736,7 @@ rval: intno {$$=mk_rve_rval(RV_INT, (void*)$1); }
rve_un_op: NOT { $$=RVE_LNOT_OP; }
+ | BIN_NOT { $$=RVE_BNOT_OP; }
| MINUS %prec UNARY { $$=RVE_UMINUS_OP; }
/* TODO: RVE_BOOL_OP, RVE_NOT_OP? */
;
@@ -2762,6 +2766,9 @@ rval_expr: rval { $$=$1;
| rval_expr MODULO rval_expr {$$=mk_rve2(RVE_MOD_OP, $1, $3); }
| rval_expr BIN_OR rval_expr {$$=mk_rve2(RVE_BOR_OP, $1, $3); }
| rval_expr BIN_AND rval_expr {$$=mk_rve2(RVE_BAND_OP, $1, $3);}
+ | rval_expr BIN_XOR rval_expr {$$=mk_rve2(RVE_BXOR_OP, $1, $3);}
+ | rval_expr BIN_LSHIFT rval_expr {$$=mk_rve2(RVE_BLSHIFT_OP, $1, $3);}
+ | rval_expr BIN_RSHIFT rval_expr {$$=mk_rve2(RVE_BRSHIFT_OP, $1, $3);}
| rval_expr rve_cmpop rval_expr %prec GT { $$=mk_rve2( $2, $1, $3);}
| rval_expr rve_equalop rval_expr %prec EQUAL_T
{ $$=mk_rve2( $2, $1, $3);}
diff --git a/rvalue.c b/rvalue.c
index 9195972..ea861e6 100644
--- a/rvalue.c
+++ b/rvalue.c
@@ -501,12 +501,16 @@ enum rval_type rve_guess_type( struct rval_expr* rve)
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_MINUS_OP:
case RVE_MUL_OP:
case RVE_DIV_OP:
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -565,6 +569,7 @@ int rve_is_constant(struct rval_expr* rve)
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -577,6 +582,9 @@ int rve_is_constant(struct rval_expr* rve)
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -625,6 +633,7 @@ static int rve_op_unary(enum rval_expr_op op)
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -637,6 +646,9 @@ static int rve_op_unary(enum rval_expr_op op)
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -689,6 +701,7 @@ int rve_check_type(enum rval_type* type, struct rval_expr* rve,
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
*type=RV_INT;
if (rve_check_type(&type1, rve->left.rve, bad_rve, bad_t, exp_t)){
if (type1==RV_STR){
@@ -707,6 +720,9 @@ int rve_check_type(enum rval_type* type, struct rval_expr* rve,
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -1326,6 +1342,9 @@ inline static int int_intop1(int* res, enum rval_expr_op op, int v)
case RVE_LNOT_OP:
*res=!v;
break;
+ case RVE_BNOT_OP:
+ *res=~v;
+ break;
default:
BUG("rv unsupported intop1 %d\n", op);
return -1;
@@ -1371,6 +1390,15 @@ inline static int int_intop2(int* res, enum rval_expr_op op, int v1, int v2)
case RVE_BAND_OP:
*res=v1&v2;
break;
+ case RVE_BXOR_OP:
+ *res=v1^v2;
+ break;
+ case RVE_BLSHIFT_OP:
+ *res=v1<<v2;
+ break;
+ case RVE_BRSHIFT_OP:
+ *res=v1>>v2;
+ break;
case RVE_LAND_OP:
*res=v1 && v2;
break;
@@ -1870,6 +1898,7 @@ int rval_expr_eval_int( struct run_act_ctx* h, struct sip_msg* msg,
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
if (unlikely(
(ret=rval_expr_eval_int(h, msg, &i1, rve->left.rve)) <0) )
break;
@@ -1886,6 +1915,9 @@ int rval_expr_eval_int( struct run_act_ctx* h, struct sip_msg* msg,
case RVE_IPLUS_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_GT_OP:
case RVE_GTE_OP:
case RVE_LT_OP:
@@ -2154,12 +2186,16 @@ int rval_expr_eval_rvint( struct run_act_ctx* h,
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_MINUS_OP:
case RVE_MUL_OP:
case RVE_DIV_OP:
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -2273,12 +2309,16 @@ struct rvalue* rval_expr_eval(struct run_act_ctx* h, struct sip_msg* msg,
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_MINUS_OP:
case RVE_MUL_OP:
case RVE_DIV_OP:
case RVE_MOD_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -2531,6 +2571,7 @@ struct rval_expr* mk_rval_expr1(enum rval_expr_op op, struct rval_expr* rve1,
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -2573,6 +2614,9 @@ struct rval_expr* mk_rval_expr2(enum rval_expr_op op, struct rval_expr* rve1,
case RVE_MINUS_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
@@ -2616,6 +2660,7 @@ static int rve_op_is_assoc(enum rval_expr_op op)
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -2626,6 +2671,8 @@ static int rve_op_is_assoc(enum rval_expr_op op)
case RVE_DIV_OP:
case RVE_MOD_OP:
case RVE_MINUS_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
return 0;
case RVE_PLUS_OP:
/* the generic plus is not assoc, e.g.
@@ -2636,6 +2683,7 @@ static int rve_op_is_assoc(enum rval_expr_op op)
case RVE_MUL_OP:
case RVE_BAND_OP:
case RVE_BOR_OP:
+ case RVE_BXOR_OP:
return 1;
case RVE_LAND_OP:
case RVE_LOR_OP:
@@ -2667,6 +2715,7 @@ static int rve_op_is_commutative(enum rval_expr_op op)
case RVE_UMINUS_OP:
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -2677,6 +2726,8 @@ static int rve_op_is_commutative(enum rval_expr_op op)
case RVE_DIV_OP:
case RVE_MOD_OP:
case RVE_MINUS_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
return 0;
case RVE_PLUS_OP:
/* non commut. when diff. type
@@ -2687,6 +2738,7 @@ static int rve_op_is_commutative(enum rval_expr_op op)
case RVE_MUL_OP:
case RVE_BAND_OP:
case RVE_BOR_OP:
+ case RVE_BXOR_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_IEQ_OP:
@@ -3712,6 +3764,7 @@ int fix_rval_expr(void* p)
case RVE_UMINUS_OP: /* unary operators */
case RVE_BOOL_OP:
case RVE_LNOT_OP:
+ case RVE_BNOT_OP:
case RVE_STRLEN_OP:
case RVE_STREMPTY_OP:
case RVE_DEFINED_OP:
@@ -3726,6 +3779,9 @@ int fix_rval_expr(void* p)
case RVE_MINUS_OP:
case RVE_BOR_OP:
case RVE_BAND_OP:
+ case RVE_BXOR_OP:
+ case RVE_BLSHIFT_OP:
+ case RVE_BRSHIFT_OP:
case RVE_LAND_OP:
case RVE_LOR_OP:
case RVE_GT_OP:
diff --git a/rvalue.h b/rvalue.h
index 8e67c2e..cc9085c 100644
--- a/rvalue.h
+++ b/rvalue.h
@@ -53,12 +53,16 @@ enum rval_expr_op{
RVE_UMINUS_OP, /* one member expression, returns -(val) */
RVE_BOOL_OP, /* one member evaluate as bool. : (val!=0)*/
RVE_LNOT_OP, /* one member evaluate as bool. : (!val)*/
+ RVE_BNOT_OP, /* one member evaluate as binary : (~ val)*/
RVE_MUL_OP, /* 2 members, returns left * right */
RVE_DIV_OP, /* 2 members, returns left / right */
RVE_MOD_OP, /* 2 members, returns left % right */
RVE_MINUS_OP, /* 2 members, returns left - right */
RVE_BAND_OP, /* 2 members, returns left | right */
RVE_BOR_OP, /* 2 members, returns left & right */
+ RVE_BXOR_OP, /* 2 members, returns left XOR right */
+ RVE_BLSHIFT_OP, /* 2 members, returns left << right */
+ RVE_BRSHIFT_OP, /* 2 members, returns left >> right */
RVE_LAND_OP, /* 2 members, returns left && right */
RVE_LOR_OP, /* 2 members, returns left || right */
RVE_GT_OP, /* 2 members, returns left > right */
Module: sip-router
Branch: tma0/iptrtpproxy-v2
Commit: a0fdc9b781cf8d7368a5a67912929f612a8e9c33
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a0fdc9b…
Author: Tomas Mandys <tomas.mandys(a)iptel.org>
Committer: Tomas Mandys <tomas.mandys(a)iptel.org>
Date: Tue Aug 2 23:42:24 2011 +0200
- do not apply NAT contact fix of UAS when not usrloc forwarded
---
etc/sip-router-oob.cfg | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/etc/sip-router-oob.cfg b/etc/sip-router-oob.cfg
index 3c7d694..0521dc6 100644
--- a/etc/sip-router-oob.cfg
+++ b/etc/sip-router-oob.cfg
@@ -359,7 +359,9 @@ flags
FLAG_NAT_REG : 14, # the UAC behind NAT, stored in location record
FLAG_INIT_DLG : 15, # init INVITE dialog
FLAG_REVERSE_DIR : 16, # set if request goes callee -> caller direction, requires rr.append_fromtag=1
- FLAG_ACC_MISSED : 17; # the missed call will be recorded by ACC
+ FLAG_ACC_MISSED : 17, # the missed call will be recorded by ACC
+ FLAG_USRLOC_FWD : 18, # usrloc based forward
+ FLAG_NEXT_ROUTE : 19; # there is a route remaining
avpflags
dialog_cookie; # attribute will be stored in Route headers
@@ -853,6 +855,19 @@ route[UAS_NAT_DETECTION]
break;
}
+ # prevent contact overwriting when a proxy between ser and UAS.
+ # We get it from record-route but it's rather difficult or
+ # do it only for UAS which is registered in usrloc database and has no
+ # proxy on path.
+ # Note: destination forced by $fwd_always_target is not NAT detected and contact left untouched!
+ if (isflagset(FLAG_INIT_DLG) && !isflagset(FLAG_USRLOC_FWD)) {
+ break;
+ }
+ # for in-dialog requests we get it easily because it provides loose_route()
+ if (!isflagset(FLAG_INIT_DLG) && isflagset(FLAG_NEXT_ROUTE)) {
+ break;
+ }
+
# Prevent that we over-write the Contact with the IP of our proxy when
# the reply loops through ourself.
if (src_ip == myself) {
@@ -931,6 +946,9 @@ route[PROCESS_ROUTES]
if (!defined $dialog_id) {
$dialog_id = $t.dialog_id; # there is only 1 dialog_id
}
+ if (@rr.next_route != "") {
+ setflag("FLAG_NEXT_ROUTE");
+ }
xlog("L_DEBUG", "\n%mb\n\ndialogid -/from/to=%$dialog_id/%$f.dialog_id/%$t.dialog_id");
if (method == "INVITE" || method == "UPDATE" || method == "ACK" || method == "BYE") {
if (!defined $dialog_id) {
Hello,
It seems as if the bitwise operations in Kamailio 3.1.4 are broken?
Please correct me if I am doing something wrong - however simple
evaluations such as:
$avp(s:my-test-bit) = 10;
$avp(s:my-test-bit) = (int)$avp(s:my-test-bit) & ~ 2;
Seems to result in $avp(s:my-test-bit) being equal to "2" rather than "8"
Any thoughts / Suggestions / Fixes?
I also wonder if this has any relation to !~ not working?
Thanks for all of your help in advance!
P.S. I sent this both to user list and to devel, please forgive me if they
do not belong in one of the lists.
Sincerely,
Brandon Armstead
Module: sip-router
Branch: master
Commit: 2a4163498e6122d8ec65aa083b829a4657714a34
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2a41634…
Author: pd <peter.dunkley(a)crocodile-rcs.com>
Committer: pd <peter.dunkley(a)crocodile-rcs.com>
Date: Tue Aug 2 14:22:16 2011 +0100
modules_k/rls: Fixed a couple of merge errors that crept in during the splitting RLS NOTIFY development
- Problem found by Paul Pankhurst and fixed by Andrew Miller
---
modules_k/rls/resource_notify.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules_k/rls/resource_notify.c b/modules_k/rls/resource_notify.c
index 7a88970..254cf74 100644
--- a/modules_k/rls/resource_notify.c
+++ b/modules_k/rls/resource_notify.c
@@ -249,6 +249,7 @@ void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, int aut
len_est = create_empty_rlmi_doc(&rlmi_doc, &list_node, &dialog->pres_uri, dialog->version, 0);
len_est += 2*strlen(boundary_string)+4+102+2+50+strlen(resource_uri)+20;
buf_len= 0;
+ resource_added = 0;
/* !!!! for now I will include the auth state without checking if
* it has changed - > in future chech if it works */
@@ -265,6 +266,7 @@ void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, int aut
}
xmlNewProp(resource_node, BAD_CAST "uri", BAD_CAST resource_uri);
len_est += strlen (resource_uri) + 35; /* <resource uri="[uri]"></resource>/r/n */
+ resource_added = 1;
/* there might be more records with the same uri- more instances-
* search and add them all */
@@ -406,7 +408,7 @@ void send_notifies(db1_res_t *result, int did_col, int resource_uri_col, int aut
if(rlmi_doc)
{
- LM_ERR("timer_send_notify at end len_est = %d resource_added = %d\n", len_est, resource_added);
+ LM_DBG("timer_send_notify at end len_est = %d resource_added = %d\n", len_est, resource_added);
if (resource_added == 1)
{
send_notify(&rlmi_doc, buf, buf_len, bstr, dialog, hash_code);