Module: sip-router
Branch: master
Commit: da3327522527211fcd76aba394de9f2f538d8b9d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=da33275…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Wed Oct 7 18:35:00 2009 +0200
unit test(sr): add initial small test for memcache module
---
test/unit/45.cfg | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
test/unit/45.sh | 50 +++++++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+), 0 deletions(-)
diff --git a/test/unit/45.cfg b/test/unit/45.cfg
new file mode 100644
index 0000000..e434654
--- /dev/null
+++ b/test/unit/45.cfg
@@ -0,0 +1,72 @@
+# Kamailio config for lookup / registrar testing
+
+#------------------------Global configuration----------------------------------
+debug=2
+fork=yes
+log_stderror=no
+listen=127.0.0.1
+port=5060
+dns=no
+rev_dns=no
+
+#-----------------------Loading Modules-------------------------------------
+mpath="../../modules_k/"
+loadmodule "../../modules/db_mysql/db_mysql.so"
+loadmodule "usrloc/usrloc.so"
+loadmodule "registrar/registrar.so"
+loadmodule "sl/sl.so"
+loadmodule "../../modules/tm/tm.so"
+loadmodule "maxfwd/maxfwd.so"
+loadmodule "pv/pv.so"
+loadmodule "cfgutils.so"
+loadmodule "memcached.so"
+#for debugging purposes only
+loadmodule "mi_fifo/mi_fifo.so"
+loadmodule "xlog/xlog.so"
+
+
+#-----------------------Module parameters-------------------------------------
+modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
+modparam("usrloc", "db_mode", 3)
+modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")
+
+#-----------------------Routing configuration---------------------------------#
+route{
+ if (!mf_process_maxfwd_header("10")) {
+ sl_send_reply("483","Too Many Hops");
+ exit();
+ }
+
+ $mct(test) = "1";
+ $mct(test) = 5;
+ xlog("stored value is $mct(test)");
+# not work at the moment?
+# $mct(test) = null;
+# xlog("stored value is $mct(test)");
+
+ $mct(cnt) = 1;
+ $mcinc(cnt) = 1; # increment by 1
+ xlog("counter is now $mct(cnt)");
+ $mcdec(cnt) = 1; # decrement by 1
+ xlog("counter is now $mct(cnt)");
+
+ $mct(test) = 111;
+ xlog("stored value is $mct(test)");
+ $mctex(test) = 1;
+# also not work at the moment?
+# sleep("2");
+ xlog("stored value is now $mct(test)");
+
+ if (registered("location")) {
+ xlog("contact registered");
+ }
+
+ if(!lookup ("location")){
+ sl_send_reply("404", "Not Found");
+ }
+
+ if (!t_relay()) {
+ sl_reply_error();
+ }
+}
+
diff --git a/test/unit/45.sh b/test/unit/45.sh
new file mode 100755
index 0000000..7b28c64
--- /dev/null
+++ b/test/unit/45.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# check memcached module with a basic usrloc scenario
+
+# Copyright (C) 2007 1&1 Internet AG
+#
+# This file is part of Kamailio, a free SIP server.
+#
+# Kamailio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version
+#
+# Kamailio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+source include/common
+source include/require
+source include/database
+
+if ! (check_sipp && check_kamailio && check_module "db_mysql" && check_mysql && check_module "memcached"); then
+ exit 0
+fi ;
+
+CFG=45.cfg
+SRV=5060
+UAS=5070
+UAC=5080
+
+
+# add an registrar entry to the db;
+$MYSQL "INSERT INTO location (username,contact,socket,user_agent,cseq,q) VALUES (\"foo\",\"sip:foo@localhost:$UAS\",\"udp:127.0.0.1:$UAS\",\"ser_test\",1,-1);"
+
+$BIN -w . -f $CFG &> /dev/null
+sipp -sn uas -bg -i localhost -m 10 -f 2 -p $UAS &> /dev/null
+sipp -sn uac -s foo 127.0.0.1:$SRV -i localhost -m 10 -f 2 -p $UAC &> /dev/null
+
+ret=$?
+
+# cleanup
+killall -9 sipp > /dev/null 2>&1
+$KILL > /dev/null 2>&1
+
+$MYSQL "DELETE FROM location WHERE ((contact = \"sip:foo@localhost:$UAS\") and (user_agent = \"ser_test\"));"
+exit $ret;
sip-router.org home page looks a bit odd, because there is nothing
on top of the page. if no logo is available, heading text SIP Router
Project of something like that using a big font would be fine.
-- juha
Hi all,
i'm happy to announce a new developer for the kamailio and sip-router project:
Marius Zbihlei.
Marius is a experienced C/C++ developer in our offices in Bukarest (Romania).
He develops since a few years internal applications for the web hosting
plattform of 1&1. Since app. a half year he is part of the team that handles
the development and maintenance of our VoIP backend systems. Most of his work
so far was targeted to our internal repositories, but Marius also already
contributed a bunch of patches to the project. He'll support us with the
maintenance of the kamailio code we contributed to the project in the past,
and also work on new sip-router features in the future.
Best regards,
Henning
--
Henning Westerholt - Development Consumer Products / Consumer Core
1&1 Internet AG, Ernst-Frey-Str. 9, 76135 Karlsruhe, Germany
Daniel once taught me in a mailing list post how to use AVP arrays
syntactically - i.e. to iterate through them and to implicitly create
them - for which I am very grateful. For example:
$var(i) = 0;
while($var(i) < $dbr(ra=>rows)) {
$(avp(s:rows_of_things)[$var(i)]) = $dbr(ra=>[$var(i),0]);
}
But I don't see anywhere in the documentation - for the avpops module or
otherwise - where someone else can learn to use them. They are not
mentioned explicitly anywhere as having potentially nonscalar properties.
I think it is a good idea to fix that.
--
Alex Balashov - Principal
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Revision: 5933
http://openser.svn.sourceforge.net/openser/?rev=5933&view=rev
Author: mariuszbihlei
Date: 2009-10-06 14:02:16 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
Changes to documentation of carrierroute module:
changed cr_route usage in example as it didn't matched the actual interface
by removing the crc32 parameter.
Modified Paths:
--------------
branches/1.5/modules/carrierroute/README
branches/1.5/modules/carrierroute/doc/carrierroute_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5932
http://openser.svn.sourceforge.net/openser/?rev=5932&view=rev
Author: mariuszbihlei
Date: 2009-10-06 14:00:57 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
Changes to documentation of carrierroute module:
changed cr_route usage in example as it didn't matched the actual interface
by removing the crc32 parameter.
Modified Paths:
--------------
branches/1.4/modules/carrierroute/README
branches/1.4/modules/carrierroute/doc/carrierroute_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5931
http://openser.svn.sourceforge.net/openser/?rev=5931&view=rev
Author: mariuszbihlei
Date: 2009-10-06 13:54:25 +0000 (Tue, 06 Oct 2009)
Log Message:
-----------
Changes to documentation of carrierroute module:
changed cr_route usage in example as it didn't matched the actual interface
by removing the crc32 parameter.
Modified Paths:
--------------
trunk/modules/carrierroute/README
trunk/modules/carrierroute/doc/carrierroute_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Hi all,
i get now a segfault in cfg_update[_local] for kamailio modules during my
tests. It doesn't matter if the server start successfully, it even crashs when
the server stops the start during some cfg file problems.
I remember that Miklos changes in the last week something in the cfg
framework, perhaps its related to this? The cfg in question does nothing
special, it just try to loads a bunch of kamailio modules, but as i said, it
crashes for every configuration i've tried so far.
Backtrace:
Core was generated by `../../ser -w . -f 2.cfg'.
Program terminated with signal 11, Segmentation fault.
[New process 16270]
#0 cfg_update_local () at cfg/cfg_struct.h:255
255 cfg_child_cb = cfg_child_cb->next;
(gdb) bt
#0 cfg_update_local () at cfg/cfg_struct.h:255
#1 0x0809c050 in sig_usr (signo=15) at main.c:782
#2 <signal handler called>
#3 0xb7fd742e in __kernel_vsyscall ()
#4 0xb7f11e03 in __read_nocancel () from /lib/tls/i686/cmov/libc.so.6
#5 0xb7ea8f4e in _IO_new_file_underflow (fp=0x98e98e0) at fileops.c:598
#6 0xb7eaacab in _IO_default_uflow (fp=0x98e98e0) at genops.c:440
#7 0xb7eac262 in *__GI___uflow (fp=0x98e98e0) at genops.c:394
#8 0xb7e9ea36 in _IO_getline_info (fp=0x98e98e0, buf=0x82b40b4 "�\003",
n=1023, delim=10, extract_delim=1, eof=0x0) at iogetline.c:74
#9 0xb7e9e981 in _IO_getline (fp=0x98e98e0, buf=0x82b40b4 "�\003", n=1023,
delim=10, extract_delim=1) at iogetline.c:42
#10 0xb7e9d86a in _IO_fgets (buf=0x82b40b4 "�\003", n=1024, fp=0x98e98e0) at
iofgets.c:58
#11 0xb7c4769f in mi_read_line (b=0x82b40b4 "�\003", max=1024,
stream=0x98e98e0, read=0xbfef22f8) at /usr/include/bits/stdio2.h:255
#12 0xb7c48957 in mi_fifo_server (fifo_stream=0x98e98e0) at fifo_fnc.c:415
#13 0xb7c4ad48 in fifo_process (rank=1) at mi_fifo.c:235
#14 0xb7c4afbd in mi_child_init (rank=0) at mi_fifo.c:199
#15 0x081099e7 in init_mod_child (m=0x82ac28c, rank=0) at sr_module.c:808
#16 0x08109970 in init_mod_child (m=0x82ac3dc, rank=0) at sr_module.c:785
#17 0x08109970 in init_mod_child (m=0x82ac528, rank=0) at sr_module.c:785
#18 0x08109970 in init_mod_child (m=0x82ac680, rank=0) at sr_module.c:785
#19 0x08109970 in init_mod_child (m=0x82ac7c8, rank=0) at sr_module.c:785
#20 0x08109970 in init_mod_child (m=0x82ac910, rank=0) at sr_module.c:785
#21 0x08109970 in init_mod_child (m=0x82aca68, rank=0) at sr_module.c:785
#22 0x08109970 in init_mod_child (m=0x82acbac, rank=0) at sr_module.c:785
#23 0x08109970 in init_mod_child (m=0x82acd00, rank=0) at sr_module.c:785
#24 0x08109970 in init_mod_child (m=0x82ace44, rank=0) at sr_module.c:785
#25 0x08109970 in init_mod_child (m=0x82acf88, rank=0) at sr_module.c:785
#26 0x08109970 in init_mod_child (m=0x82ad0e0, rank=0) at sr_module.c:785
#27 0x08109970 in init_mod_child (m=0x82ad2dc, rank=0) at sr_module.c:785
#28 0x08109970 in init_mod_child (m=0x82ad3d0, rank=0) at sr_module.c:785
#29 0x08109970 in init_mod_child (m=0x82ad570, rank=0) at sr_module.c:785
#30 0x08109970 in init_mod_child (m=0x82ad6c0, rank=0) at sr_module.c:785
#31 0x08109970 in init_mod_child (m=0x82ad810, rank=0) at sr_module.c:785
#32 0x08109970 in init_mod_child (m=0x82ad974, rank=0) at sr_module.c:785
#33 0x08109970 in init_mod_child (m=0x82adb28, rank=0) at sr_module.c:785
#34 0x08109970 in init_mod_child (m=0x82adc84, rank=0) at sr_module.c:785
#35 0x08109970 in init_mod_child (m=0x82adf6c, rank=0) at sr_module.c:785
#36 0x08109970 in init_mod_child (m=0x82b0564, rank=0) at sr_module.c:785
#37 0x08109970 in init_mod_child (m=0x82b0658, rank=0) at sr_module.c:785
#38 0x08109970 in init_mod_child (m=0x82b07fc, rank=0) at sr_module.c:785
#39 0x08109970 in init_mod_child (m=0x82b2398, rank=0) at sr_module.c:785
#40 0x0809b6bd in main_loop () at main.c:1504
#41 0x0809e10d in main (argc=5, argv=0xbfef2bf4) at main.c:2228
(gdb) p cfg_child_cb
$1 = (cfg_child_cb_t *) 0x0
(gdb) l
250 if (unlikely(cfg_child_cb==CFG_NO_CHILD_CBS))
251 return;
252 /* call the per-process callbacks */
253 while (cfg_child_cb != last_cb) {
254 prev_cb = cfg_child_cb;
255 cfg_child_cb = cfg_child_cb->next;
256 atomic_inc(&cfg_child_cb->refcnt);
257 if (atomic_dec_and_test(&prev_cb->refcnt)) {
258 /* No more pocess refers to this callback.
259 Did this process block the deletion,
Regards,
Henning