Re: [SR-Users] tls-modules in 3.2.0

2011-11-15 Thread Daniel-Constantin Mierla
good catch, I even copypaste the path to module, but didn't flash in my 
eye.


Cheers,
Daniel

On 11/15/11 8:38 AM, Klaus Darilion wrote:

Your module path is wrong. Take a look at the error message:

  /usr/local/lib/..

Debian packages install the libraries in /usr/lib/kamailio/.

I guess you did a manual installation before and thuse the path is wrong.

regards
Klaus

On 15.11.2011 01:59, Mokhtar Bengana wrote:

Hello,

I am trying to install the tls module in 3.2.0. I run apt-get update
before apt-get install kamailio-tls-modules and still can't load the
tls module and getting the following error. Kamailio can't find the
tls module even though it's installed? I didn't get any errors when I
run apt-get install kamailio-tls-modules. Everything else is defined
in the config file. Has someone tried to install tls in the latest
release and is having issues? Any help much appreciated.

#!define WITH_TLS

#!ifdef WITH_TLS
enable_tls=yes
#!endif

#!ifdef WITH_TLS
loadmodule tls.so
#!endif

#!ifdef WITH_TLS
# - tls params -
modparam(tls, config, /etc/kamailio/tls.cfg)
#!endif

root@Kamalio:/usr/local/lib/kamailio/modules_k# kamailio -c
loading modules under
/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
  0(12131) ERROR:core  [sr_module.c:553]: ERROR: load_module: could
not find moduletls  in
/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
  0(12131) :core  [cfg.y:3501]: parse error in config file
/usr/local/etc/kamailio/kamailio.cfg, line 268, column 12-19: failed
to load module
  0(12131) ERROR:core  [modparam.c:162]: set_mod_param_regex: No
module matchingtls  found
  0(12131) :core  [cfg.y:3504]: parse error in config file
/usr/local/etc/kamailio/kamailio.cfg, line 422, column 50: Can't set
module parameter
ERROR: bad config file (2 errors)
root@Kamalio:/usr/local/lib/kamailio/modules_k#


root@Kamalio:/usr/local/lib/kamailio/modules_k# apt-get install
kamailio-tls-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
   kamailio-tls-modules
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/399 kB of archives.
After this operation, 848 kB of additional disk space will be used.
Selecting previously deselected package kamailio-tls-modules.
(Reading database ... 30034 files and directories currently installed.)
Unpacking kamailio-tls-modules (from
.../kamailio-tls-modules_3.2.0+squeeze1_i386.deb) ...
Setting up kamailio-tls-modules (3.2.0+squeeze1) ...

Thank you,

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

On 11/14/11 3:24 PM, Javier Gallart wrote:

Hello

very interesting issue actually...the mtree module fits perfectly well 
in a key-value model becaue basically is what the mtree table 
structure defines; that's why redis was the first thing that came to 
my mind when I saw the redis module. Two problems with redis:

-no native mt_match function, up to the user to find the best option
-replication. Until the cluster feature is ready, we need to change by 
hand the server ip address, which implies a kamailio restart. There is 
no mi command for changing the server in the fly, right..(not in the 
module documentation at least)?
you cannot change the redis server attributes on the fly, but you can 
define many redis servers and based on the name attribute query a 
specific one. So if you define two, you can do round robin queries to 
both of them, by using a shared variable $shv(...) to know which one was 
used last time. In the same way, since $sht(...) can be changed via MI, 
you can query either first redis or second one, based on the value of 
$sht(). In this way you can build some failover solution just in config 
file of kamailio.


Cheers,
Daniel



Daniel, I agree that your suggestion about the mi/rpc method would be 
nice. I will also take a look at Mongo as Douglas suggests, and 
especially CouchDB, because you can talk to Couch DB via http...


Regards

Javi

On Mon, Nov 14, 2011 at 1:32 PM, Douglas Hubler doug...@hubler.us 
mailto:doug...@hubler.us wrote:


On Mon, Nov 14, 2011 at 5:10 AM, Daniel-Constantin Mierla
mico...@gmail.com mailto:mico...@gmail.com wrote:
 are there any other no-sql database systems that have such
mechanism? Might
 not be hard to make a connector when the time will allow -- just
to know the
 best options here.

mongodb will auto promote.  Caveat, (like redis if i understand
correctly), is that all writes are directed to a single master (be it
chosen dynamically), but reads can happen anywhere to spread the load.
 Also, you need to accept the distaster scenario of a network
partition  where a minority set of servers find themselves w/o a
master.  Example: 5 servers in datacenter #1 and 4 servers in
datacenter #2.  If the link between datacenters is broken, then all
servers in datacenter #2 will not have a master and will be read-only
until link is restored.  Good part about single master is there's no
chance of inconsistent data.

Turns out local fail-over v.s. consistent data is a well explored
area.

http://blog.nahurst.com/visual-guide-to-nosql-systems

I've worked w/the C++ driver to mongodb is anyone has questions.




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] strange behavior when trying to reach PSTN gateway via TCP

2011-11-15 Thread Dmitry Petrakoff
Hi List!

I'm running Kamailio for about 1 year without any serious problems.
When it works with UDP only, it runs perfectly well for us. Without any
major issues.

But now we have a customer who wants to connect Lync to our network.
Unfortunately, Lync does not support UDP for SIP signalling, so we tried
to teach kamailio to send SIP messages via TCP.
And getting  strange error:

10(36629) DEBUG: tm [t_reply.c:659]: DEBUG: reply sent out.
buf=0x832c7ac: SIP/2.0 100 trying -..., shmem=0x28d97c7c: SIP/2.0 100
trying -
10(36629) DEBUG: tm [t_reply.c:669]: DEBUG: _reply_light: finished
10(36629) DEBUG: core [forward.c:213]: DEBUG: get_out_socket: socket
determined: 0x833ddc0
10(36629) DEBUG: core [msg_translator.c:457]: clen_builder:
content-length: 553 (553)
10(36629) DEBUG: core [msg_translator.c:204]:
check_via_address(10.200.245.200, 10.200.245.200, 0)
10(36629) DEBUG: core [tcp_main.c:1824]: tcp_send: no open tcp
connection found, opening new one
10(36629) DEBUG: core [ip_addr.c:247]: tcpconn_new: new tcp
connection: 10.198.3.100
10(36629) DEBUG: core [tcp_main.c:1081]: tcpconn_new: on port 5060, type 2
10(36629) DEBUG: core [tcp_main.c:1382]: tcpconn_add: hashes: 0:0:0, 1
10(36629) ERROR: core [tcp_main.c:2748]: connect 10.198.3.100:5060
failed Socket is not connected
10(36629) ERROR: core [tcp_main.c:2754]: 10.198.3.100:5060: connect 
send  for 0x28d988ac failed: Socket is not connected (57)
10(36629) DEBUG: core [tcp_main.c:2955]: tcpconn_chld_put: destroying
connection 0x28d988ac (1, -1) flags 0060
10(36629) ERROR: tm [../../forward.h:170]: msg_send: ERROR: tcp_send failed

We tested two different variants: one when defined Lync in dr_gateways
table as 10.198.3.100:5068;transport=tcp

And then, tried global options
udp_mtu=1300
udp_mtu_try_proto=TCP

As soon as these options were enabled, all other gateways became
unreachable with the same error as above.

Could you please to point me out, where I'm wrong?

fbsd-kam# /usr/local/sbin/kamailio -V
version: kamailio 3.1.5 (i386/freebsd) ec672a
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4MB
poll method support: poll, select, kqueue.
id: ec672a
compiled on 11:02:58 Nov 15 2011 with gcc 4.2.1

FreeBSD fbsd-kam.dprs-consulting.com 8.2-RELEASE-p2 FreeBSD
8.2-RELEASE-p2 #0: Sun Jul  3 17:49:13 GMT 2011
r...@fbsd-kam.dprs-consulting.com:/usr/obj/usr/src/sys/GENERIC  i386

Routing script could be sent on request.

Thank you very much!

WBR
Dimon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

On 11/14/11 3:24 PM, Javier Gallart wrote:

Hello

very interesting issue actually...the mtree module fits perfectly well 
in a key-value model becaue basically is what the mtree table 
structure defines; that's why redis was the first thing that came to 
my mind when I saw the redis module. Two problems with redis:

-no native mt_match function, up to the user to find the best option
-replication. Until the cluster feature is ready, we need to change by 
hand the server ip address, which implies a kamailio restart. There is 
no mi command for changing the server in the fly, right..(not in the 
module documentation at least)?


Daniel, I agree that your suggestion about the mi/rpc method would be 
nice. I will also take a look at Mongo as Douglas suggests, and 
especially CouchDB, because you can talk to Couch DB via http...


coming back to the topic related to mtree, to be able to set values via 
mi/rpc -- it won't be that difficult to add such functionality. Usually 
with a tree is mainly reading, due to fast matching on tree indexing. 
The question is how many times/often do you need to change values and 
how many of them at the same time (more or less).


I assume many times the changes will be somewhere down the tree, since 
the first part of the number is usually the same (e.g., country code and 
operator prefix). To update the tree at runtime, while there are reads 
on it, there must be used a lock to be safe an consistent. If you do lot 
of writes and very often, then you keep the tree structure locked a lot, 
slowing the search.


Can you estimate the number of writes and how often they would be on a 
daily basis? There might be other solutions to look at, if writes are 
very often.


Cheers,
Daniel


Regards

Javi

On Mon, Nov 14, 2011 at 1:32 PM, Douglas Hubler doug...@hubler.us 
mailto:doug...@hubler.us wrote:


On Mon, Nov 14, 2011 at 5:10 AM, Daniel-Constantin Mierla
mico...@gmail.com mailto:mico...@gmail.com wrote:
 are there any other no-sql database systems that have such
mechanism? Might
 not be hard to make a connector when the time will allow -- just
to know the
 best options here.

mongodb will auto promote.  Caveat, (like redis if i understand
correctly), is that all writes are directed to a single master (be it
chosen dynamically), but reads can happen anywhere to spread the load.
 Also, you need to accept the distaster scenario of a network
partition  where a minority set of servers find themselves w/o a
master.  Example: 5 servers in datacenter #1 and 4 servers in
datacenter #2.  If the link between datacenters is broken, then all
servers in datacenter #2 will not have a master and will be read-only
until link is restored.  Good part about single master is there's no
chance of inconsistent data.

Turns out local fail-over v.s. consistent data is a well explored
area.

http://blog.nahurst.com/visual-guide-to-nosql-systems

I've worked w/the C++ driver to mongodb is anyone has questions.




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

 I assume many times the changes will be somewhere down the tree, since 
 the first part of the number is usually the same (e.g., country code and 
 operator prefix). To update the tree at runtime, while there are reads 
 on it, there must be used a lock to be safe an consistent. If you do lot 
 of writes and very often, then you keep the tree structure locked a lot, 
 slowing the search.

daniel,

could the lock be from the node that requires modification downwards,
which would leave all other branches unlocked?

 Can you estimate the number of writes and how often they would be on a 
 daily basis? There might be other solutions to look at, if writes are 
 very often.

i was thinking that perhaps mtree would be used to store numbers that
are ported to other operators instead of the current carrier route pdb
server, where the whole mmap file needs to be reloaded.  in that
application i would imagine a few hundred updates per hour, but many of
them would only affect the value associated with the node, not the
structure of the three.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Fwd: [Sip-implementors] FOSDEM 2012 Telephony/Communications Devroom Call for Presenters

2011-11-15 Thread marius zbihlei



 Original Message 
Subject: 	[Sip-implementors] FOSDEM 2012 Telephony/Communications 
Devroom Call for Presenters

Date:   Mon, 14 Nov 2011 20:28:53 +0100
From:   Kevin P. Fleming kpflem...@digium.com
To: 	sip-implement...@lists.cs.columbia.edu 
sip-implement...@lists.cs.columbia.edu




Greetings,

This is a call for presenters (with presentations!) for the telephony
and communications devroom at FOSDEM 2012 - http://www.fosdem.org/.

We will be holding a day full of presentations on development topics in
the area of open source telephony and communications on Sunday, February
5th. The schedule allows for presentations from 9:00 to 17:00. The room
we will be using will have a projector, wifi, and 100 seats.

Please submit all proposals no later than 2011-12-09.  Notification of
accepted speakers will be provided by 2011-12-16.  We will then work to
have a schedule finalized by 2012-01-06.  Talks should be submitted by
subscribing to and then posting to the telephony-devroom mailing list
hosted on http://lists.fosdem.org/.  If you would like to contact the
devroom organizer directly, please contact Kevin P. Flemingkpfleming
at digium.com.

Feel free to forward this along to any people or mailing lists that you
think would be interested in this event.

Thank you!
--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kflem...@digium.com | SIP: kpflem...@digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com  www.asterisk.org
___
Sip-implementors mailing list
sip-implement...@lists.cs.columbia.edu
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] tls-modules in 3.2.0

2011-11-15 Thread Mokhtar Bengana
Klaus, Daniel,

Thanks for responding. I am trying to understand what went wrong
during the install. I Installed Kamailio 3.2.0 From GIT and followed
the instructions in the wiki. According to the wiki Kamailio modules
are installed in:  /usr/local/lib/kamailio/modules/ and
/usr/local/lib/kamailio/modules_k/. Then I wanted to test tls and
installed kamailio-tls-modules. I added  deb
http://deb.kamailio.org/kamailio32 squeeze main and deb-src
http://deb.kamailio.org/kamailio32 squeeze main to
/etc/apt/sources.list, then run apt-get install kamailio-tls-modules.
I guess maybe what happened is that all the Debian packages got
installed again in /usr/lib/kamailio/. In the config file I changed
the mpath 
from=/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
to /usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/ and
everything is working now. Is this the right way to install the
kamailio-tls-module? How do I clean this since I have all the modules
installed again in usr/lib/kamailio/modules/. Also the config file is
present both in /etc/kamailio and /usr/local/etc/kamailio/. Which one
I should keep editing? I thought using the GIT install method is
better cause it's easy to pull changes in the future. Thanks for your
inputs and all the work you're doing.

Regards,
Mokhtar




On Tue, Nov 15, 2011 at 1:38 AM, Klaus Darilion
klaus.mailingli...@pernau.at wrote:
 Your module path is wrong. Take a look at the error message:

  /usr/local/lib/..

 Debian packages install the libraries in /usr/lib/kamailio/.

 I guess you did a manual installation before and thuse the path is wrong.

 regards
 Klaus

 On 15.11.2011 01:59, Mokhtar Bengana wrote:

 Hello,

 I am trying to install the tls module in 3.2.0. I run apt-get update
 before apt-get install kamailio-tls-modules and still can't load the
 tls module and getting the following error. Kamailio can't find the
 tls module even though it's installed? I didn't get any errors when I
 run apt-get install kamailio-tls-modules. Everything else is defined
 in the config file. Has someone tried to install tls in the latest
 release and is having issues? Any help much appreciated.

 #!define WITH_TLS

 #!ifdef WITH_TLS
 enable_tls=yes
 #!endif

 #!ifdef WITH_TLS
 loadmodule tls.so
 #!endif

 #!ifdef WITH_TLS
 # - tls params -
 modparam(tls, config, /etc/kamailio/tls.cfg)
 #!endif

 root@Kamalio:/usr/local/lib/kamailio/modules_k# kamailio -c
 loading modules under
 /usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
  0(12131) ERROR:core  [sr_module.c:553]: ERROR: load_module: could
 not find moduletls  in
 /usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/
  0(12131) :core  [cfg.y:3501]: parse error in config file
 /usr/local/etc/kamailio/kamailio.cfg, line 268, column 12-19: failed
 to load module
  0(12131) ERROR:core  [modparam.c:162]: set_mod_param_regex: No
 module matchingtls  found
  0(12131) :core  [cfg.y:3504]: parse error in config file
 /usr/local/etc/kamailio/kamailio.cfg, line 422, column 50: Can't set
 module parameter
 ERROR: bad config file (2 errors)
 root@Kamalio:/usr/local/lib/kamailio/modules_k#


 root@Kamalio:/usr/local/lib/kamailio/modules_k# apt-get install
 kamailio-tls-modules
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following NEW packages will be installed:
   kamailio-tls-modules
 0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
 Need to get 0 B/399 kB of archives.
 After this operation, 848 kB of additional disk space will be used.
 Selecting previously deselected package kamailio-tls-modules.
 (Reading database ... 30034 files and directories currently installed.)
 Unpacking kamailio-tls-modules (from
 .../kamailio-tls-modules_3.2.0+squeeze1_i386.deb) ...
 Setting up kamailio-tls-modules (3.2.0+squeeze1) ...

 Thank you,

 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Javier Gallart

 Hello

 coming back to the topic related to mtree, to be able to set values via
 mi/rpc -- it won't be that difficult to add such functionality. Usually
 with a tree is mainly reading, due to fast matching on tree indexing.
 The question is how many times/often do you need to change values and
 how many of them at the same time (more or less).

 I was also thinking about that: our application works in such a way that
the full tree is recalculated every 15 minutes. Currently we have aound 60
branches with 15 entries each.

 I assume many times the changes will be somewhere down the tree, since
 the first part of the number is usually the same (e.g., country code and
 operator prefix). To update the tree at runtime, while there are reads
 on it, there must be used a lock to be safe an consistent. If you do lot
 of writes and very often, then you keep the tree structure locked a lot,
 slowing the search.


That's the case, tname is rarely updated, it's tvalue the column that we
normally update.


 Can you estimate the number of writes and how often they would be on a
 daily basis? There might be other solutions to look at, if writes are
 very often.


From the numbers above, let's say that we need to update around 8M records
every 15 minutes (we expect this number will keep steadily increasing...)

As a side note, I've looked at how to implement the mt_match equivalent in
redis and it does't look that hard using kamailio s.prefixed transformation
(as you suggested) and redis sorted sets. I'll need to make more tests to
check the performance, I'll share the results.

Thanks!

Javi


 Cheers,
 Daniel
 
  Regards
 
  Javi

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] sqlops crash when connection does not exist

2011-11-15 Thread Juha Heinanen
i misspelled connection argument in sql_query and got crash:

Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR: sqlops [sqlops.c:266]: 
invalid connection [sip-proxy]
Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR: core [route.c:1216]: 
fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:281
Nov 10 17:19:15 sip kernel: [  990.129668] sip-proxy[4182]: segfault at 
786e6570 ip b769de38 sp bf960ffc error 4 in libc-2.11.2.so[b762b000+14]

(gdb) where
#0  0xb769de38 in strcmp () from /lib/i686/cmov/libc.so.6
#1  0x080f54f9 in find_mod_export_record (mod=0xb750bb80 db_mysql, 
name=0xb720d353 db_bind_api, param_no=0, flags=0, mod_if_ver=0xbf96108c)
at sr_module.c:657
#2  0x080f5756 in find_mod_export (mod=0xb750bb80 db_mysql, 
name=0xb720d353 db_bind_api, param_no=0, flags=0) at sr_module.c:722
#3  0xb720449c in db_bind_mod (mod=0xb6628944, mydbf=0x8) at db.c:209
#4  0xb66240d2 in ht_db_init_con () at ht_db.c:75
#5  0xb661b144 in destroy () at htable.c:225
#6  0x080f3684 in destroy_modules () at sr_module.c:782
#7  0x0809087c in cleanup (show_status=0) at main.c:564
#8  0x08091509 in shutdown_children (show_status=0, sig=value optimized out)
at main.c:706
#9  0x080940f7 in main (argc=17, argv=0xbf961354) at main.c:2523

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] sqlops crash when connection does not exist

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

looks like the issue is in the way shut down is done. In this specific 
case, sqlops does not initialize properly due to misspell, causing 
kamailio to shut down -- otherwise there is no issue with sqlops itself. 
At shutdown, the destroy function of each module is called, then the 
module structure is freed. Looks like mysql module is destroyed first, 
then htable module is destroyed, which needs to connect to sync back the 
content in memory to db tables, but the mod exports structure for mysql 
is invalid now causing a fault access.


I will make a patch for it.

Cheers,
Daniel


On 11/16/11 5:07 AM, Juha Heinanen wrote:

i misspelled connection argument in sql_query and got crash:

Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR: sqlops [sqlops.c:266]: 
invalid connection [sip-proxy]
Nov 10 17:19:15 sip /usr/sbin/sip-proxy[4182]: ERROR:core  [route.c:1216]: 
fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:281
Nov 10 17:19:15 sip kernel: [  990.129668] sip-proxy[4182]: segfault at 
786e6570 ip b769de38 sp bf960ffc error 4 in libc-2.11.2.so[b762b000+14]

(gdb) where
#0  0xb769de38 in strcmp () from /lib/i686/cmov/libc.so.6
#1  0x080f54f9 in find_mod_export_record (mod=0xb750bb80 db_mysql,
 name=0xb720d353 db_bind_api, param_no=0, flags=0, mod_if_ver=0xbf96108c)
 at sr_module.c:657
#2  0x080f5756 in find_mod_export (mod=0xb750bb80 db_mysql,
 name=0xb720d353 db_bind_api, param_no=0, flags=0) at sr_module.c:722
#3  0xb720449c in db_bind_mod (mod=0xb6628944, mydbf=0x8) at db.c:209
#4  0xb66240d2 in ht_db_init_con () at ht_db.c:75
#5  0xb661b144 in destroy () at htable.c:225
#6  0x080f3684 in destroy_modules () at sr_module.c:782
#7  0x0809087c in cleanup (show_status=0) at main.c:564
#8  0x08091509 in shutdown_children (show_status=0, sig=value optimized out)
 at main.c:706
#9  0x080940f7 in main (argc=17, argv=0xbf961354) at main.c:2523

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

On 11/15/11 12:59 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


I assume many times the changes will be somewhere down the tree, since
the first part of the number is usually the same (e.g., country code and
operator prefix). To update the tree at runtime, while there are reads
on it, there must be used a lock to be safe an consistent. If you do lot
of writes and very often, then you keep the tree structure locked a lot,
slowing the search.

daniel,

could the lock be from the node that requires modification downwards,
which would leave all other branches unlocked?


for large trees it would be not possible to have a lock for each node, 
there will be too many and different operating systems have limits. On a 
hash table there is a lock per slot, no matter how many items are in the 
table. In a tree is hard to define a set of locks and just going with 
one per node is not that feasible. For eaxample one record with prefix 
0123456789 creates 10 nodes, then some nodes are reused, but still there 
are a greater or equal number of nodes than the number of records loaded.





Can you estimate the number of writes and how often they would be on a
daily basis? There might be other solutions to look at, if writes are
very often.

i was thinking that perhaps mtree would be used to store numbers that
are ported to other operators instead of the current carrier route pdb
server, where the whole mmap file needs to be reloaded.  in that
application i would imagine a few hundred updates per hour, but many of
them would only affect the value associated with the node, not the
structure of the three.
Adding a record (i.e., prefix/value) in a tree should be fast if 
building the missing sub-tree part of it and then just linking it to the 
main tree. Removing might need more time, a solution for it can be just 
setting the value to NULL and keep the tree structure..

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] mtree on db Berkeley DB?

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

On 11/15/11 10:09 PM, Javier Gallart wrote:


Hello

coming back to the topic related to mtree, to be able to set
values via
mi/rpc -- it won't be that difficult to add such functionality.
Usually
with a tree is mainly reading, due to fast matching on tree indexing.
The question is how many times/often do you need to change values and
how many of them at the same time (more or less).

I was also thinking about that: our application works in such a way 
that the full tree is recalculated every 15 minutes. Currently we have 
aound 60 branches with 15 entries each.


I assume many times the changes will be somewhere down the tree, since
the first part of the number is usually the same (e.g., country
code and
operator prefix). To update the tree at runtime, while there are reads
on it, there must be used a lock to be safe an consistent. If you
do lot
of writes and very often, then you keep the tree structure locked
a lot,
slowing the search.


That's the case, tname is rarely updated, it's tvalue the column that 
we normally update.


I guess you meant actually tprefix is not updated -- tname is table 
name, tprefix is the prefix used to build the tree. What would be the 
percentage of tvalue updates, do you have add/remove of tprefix-es?




Can you estimate the number of writes and how often they would be on a
daily basis? There might be other solutions to look at, if writes are
very often.


From the numbers above, let's say that we need to update around 8M 
records every 15 minutes (we expect this number will keep steadily 
increasing...)


But not all of them change the value, right?



As a side note, I've looked at how to implement the mt_match 
equivalent in redis and it does't look that hard using kamailio 
s.prefixed transformation (as you suggested) and redis sorted sets. 
I'll need to make more tests to check the performance, I'll share the 
results.


I have used this solution with mysql (using a table structure in memory 
of mysql server), since the changes could have been done in mysql in 
normal way, in one update query, which is a sync operation. Does redis 
do any caching or is using always the disk file db?


Cheers,
Daniel



Thanks!

Javi


Cheers,
Daniel

 Regards

 Javi



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] strange behavior when trying to reach PSTN gateway via TCP

2011-11-15 Thread Daniel-Constantin Mierla

Hello,

you haven't disabled tcp support, right? Can you do 'kamctl ps' and see 
if you have tcp workers?


I see the error is related to 10.198.3.100:5060 :

10(36629) ERROR:core  [tcp_main.c:2748]: connect 10.198.3.100:5060 failed 
Socket is not connected

What is listening on this ip and port? In drouting table you have 
10.198.3.100:5068;transport=tcp -- a different port.


Then, do you need to enable and play with mtu params? This is for 
auto-switching from UDP to TCP when size of SIP message exceeds udp_mtu 
value in bytes, done by SIP server, but if the other party is not 
listening on tcp, then it won't work (reason is disabled by default) -- 
note that this switching will be done for all sip messages.


Cheers,
Daniel


On 11/15/11 11:43 AM, Dmitry Petrakoff wrote:

Hi List!

I'm running Kamailio for about 1 year without any serious problems.
When it works with UDP only, it runs perfectly well for us. Without any
major issues.

But now we have a customer who wants to connect Lync to our network.
Unfortunately, Lync does not support UDP for SIP signalling, so we tried
to teach kamailio to send SIP messages via TCP.
And getting  strange error:

10(36629) DEBUG: tm [t_reply.c:659]: DEBUG: reply sent out.
buf=0x832c7ac: SIP/2.0 100 trying -..., shmem=0x28d97c7c: SIP/2.0 100
trying -
10(36629) DEBUG: tm [t_reply.c:669]: DEBUG: _reply_light: finished
10(36629) DEBUG:core  [forward.c:213]: DEBUG: get_out_socket: socket
determined: 0x833ddc0
10(36629) DEBUG:core  [msg_translator.c:457]: clen_builder:
content-length: 553 (553)
10(36629) DEBUG:core  [msg_translator.c:204]:
check_via_address(10.200.245.200, 10.200.245.200, 0)
10(36629) DEBUG:core  [tcp_main.c:1824]: tcp_send: no open tcp
connection found, opening new one
10(36629) DEBUG:core  [ip_addr.c:247]: tcpconn_new: new tcp
connection: 10.198.3.100
10(36629) DEBUG:core  [tcp_main.c:1081]: tcpconn_new: on port 5060, type 2
10(36629) DEBUG:core  [tcp_main.c:1382]: tcpconn_add: hashes: 0:0:0, 1
10(36629) ERROR:core  [tcp_main.c:2748]: connect 10.198.3.100:5060
failed Socket is not connected
10(36629) ERROR:core  [tcp_main.c:2754]: 10.198.3.100:5060: connect
send  for 0x28d988ac failed: Socket is not connected (57)
10(36629) DEBUG:core  [tcp_main.c:2955]: tcpconn_chld_put: destroying
connection 0x28d988ac (1, -1) flags 0060
10(36629) ERROR: tm [../../forward.h:170]: msg_send: ERROR: tcp_send failed

We tested two different variants: one when defined Lync in dr_gateways
table as 10.198.3.100:5068;transport=tcp

And then, tried global options
udp_mtu=1300
udp_mtu_try_proto=TCP

As soon as these options were enabled, all other gateways became
unreachable with the same error as above.

Could you please to point me out, where I'm wrong?

fbsd-kam# /usr/local/sbin/kamailio -V
version: kamailio 3.1.5 (i386/freebsd) ec672a
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4MB
poll method support: poll, select, kqueue.
id: ec672a
compiled on 11:02:58 Nov 15 2011 with gcc 4.2.1

FreeBSD fbsd-kam.dprs-consulting.com 8.2-RELEASE-p2 FreeBSD
8.2-RELEASE-p2 #0: Sun Jul  3 17:49:13 GMT 2011
r...@fbsd-kam.dprs-consulting.com:/usr/obj/usr/src/sys/GENERIC  i386

Routing script could be sent on request.

Thank you very much!

WBR
Dimon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users