Module: sip-router
Branch: master
Commit: 18939df87a249a3a5bf17f7c00c6498b0ad75ceb
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=18939df…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: Sun Oct 12 20:09:52 2014 +0200
test/unit - update README with dependency on sipp
---
test/unit/README | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/unit/README b/test/unit/README
index 85c5776..f09ede2 100644
--- a/test/unit/README
+++ b/test/unit/README
@@ -15,6 +15,11 @@ This tests should (in the current state) only run by developers who know
what they do. They could delete your database, produce core dumps that fill
your harddisk or do other nasty things..
+Dependencies
+------------
+- SIPP (sipp.sourceforge.net) is required by some tests.
+
+
Usage
-----
while doing pua module tests in db_mode=2, i used pua_mi to send two
publish requests. in both of them id and etag params had value '.'.
first generated publish request without sip-if-match header (as it
should) and after 200 ok was received, record was properly inserted to
pua table with etag value a.1413029856.5521.112.0 and empty pres_id.
the second for a different pres_uri however resulted in error in
presence server:
Oct 12 10:06:42 siika /usr/bin/pres-serv[5522]: ERROR: presence [presentity.c:807]: update_presentity(): No E_Tag match a.1413029856.5521.112.0
after digging into it, i found with wireshark that the second publish
indeed included sip-if-match header with that etag value even when it
was initial publish (etag and id params '.') for another pres_uri.
then i took a look at pua source and found that if etag param is null it
is not included in db query at all leaving only pres_id param to match
against:
ua_pres_t *get_record_puadb(str pres_id, str *etag, ua_pres_t *result, db1_res_t **dbres)
{
int n_query_cols = 0, nr_rows;
...
q_cols[n_query_cols] = &str_pres_id_col;
q_vals[n_query_cols].type = DB1_STR;
q_vals[n_query_cols].nul = 0;
q_vals[n_query_cols].val.str_val = pres_id;
n_query_cols++;
if (etag != NULL)
{
q_cols[n_query_cols] = &str_etag_col;
q_vals[n_query_cols].type = DB1_STR;
q_vals[n_query_cols].nul = 0;
q_vals[n_query_cols].val.str_val.s = etag->s;
q_vals[n_query_cols].val.str_val.len = etag->len;
n_query_cols++;
}
...
if(query_fn(pua_db, q_cols, 0, q_vals,
NULL,n_query_cols,0,0,&res) < 0)
{
LM_ERR("DB query error\n");
return(NULL);
}
of course this kind of query matched the just inserted record for
another pres_uri, which is wrong.
how should this be fixed? is it enough to always add etag value to the
query or should also pres_uri be added just in case etags for different
pres_uris would match? or perhaps the best fix would be to skip the
query altogether in send_publish if etag is null?
has anyone else ever used pua module in db_mode=2?
-- juha
HI All,
According to Kamailio Devel Guide it is mentioned that pasrse_msg()
fucntion returns 0 if it it parses the sip message finely and >0 if error
occurs.
I pass a anonymous packet to this function (packet which is not sip packet)
then it should return >0 value but the function crashes.
Here is gdb back trace:
#0 0x00000033d8c81261 in strnlen () from /lib64/libc.so.6
#1 0x00000033d8c4526e in vfprintf () from /lib64/libc.so.6
#2 0x00000033d8ce4dd0 in __vsyslog_chk () from /lib64/libc.so.6
#3 0x00000033d8ce5000 in syslog () from /lib64/libc.so.6
#4 0x0000000000624830 in parse_msg (
buf=0x7f93e0bd8d68
"\373kÇ?V\020r\300m\221\217/\r\n\362\315\354\027\227k\366\200\251\252\367\036\336mã³¹\036\237\361\200\071\200Z\352\315\026\312\060\260`P\277\020\243ɬf;\273EV\"P\262",
<incomplete sequence \366>, len=723, msg=0x7fff7af2c190) at
parser/msg_parser.c:704
Thanks and Regards
Varun