[SR-Users] Reload lua script?

2012-03-29 Thread Javier Gallart
Hello all

I'm starting to play with lua scripting in Kamailio. It's really cool, some
complex stuff in the script becomes really easy this way. The script is
becoming quite big, therefore I'd like to use lua_run instead of
lua_dofile. My doubt is pretty  basic: if i load a script in memory at
startup via the load parameter and the script is modifed afterwards, is
there any way to reload the module so the script is reread?

Thanks in advance

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


Re: [SR-Users] Reload lua script?

2012-03-29 Thread Javier Gallart
Thanks Daniel

On Thu, Mar 29, 2012 at 2:49 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

 Hello,


 On 3/29/12 11:49 AM, Javier Gallart wrote:

 Hello all

 I'm starting to play with lua scripting in Kamailio. It's really cool,
 some complex stuff in the script becomes really easy this way. The script
 is becoming quite big, therefore I'd like to use lua_run instead of
 lua_dofile. My doubt is pretty  basic: if i load a script in memory at
 startup via the load parameter and the script is modifed afterwards, is
 there any way to reload the module so the script is reread?

 the two contexts created by app_lua were designed one for loading at
 startup and the other for reloading every time. Reloading on demand at
 runtime is not possible. I thought of checking the timestamp of the script,
 but can be a bit risky if saving on intermediary state during updates. The
 scripts are loaded in each process, sending a mi/rpc command will require
 to do some inter-process signaling. Both doable, not in my short term
 plans, though, if someone is contributing, will be appreciated.

Understood, we may give it a try in the next weeks.


 Some options for speed up with existing code:
 - you can compile the Lua scripts, so reloading it each time will be
 faster (no more compile on-the-fly)

I agree it's the most logical approach.

 - not sure about this one: in your script loaded at startup you may have
 some logic to load another script based on your rules (e.g., file
 timestamp, periodically, ...)

Not sure either, will try.

What about using luajit?

Regards

Javi


 Cheers,
 Daniel

 --
 Daniel-Constantin Mierla
 Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
 http://www.asipto.com/index.**php/kamailio-advanced-**training/http://www.asipto.com/index.php/kamailio-advanced-training/


___
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] sr-users Digest, Vol 82, Issue 21

2012-03-07 Thread Javier Gallart
Hello

this is what I normally use:

if (defined $var(x)) {...}

Regards

Javi


 --

 Message: 4
 Date: Tue, 6 Mar 2012 20:05:32 -0600
 From: Krishna Kurapati kkura...@gmail.com
 Subject: [SR-Users] Improving Kamailo configuration parser ...
 To: kamailio users sr-users@lists.sip-router.org
 Message-ID:
caozcjafcarq+ht3r+mwckpyavjh+evfwna_hj6tahgyd2da...@mail.gmail.com
 
 Content-Type: text/plain; charset=iso-8859-1

 I used

 if ($var(x) != null) { ... }

 in one of the routes, and tried to run Kamailio server.
 The server exited with an error. I did not know why.

 Once I changed it to if ($var(x) != $null) {} the error went away.
 I missed $ infront null. I think it is hard to trace such problems once a
 large chunk
 of logic is written since many of us come from C++ and scripting background
 where $null
 is not a common practice.

 Also if I tried to use if (!$var(x)) { ... } Kamailio tries to convert the
 value of $var(x) to integer.
 prints WARNINGS in the log when the $var(x) consists of a string.

 Krish Kura
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20120306/d591f3b0/attachment-0001.htm
 

 --


___
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] how to match exact string value in mtree (Uri Shacked)

2012-02-17 Thread Javier Gallart
Hi Daniel,

no, in order to find the best match we do a manual trick using
the s.prefixes transformation (I think you suggested that). We start with
the full number and stop when we find a non-null value. This kamailio is
serving many thousands of calls per hour, and the response time is pretty
much the same as when we used the mtree module. For us , using redis has
the advantage of being able to load the tree data faster than when we used
postgres without the need to perform a mtree reload.

Regards

Javi

On Fri, Feb 17, 2012 at 10:25 AM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello Javier,

 one question about redis, can it do longest prefix matching or all
 prefixes match?

 Cheers,
 Daniel


 On 2/16/12 2:51 PM, Javier Gallart wrote:

 Hello Uri

  I had similar needs and I found the ndb_redis module more suited for
 that type of task. Instead of a tree you have a hash like this: tname
 tprefix tvalue. If you do a hget nts $avp(DID) and you get a not null
 value you have found your exact match. It works very  well for me and the
 time it takes for that query is barely noticeable. Of course redis does
 not address items like persistence, etc the same way a rdbms does.
 Hope it helps.

  Regards

  Javi

 On Thu, Feb 16, 2012 at 12:00 PM, 
 sr-users-requ...@lists.sip-router.orgwrote:

 Send sr-users mailing list submissions to
sr-users@lists.sip-router.org

 To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 or, via email, send a message with subject or body 'help' to
sr-users-requ...@lists.sip-router.org

 You can reach the person managing the list at
sr-users-ow...@lists.sip-router.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of sr-users digest...


 Today's Topics:

   1. how to match exact string value in mtree (Uri Shacked)


 --

 Message: 1
 Date: Thu, 16 Feb 2012 12:54:50 +0200
 From: Uri Shacked ushac...@gmail.com
 Subject: [SR-Users] how to match exact string value in mtree
 To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users   Mailing List sr-users@lists.sip-router.org
 Message-ID:
CAMMbDhTFNXAE-K88=
 aemjo7ana_qjv3ajj3ah-axemxn3ze...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hi,

 I am using Mtree to match prefix numbers, some of them starts with 0 or
 characters like D for example.
 so, the mtree param is like this:

 modparam(mtree, db_url, CFGDB)
 modparam(mtree, mtree,
 name=nts;dbtable=service_numbers_view;type=0;)
 modpmodparam(mtree, char_list, 0123456789*+#YMDabcdefgh)
 modparam(mtree, pv_value, $avp(mtval))
 modparam(mtree, pv_values, $avp(mtvals))

 The thing is, that i tried all:

 if(!mt_match(nts, $avp(DID),1))
 if(!mt_match(nts, $avp(DID),2))
 if(!mt_match(nts, $avp(DID),0))

 and lets say i have the both prefix in the nts mtree:
 09555
 09555333

 And the prefix i search for is  $avp(DID)=09555444

 I allwasy get the 09555 because it is the longest match.
 I need exact match.

 how do i do that?
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20120216/9d2eb778/attachment.html
 

 --

 ___
 sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 End of sr-users Digest, Vol 81, Issue 40
 




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


 --
 Daniel-Constantin Mierla -- 
 http://www.asipto.comhttp://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] ndb_redis module fails after a while

2012-02-17 Thread Javier Gallart
Hi Daniel, Andrew

I've just tested the patch and kamailio crashes when the redis server is
stopped. This is what I could get:
-From the logs:
Feb 17 06:33:32 r-gate-test ./kamailio[23812]: ALERT: core [main.c:751]:
child process 23819 exited by a signal 11
Feb 17 06:33:32 r-gate-test ./kamailio[23812]: ALERT: core [main.c:754]:
core was generated
Feb 17 06:33:32 r-gate-test ./kamailio[23812]: INFO: core [main.c:766]:
INFO: terminating due to SIGCHLD

-An the backtrace:
(...)
Core was generated by `./kamailio -f ../etc/kamailio/kamailio.cfg'.
Program terminated with signal 11, Segmentation fault.
#0  redisFree (c=0x0) at hiredis.c:817
817if (c-fd  0)
(gdb) bt
#0  redisFree (c=0x0) at hiredis.c:817
#1  0x7f726f035461 in redisc_reconnect_server (rsrv=0x7f7271c93ac0) at
redis_client.c:229
#2  0x7f726f037240 in redisc_exec (srv=value optimized out,
cmd=0x7fffe98c6090, argv1=value optimized out, argv2=value optimized
out, argv3=value optimized out,
res=value optimized out) at redis_client.c:298
#3  0x7f726f034f7d in w_redis_cmd3 (msg=0x7f7271d7b018, ssrv=value
optimized out, scmd=value optimized out, sres=0x7f7271d74b58
h\341\313qr\177) at ndb_redis_mod.c:156
#4  0x00417025 in do_action (h=0x7fffe98c6570, a=0x7f7271cc5248,
msg=value optimized out) at action.c:1134
#5  0x0041e58b in run_actions (h=value optimized out, a=value
optimized out, msg=value optimized out) at action.c:1610
#6  0x0041e8d4 in run_actions_safe (h=0x7fffe98c7610,
a=0x7f7271c93781, msg=0x7f7271c93780) at action.c:1662
#7  0x004b731d in rval_get_int (h=0x7fffe98c7610, msg=0x0,
i=0x7fffe98c6bd8, rv=0x3, cache=0x4) at rvalue.c:920
#8  0x004bb87c in rval_expr_eval_int (h=0x7fffe98c7610,
msg=0x7f7271d7b018, res=0x7fffe98c6bd8, rve=0x7f7271cc6768) at rvalue.c:1914
#9  0x00417c7c in do_action (h=0x7fffe98c7610, a=0x7f7271ccb9d0,
msg=value optimized out) at action.c:1092
#10 0x0041e58b in run_actions (h=value optimized out, a=value
optimized out, msg=value optimized out) at action.c:1610
#11 0x00417cd7 in do_action (h=0x7fffe98c7610, a=0x7f7271ccbb10,
msg=value optimized out) at action.c:
#12 0x0041e58b in run_actions (h=value optimized out, a=value
optimized out, msg=value optimized out) at action.c:1610
#13 0x0041795e in do_action (h=0x7fffe98c7610, a=value optimized
out, msg=value optimized out) at action.c:732
#14 0x0041e58b in run_actions (h=value optimized out, a=value
optimized out, msg=value optimized out) at action.c:1610
#15 0x0041e862 in run_top_route (a=0x7f7271c94888,
msg=0x7f7271d7b018, c=value optimized out) at action.c:1683
#16 0x00498f36 in receive_msg (
buf=0x8bb100 INVITE sip:34661574758@79.170.68.215:5060 SIP/2.0\r\nVia:
SIP/2.0/UDP 79.170.68.214:5060;branch=z9hG4bK-9451-1-0\r\nFrom: 34661574758
sip:34661574758@79.170.68.214:5060;tag=9451SIPpTag001\r\nTo: sut
sip:..., len=value optimized out, rcv_info=0x7fffe98c7910) at
receive.c:207
#17 0x00525987 in udp_rcv_loop () at udp_server.c:544
#18 0x004635f4 in main_loop () at main.c:1585
#19 0x00465e62 in main (argc=3, argv=0x7fffe98c7c08) at main.c:2475


Regards

Javi

On Fri, Feb 17, 2012 at 11:39 AM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

 Hello,

 thanks for testing, indeed it was an extra declaration left over. Can you
 try with the new patch attached?

 Cheers,
 Daniel


 On 2/17/12 11:10 AM, Andrew Pogrebennyk wrote:

 Hi Daniel,

 On 02/17/2012 10:47 AM, Daniel-Constantin Mierla wrote:

 I made a patch for server reconnect -- I had no access to a computer
 with redis lib installed for the moment, hopefully it compiles. If you
 can try and tell the result, it would be great, I can commit then.

 I may be able to test this patch as well. Currently compilations bails
 out on attempt to redeclare redisc_reconnect_server function parameter:

 CC (gcc) [M ndb_redis.so]   ndb_redis_mod.o
 CC (gcc) [M ndb_redis.so]   redis_client.o
 redis_client.c: In function ‘redisc_reconnect_server’:
 redis_client.c:206:19: error: ‘rsrv’ redeclared as different kind of
 symbol
 redis_client.c:202:46: note: previous definition of ‘rsrv’ was here
 make[1]: *** [redis_client.o] Error 1
 make: *** [modules] Error 1

 __**_
 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-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 --
 Daniel-Constantin Mierla -- http://www.asipto.com
 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] how to match exact string value in mtree (Uri Shacked)

2012-02-17 Thread Javier Gallart
Hi

Maybe I didn't understand your scenario, but I don't see how to do it with
the dialplan module. Let's say you have two entries in your dialplan table:
09555333 (this should go first)
09555*
If your string is 09555444 you will still get the second entry


Regards

Javi



On Fri, Feb 17, 2012 at 3:11 PM, Uri Shacked ushac...@gmail.com wrote:

 hi,

 what do you think about the Dialplan module? it can probably do the trick
 as well...

 cheers,

 On Fri, Feb 17, 2012 at 10:18 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

 Hello,


 On 2/16/12 2:51 PM, Javier Gallart wrote:

 Hello Uri

 I had similar needs and I found the ndb_redis module more suited for that
 type of task. Instead of a tree you have a hash like this: tname tprefix
 tvalue. If you do a hget nts $avp(DID) and you get a not null value you
 have found your exact match. It works very  well for me and the time it
 takes for that query is barely noticeable. Of course redis does not
 address items like persistence, etc the same way a rdbms does.


 for hash tables in config, the alternative is using htable module. Then
 the selection is done on exact match, no prefix matching. mtree is suitable
 for storing keys that are composed from a limited set of characters (like
 numbers, 0-9 digits only), otherwise becomes too memory consuming. For keys
 that are composed from any character and need exact match, hash table
 structures are more suitable, no matter if it is via htable module or
 something else like redis.

 Cheers,
 Daniel

   Hope it helps.

 Regards

 Javi

 On Thu, Feb 16, 2012 at 12:00 PM, 
 sr-users-requ...@lists.sip-router.orgwrote:

 Send sr-users mailing list submissions to
sr-users@lists.sip-router.org

 To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 or, via email, send a message with subject or body 'help' to
sr-users-requ...@lists.sip-router.org

 You can reach the person managing the list at
sr-users-ow...@lists.sip-router.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of sr-users digest...


 Today's Topics:

   1. how to match exact string value in mtree (Uri Shacked)


 --

 Message: 1
 Date: Thu, 16 Feb 2012 12:54:50 +0200
 From: Uri Shacked ushac...@gmail.com
 Subject: [SR-Users] how to match exact string value in mtree
 To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users   Mailing List sr-users@lists.sip-router.org
 Message-ID:
CAMMbDhTFNXAE-K88=
 aemjo7ana_qjv3ajj3ah-axemxn3ze...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hi,

 I am using Mtree to match prefix numbers, some of them starts with 0 or
 characters like D for example.
 so, the mtree param is like this:

 modparam(mtree, db_url, CFGDB)
 modparam(mtree, mtree,
 name=nts;dbtable=service_numbers_view;type=0;)
 modpmodparam(mtree, char_list, 0123456789*+#YMDabcdefgh)
 modparam(mtree, pv_value, $avp(mtval))
 modparam(mtree, pv_values, $avp(mtvals))

 The thing is, that i tried all:

 if(!mt_match(nts, $avp(DID),1))
 if(!mt_match(nts, $avp(DID),2))
 if(!mt_match(nts, $avp(DID),0))

 and lets say i have the both prefix in the nts mtree:
 09555
 09555333

 And the prefix i search for is  $avp(DID)=09555444

 I allwasy get the 09555 because it is the longest match.
 I need exact match.

 how do i do that?
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20120216/9d2eb778/attachment.html
 

 --

 ___
 sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 End of sr-users Digest, Vol 81, Issue 40
 




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


 --
 Daniel-Constantin Mierla -- 
 http://www.asipto.comhttp://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] Kamailio Redundancy examples/pointers required

2012-01-26 Thread Javier Gallart
Hello

the net.ipv4.ip_nonlocal_bind = 1 options works fine. We have a very basic
redundancy level, but it fits our current needs; sometimes it's even harder
to troubleshoot the redundancy failures than the actual failures. We have 2
identical servers running kamailio and  listening to the same ip
addresses/ports (you need to enable the sysctl option for that). A
heartbeat process controls in what machine the actual ip addresses are
active. The DB is in one of the servers but we update the shared memory in
both. For us having the DB down for a while is not critical because all the
data is in memory. When one servers goes down the other one takes over
immediately. It's a very comfortable setup also for doing upgrades in the
configuration in a controlled manner.
Hope it helps

Regards

Javi

 --

 Message: 6
 Date: Thu, 26 Jan 2012 12:13:18 +0500
 From: Sammy Govind govoi...@gmail.com
 Subject: Re: [SR-Users] Kamailio Redundancy examples/pointers required
 To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users   Mailing List sr-users@lists.sip-router.org
 Message-ID:
CAJUJwtjMGTuNe1Cu5+BDthgj0xrSJrBM03XzcjZhWJ8Ar7=o...@mail.gmail.com
 
 Content-Type: text/plain; charset=iso-8859-1

 Hi,
 Thanks for taking out time for this. really appreciate your ideas. Here are
 few things I've found useful so far.

 http://kamailio.org/events/2011-fosdem/p_usrloc.pdf
 This looks like one thing that one could have to ensure more reliability
 but we do need other application level and physical level failover
 techniques additionally.

 For using any technique like Linux-HA, Heartbeat, keepalived, UCARP or any
 floating/virtual IP techniques I really hope that the sysctl option
 mentioned in b/m thread really works.
 http://www.mail-archive.com/sr-users@lists.sip-router.org/msg03714.html


 http://old.nabble.com/Kamilio-Failover-Options-td21947502.html
 DNS SRV is one option. Using another Kamailio on top of two Kamailio is
 again a SPOF so I think its of no use at all.

 I hope to get a very reliable and working solution out of these forums.

 Regards,
 Sammy

 On Wed, Jan 25, 2012 at 9:49 PM, Andreas Granig agra...@sipwise.com
 wrote:

  Hi Sammy,
 
  On 01/25/2012 02:08 PM, Sammy Govind wrote:
   I've been looking for ways to create a redundant Kamailio cluster. I've
   googled alot but haven't got any concrete or final wording on any one
   solution that'll just work perfectly. The basic requirement is that in
 
  HA is never really easy :)
 
   case of Kamailio application failure or in case of physical machine
   error the whole setup just starts working on secondary server.
  
   Please suggest anything whichever you guys are using. Any reference
 URLs
   would be very much appreciated.
 
  For 1+1 setups, you can use a master/master replication (people also use
  drbd to sync the whole table space, not sure how good that works) on db
  level, use write-back mode in kamailio to make sure your registrations
  are written to DB immediately, then use heartbeat to do the IP/process
  fail-overs on network/power failures. On top, you can do manual checks
  to trigger a fail-over in case of high-level failures. I guess this is
  the typical and most straight-forward scenario. Your mileage might vary,
  depending on specific environment variables (e.g. you might want to
  announce your active server via RIP/OSPF using quagga instead of the
  more common gratuitous arp if your servers are geographically split).
 
  For scaling larger, put a kamailio instance acting as load-balancer in
  front of your proxies and scale them by providing some sharding
  information to the lb.
 
  Also the new db_cassandra backend in master branch looks pretty
  promising when it comes to HA/scaling. Maybe someone can provide some
  best practices regarding that as well?
 
  Andreas
 
 
  ___
  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
 
 
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20120126/1d88120c/attachment.htm
 

 --

 ___
 sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 End of sr-users Digest, Vol 80, Issue 84
 

___
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] ndb_redis module fails after a while

2012-01-13 Thread Javier Gallart
Hi Daniel

both values are null. I might have found something: apparently some of the
sockets kamailio-redis were inactive for a while and were being closed in
the redis end. This is redis default config:
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 600

I've set the timeout value to 0 to confirm if this is actually the problem.

In case it might be useful for somebody, we've used lsof in recurrent mode
to monitor the sockets status:

server# lsof -i :6379 -r 5m===%T===  | grep -e == -e kamailio
===05:28:26===
kamailio  13365 kamailio4u  IPv4  58622  0t0  TCP
localhost:34994-localhost:6379 (ESTABLISHED)
kamailio  13366 kamailio4u  IPv4  58626  0t0  TCP
localhost:34995-localhost:6379 (ESTABLISHED)
kamailio  13367 kamailio4u  IPv4  58628  0t0  TCP
localhost:34996-localhost:6379 (ESTABLISHED)
kamailio  13368 kamailio4u  IPv4  58632  0t0  TCP
localhost:34997-localhost:6379 (ESTABLISHED)
kamailio  13369 kamailio4u  IPv4  58649  0t0  TCP
localhost:35000-localhost:6379 (ESTABLISHED)
kamailio  13370 kamailio4u  IPv4  58661  0t0  TCP
localhost:35003-localhost:6379 (ESTABLISHED)
kamailio  13376 kamailio   10u  IPv4  58710  0t0  TCP
localhost:35013-localhost:6379 (ESTABLISHED)
kamailio  13377 kamailio4u  IPv4  58705  0t0  TCP
localhost:35012-localhost:6379 (ESTABLISHED)
kamailio  13378 kamailio4u  IPv4  58695  0t0  TCP
localhost:35008-localhost:6379 (ESTABLISHED)
kamailio  13381 kamailio4u  IPv4  58691  0t0  TCP
localhost:35006-localhost:6379 (ESTABLISHED)
kamailio  13382 kamailio4u  IPv4  58693  0t0  TCP
localhost:35007-localhost:6379 (ESTABLISHED)
===05:28:31===
kamailio  13365 kamailio4u  IPv4  58622  0t0  TCP
localhost:34994-localhost:6379 (ESTABLISHED)
kamailio  13366 kamailio4u  IPv4  58626  0t0  TCP
localhost:34995-localhost:6379 (CLOSE_WAIT)
kamailio  13367 kamailio4u  IPv4  58628  0t0  TCP
localhost:34996-localhost:6379 (ESTABLISHED)
kamailio  13368 kamailio4u  IPv4  58632  0t0  TCP
localhost:34997-localhost:6379 (CLOSE_WAIT)
kamailio  13369 kamailio4u  IPv4  58649  0t0  TCP
localhost:35000-localhost:6379 (CLOSE_WAIT)
kamailio  13370 kamailio4u  IPv4  58661  0t0  TCP
localhost:35003-localhost:6379 (CLOSE_WAIT)
kamailio  13376 kamailio   10u  IPv4  58710  0t0  TCP
localhost:35013-localhost:6379 (CLOSE_WAIT)
kamailio  13377 kamailio4u  IPv4  58705  0t0  TCP
localhost:35012-localhost:6379 (CLOSE_WAIT)
kamailio  13378 kamailio4u  IPv4  58695  0t0  TCP
localhost:35008-localhost:6379 (CLOSE_WAIT)
kamailio  13381 kamailio4u  IPv4  58691  0t0  TCP
localhost:35006-localhost:6379 (CLOSE_WAIT)
kamailio  13382 kamailio4u  IPv4  58693  0t0  TCP
localhost:35007-localhost:6379 (CLOSE_WAIT)

Regards

Javi

On Fri, Jan 13, 2012 at 9:35 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

 Hello,


 On 1/13/12 8:00 AM, Javier Gallart wrote:

 Hi all

 I have started making some tests with the ndb_redis module. So far we
 have not stressed the module (no more than 5 HGET  commands/second at
 maximum). It works well, but with at some point it starts failing. The
 failures are easily found because the logs always show this:
 INFO: core [main.c:811]: INFO: signal 13 received

 this due to a broken connection. What do you get in redis reply and info
 variables?


  After that the redis value is always null. If I restart kamailio it
 starts working again.
 I've run kamailio with debug=4 but I haven't seen more useful
 information. On the redis side, I could find nothing in the logs either,
 the number of clientes connected is alway much less than the configured
 maximum, Any idea?
 On the other hand, if I restart redis we need to restart kamailio to
 restore the connections. Is the reconnection to redis on the roadmap?


 It should not be that complex, there is the code for initializing the
 connection, it should be reused for doing it again in case of failure.

 Cheers,
 Daniel

 --
 Daniel-Constantin Mierla -- http://www.asipto.com
 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] ndb_redis module fails after a while

2012-01-12 Thread Javier Gallart
Hi all

I have started making some tests with the ndb_redis module. So far we have
not stressed the module (no more than 5 HGET  commands/second at maximum).
It works well, but with at some point it starts failing. The failures are
easily found because the logs always show this:
INFO: core [main.c:811]: INFO: signal 13 received
After that the redis value is always null. If I restart kamailio it starts
working again.
I've run kamailio with debug=4 but I haven't seen more useful information.
On the redis side, I could find nothing in the logs either, the number of
clientes connected is alway much less than the configured maximum, Any idea?
On the other hand, if I restart redis we need to restart kamailio to
restore the connections. Is the reconnection to redis on the roadmap?

Thanks in advance

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


Re: [SR-Users] Kamailio v3.2.0 Development Guide published

2011-11-29 Thread Javier Gallart



 Daniel,

 This is great!  Thanks a lot for it, it will help third-party
 contributors enormously.

 -- Alex


 I agree, excellent document, thank you -though I must say that, not being
a developer, I understood very little :) -.

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] Access to multivalue responses in ndb_redis

2011-11-18 Thread Javier Gallart
Hello

do you know if it's possible to access the different values in a complex
response using ndb_redis?
For instance:
ZREVRANGE key 0 -1
1) 123456
2) 123
3) 1

I'd like to store the first value (123456); is it possible?

Thanks in advance

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


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

2011-11-17 Thread Javier Gallart
Hi Daniel

On Thu, Nov 17, 2011 at 8:03 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

 Hello,

 On 11/16/11 12:45 PM, Javier Gallart wrote:

 [...]

 All the data in Redis stays in memory, you can dump periodic snapshots to
 disk. Some time ago they worked in a feature called disktore, with some
 cache mechanism between disk and memory, but as far as I know that line was
 abandoned.


 so if the redis goes down, then the records are lost or is doing dump of
 memory to disk at that time? I try to figure out if redis makes more sense
 than using one kamailio as a load balancer in front of two kamailios having
 the mtree in memory. The two with mtree will be restarted one after the
 other every 15 min. Load balancer can be configured to use only one, with
 quick fallback (100ms) to the second, or via kamctl the active kamailio
 with mtree is set to be used first.

 That's pretty much our current configuration; instead of having  a
kamailio as load-balancer we are using our own softswitch that sends the
calls to 2 kamailio with mtree in memory. If there is a problem with one of
them, the call is quickly rerouted to the backup kamailio. We're happy with
that configuration; but as the tree keeps growing the time needed for
populating the db + reloading the tree increases (about 4-5 minutes
currently, not really under pressure yet...). That's why we were thinking
about a full in-memory solution. At this point we're going to focus our
tests with this setup:
-1 redis Master server for writing, with frequent snapshots
-2 redis Slave servers
-2 kamailios, each of them reading from a slave redis stored in a shared
variable for quick update via rpc
-If redis_cmd returns an error, kamailio will respond with a 503 Status so
that the softswitch will send the invite to the backup kamailio

Of course this will make sense only if we're able to implement a mt_match
equivalent in redis that gives an acceptable performance...

Regards

Javi

 kamailio with mtree will send back a 302 which is handled by load balancer
 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-16 Thread Javier Gallart
Hi

On Wed, Nov 16, 2011 at 8:13 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  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?

You're right, sorry for the wrong names. The tprefixes are only updated
once a day, and only a tiny percentage of them (less than 1%) actually
changes.




 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?

I've been checking this, and  on average about 40% are updated in each
reload.




  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?

All the data in Redis stays in memory, you can dump periodic snapshots to
disk. Some time ago they worked in a feature called disktore, with some
cache mechanism between disk and memory, but as far as I know that line was
abandoned.


 Cheers,
 Daniel


  Thanks!

  Javi


 Cheers,
 Daniel
 
  Regards
 
  Javi



 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://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/kathttp://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 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


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

2011-11-14 Thread Javier Gallart
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...

Regards

Javi

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

 On Mon, Nov 14, 2011 at 5:10 AM, Daniel-Constantin Mierla
 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


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

2011-11-12 Thread Javier Gallart
Thanks Daniel

yes, I thought about that too, I like redis a lot, and the redis module
addition to kamailio is excellent news. However in this context it's not
trivial to write a function that looks for  the best match in a redis tree
structure as mt_match does...

Regards

Javi

On Sat, Nov 12, 2011 at 9:28 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,

 just mentioning ndb_redis module (in 3.2) - you may want to look at, it is
 key based access memory system. Otherwise, I haven't used personally
 berkeley db to comment on this particular subject.

 Cheers,
 Daniel




 On 11/11/11 7:50 PM, Javier Gallart wrote:

 Hi list

  we've been happily using the mtree module for months now. Lately the
 size of the tree has grown a lot. The mtree table needs to be fully
 repopulated and reloaded several times a day, and we are looking for a
 fastest mechanism (for populating the table, I guess the reload time does
 not depend much on the db backend...). Does anyone tried with Berkeley DB?
 Is this combination mtree-berkeley actually feasible...?

  Thanks


  Javi


 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://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/kathttp://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] mtree on db Berkeley DB?

2011-11-11 Thread Javier Gallart
Hi list

we've been happily using the mtree module for months now. Lately the size
of the tree has grown a lot. The mtree table needs to be fully repopulated
and reloaded several times a day, and we are looking for a fastest
mechanism (for populating the table, I guess the reload time does not
depend much on the db backend...). Does anyone tried with Berkeley DB? Is
this combination mtree-berkeley actually feasible...?

Thanks


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


Re: [SR-Users] Kamailio v3.2.0 Released - new major version is

2011-10-19 Thread Javier Gallart
Hello

congratulations to all the people who has contributed! I'm looking forward
to try it out, some of the new features look really promising...

Regards

Javi

 --

 Message: 2
 Date: Tue, 18 Oct 2011 20:30:22 +0200
 From: Daniel-Constantin Mierla mico...@gmail.com
 Subject: [SR-Users] Kamailio v3.2.0 Released - new major version is
out
 To: kamailio users sr-users@lists.sip-router.org, sr-dev
sr-...@lists.sip-router.org, busin...@lists.kamailio.org
 Message-ID: 4e9dc5be.8080...@gmail.com
 Content-Type: text/plain; charset=windows-1252; format=flowed

 Kamailio (OpenSER) SIP Server v3.2.0 is out ? a major release with a
 very large number of new features and improvements.

 v3.2.0 release is a result of more than 10 months of development and 2
 months of testing from the teams of Kamailio (OpenSER) and SIP Express
 Router (SER) projects. In the year of the 10th celebration of our
 project (http://sip-router.org/10-years-ser/), this version comes with
 12 brand new modules in addition to a lot of fresh features in core and
 old modules.

 Full release notes, including links for download and documentation, are
 available at:

 * http://www.kamailio.org/w/kamailio-openser-v3-2-0-release-notes/

 Many thanks to all developers and community members that made possible
 this release.

 Enjoy SIP routing in a more flexible and easier way with Kamailio v3.2.0!

 --
 Daniel-Constantin Mierla -- http://www.asipto.com





___
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 question

2011-08-15 Thread Javier Gallart
Hi Daniel

thanks for giving a more detailed information.  About the last point, it
sounds really interesting; as a matter of fact it's exactly what I'm doing
manually right now (we get a bunch of k,v pairs in each entry in the mtree
and right now I parse them manually with loops and or transformations...)...
Being able to use avp (o xavp) would be a nice addition to the modue.

Regards

Javi

On Mon, Aug 15, 2011 at 5:55 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,

 some more comments/confirmations:


 On 8/12/11 11:31 PM, Javier Gallart wrote:

 Hi Juha

 based on my experience with the mtree module:

 -mt_match() will match the longest prefix in the tree, in your case 00358

 * yes, longest prefix is matched


 -mt_ignore_duplicates makes sense when loading the data in the DB to the
 memory. There could be duplicate entries in the db and with that directive
 you tell kamailio how to handle that situation


 * indeed, duplicated are ignored in such mode, otherwise loading the
 records from db will throw error in duplicate prefixes.


  -I don't know about mt_tree_type...(never needed to test it)


 * this is intended to control the behavior of the tree data and matching
 mode. The default one is 0, match longest prefix and the associated data
 with the prefix is a string. This is complete implementation.

 There is actually a second mode, 1, intended to have the data as two
 integers separated by colon, like 'weight:value' iirc. The matching of any
 part of the prefix that has data associated with will add 'value' into a
 list of avps ordered by 'weight'. Since it was not really tested and the
 implementation might not be full -- due to lack of time at that moment and
 plans to migrate to use xavp for proper internal representation -- it was
 left undocumented. I should review this mode soon.

 Other types of trees may be added in the future in order to optimize the
 data in the nodes for runtime usage.

 Cheers,
 Daniel


 Hope it helps

 Regards

 Javi

 --

 Message: 2
 Date: Fri, 12 Aug 2011 10:10:29 +0300
 From: Juha Heinanen j...@tutpro.com
 Subject: [SR-Users] mtree question
 To: sr-users@lists.sip-router.org
 Message-ID: 20036.53733.20652.518...@sip.test.fi
 Content-Type: text/plain; charset=us-ascii

 after reading mtree readme, it is not clear to me if mt_match() matches
 to longest or any matching prefix in the three.  for example, if i have
 tree with prefixes 00 and 00358 and string to be matched is
 0035892345670, will mt_match() set pv to value associated with 00 or
 00358?  also, if mt_ignore_duplicates is set, will 00358 be considered
 as duplicate of 00 or just prefixes that are exactly same.  finally,
 what are possible mt_tree_type values and what types they stand for?

 -- 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, Oct 10-13, Berlin: 
 http://asipto.com/u/kathttp://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 question

2011-08-12 Thread Javier Gallart
Hi Juha

based on my experience with the mtree module:

-mt_match() will match the longest prefix in the tree, in your case 00358
-mt_ignore_duplicates makes sense when loading the data in the DB to the
memory. There could be duplicate entries in the db and with that directive
you tell kamailio how to handle that situation
-I don't know about mt_tree_type...(never needed to test it)

Hope it helps

Regards

Javi

 --

 Message: 2
 Date: Fri, 12 Aug 2011 10:10:29 +0300
 From: Juha Heinanen j...@tutpro.com
 Subject: [SR-Users] mtree question
 To: sr-users@lists.sip-router.org
 Message-ID: 20036.53733.20652.518...@sip.test.fi
 Content-Type: text/plain; charset=us-ascii

 after reading mtree readme, it is not clear to me if mt_match() matches
 to longest or any matching prefix in the three.  for example, if i have
 tree with prefixes 00 and 00358 and string to be matched is
 0035892345670, will mt_match() set pv to value associated with 00 or
 00358?  also, if mt_ignore_duplicates is set, will 00358 be considered
 as duplicate of 00 or just prefixes that are exactly same.  finally,
 what are possible mt_tree_type values and what types they stand for?

 -- 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] Dialog module question

2011-06-28 Thread Javier Gallart
Thanks Timo

it looks really promising! I'll stay tuned for upcoming annoucements...

Regards

Javi

On Tue, Jun 28, 2011 at 7:34 PM, Timo Reimann timo.reim...@1und1.de wrote:

 Hey Javier,


 On 28.06.2011 17:53, Javier Gallart wrote:
  I have little experience with the dialog module -so sorry if the
  quesiton is silly-, and I was wondering if I could use it for doing
  accounting (acc works just fine, but I was looking for a unique stop
  record that includes all the call information). The basic idea would be
  to assign the initial INVITE to a profile; and then, when BYE is
  received, build a cdr based of the dialog attributes...but afaik , upon
  reception of the BYE the dialog is destroyed. is there a way to access
  the dlg attributes inside the script when the BYE transaction is
 processed?

 Basically, what you are referring to is dialog-based CDR generation.
 Although it's not possible to do in the current Kamailio, a co-worker of
 mine and me have been working hard lately to implement this specific
 feature. It requires changes to the dialog module (such as allowing
 access to dialogs even after the BYE message is processed, just as you
 mentioned) and extending the acc module by a CDR mode.

 The plan is to get the new code into the project ASAP, certainly by the
 time SR 3.2 is released. So watch out for a new repository branch and an
 announcement on the mailing list to get your hands dirty with the new
 stuff soon.


 Cheers,

 --Timo

___
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] sr-users Digest, Vol 73, Issue 40

2011-06-16 Thread Javier Gallart
Hello

not sure what you want to accomplish, but in case it might help this is how
we use the mtree module.
Our 3 columns are: partition, prefix, route
Partition is just a name that defines a group, this is done inside the
script before calling mt_match (via a table lookup for instance). Let's say
if a call comes from ip x we assign it to partition 400; if it comes from ip
y we assign it to partition 401. Each partition is a different tree.
Consider these entries in the tree table:
400,123456,A
401,123456,A
401,1234567,B

Let's say both x and y send a call with $rU 1234567; mt_match will return A
for ip x, and B for ip y; we use that information for taking further routing
decisions. A common situation might be: x has a unique route for a whole
country while y has that entry but has more defined routes for more specific
area codes inside that country. The column route could also be for instance
the setid of a group of gw's for the dispatcher module, etc...

Regards

Javi



Message: 3
 Date: Tue, 14 Jun 2011 14:27:53 +0200
 From: I?aki Baz Castillo i...@aliax.net
 Subject: Re: [SR-Users] Use of mtree module having multiple trees in
the same table
 To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users   Mailing List sr-users@lists.sip-router.org
 Message-ID: banlktim8h563kuy0yt9ptgosxj6w4qf...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 2011/6/13 jose luis millan doctor...@gmail.com:
  I wonder if anyone could help me understanding how can I use this
  module in a scenario where multiple mtrees are defined behind the same
  database table.
 
  I can't guess how to speficy to 'mt_match' the mtree I want to match
  against, since the 'mtree' module parameter defines a specific memory
  tree based on a specific table, but not based on a specific 'tname'
  value.

 Indeed we have a table with these colums:

 - prefix:string to identify number destination. This is the regex
 column.
 - id_zone:  integer, points to other table. This is the value column.
 - scope:integer, can be 0 or 1.

 So wee need two instances of mtree:
 1) those rows with scope 0.
 2) those rows with scope 1.

 Is it possible with current mtree module? or maybe we'd do better by
 creating two views of the table (one for entries with scope 0 and
 another for entries with scope 1)?

 Thanks a lot.

 --
 I?aki Baz Castillo
 i...@aliax.net




___
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] Use of mtree module having multiple trees in the same table

2011-06-16 Thread Javier Gallart
Hello

not sure what you want to accomplish, but in case it might help this is how
we use the mtree module.
Our 3 columns are: partition, prefix, route
Partition is just a name that defines a group, this is done inside the
script before calling mt_match (via a table lookup for instance). Let's say
if a call comes from ip x we assign it to partition 400; if it comes from ip
y we assign it to partition 401. Each partition is a different tree.
Consider these entries in the tree table:
400,123456,A
401,123456,A
401,1234567,B

Let's say both x and y send a call with $rU 1234567; mt_match will return A
for ip x, and B for ip y; we use that information for taking further routing
decisions. A common situation might be: x has a unique route for a whole
country while y has that entry but has more defined routes for more specific
area codes inside that country. The column route could also be for instance
the setid of a group of gw's for the dispatcher module, etc...

Regards

Javi


 Message: 3
  Date: Tue, 14 Jun 2011 14:27:53 +0200
  From: I?aki Baz Castillo i...@aliax.net
  Subject: Re: [SR-Users] Use of mtree module having multiple trees in
 the same table
  To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
 Users   Mailing List sr-users@lists.sip-router.org
  Message-ID: banlktim8h563kuy0yt9ptgosxj6w4qf...@mail.gmail.com
  Content-Type: text/plain; charset=UTF-8
 
  2011/6/13 jose luis millan doctor...@gmail.com:
   I wonder if anyone could help me understanding how can I use this
   module in a scenario where multiple mtrees are defined behind the same
   database table.
  
   I can't guess how to speficy to 'mt_match' the mtree I want to match
   against, since the 'mtree' module parameter defines a specific memory
   tree based on a specific table, but not based on a specific 'tname'
   value.
 
  Indeed we have a table with these colums:
 
  - prefix:string to identify number destination. This is the regex
  column.
  - id_zone:  integer, points to other table. This is the value column.
  - scope:integer, can be 0 or 1.
 
  So wee need two instances of mtree:
  1) those rows with scope 0.
  2) those rows with scope 1.
 
  Is it possible with current mtree module? or maybe we'd do better by
  creating two views of the table (one for entries with scope 0 and
  another for entries with scope 1)?
 
  Thanks a lot.
 
  --
  I?aki Baz Castillo
  i...@aliax.net
 
 
 
 
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20110616/b928cbd3/attachment.htm
 

 --

 ___
 sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 End of sr-users Digest, Vol 73, Issue 47
 

___
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] no private memory left after mi mt_reload command

2011-02-28 Thread Javier Gallart
Hi Henning

yes, it does. We want to build the logic for acting upon a tree reload
failure -like sending an alarm or something of the kind-. We were deciding
whether to do it at the external java application that actually sends the
xmlrpc request and that will receive the response, or at the kamailo itself,
but I've found no way to access to the command output directly from the
kamailio configuration script. But that's fine, we will just do it outside.

Thanks for everything

Regards

Javi

On Mon, Feb 28, 2011 at 1:38 PM, Henning Westerholt 
henning.westerh...@1und1.de wrote:

 On Friday 25 February 2011, Javier Gallart wrote:
  we are currently doing it looking for error messages in the logs, and
 it´s
  ok, but since the request is processed by the kamailio routing script via
  the xmlrpc module with the dispatch_rpc() command , I was wondering if
  there could be a  way to check the command output inside the same script.

 Hi Javier,

 this xmlrpc transport does not return a result from the command execution
 on
 the server?

 Cheers,

 Henning

___
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] no private memory left after mi mt_reload command

2011-02-21 Thread Javier Gallart
Hi all

we are running kamailio 3.1.1. Basically for every call it has to query a
mtree that is reloaded every 15 minutes. The mtree table is about 4M records
and  is stored in a Pgostgres database. For the reload we use the command mi
mt_reload embedded in a xmlrpc request. The code for this is:
route[XMLRPC]{
if (method == POST || method == GET)
{
if (search(^User-Agent:))
{
xlog(xmlrpc request\n);
set_reply_close();
set_reply_no_connect(); # optional
dispatch_rpc();
}
exit;
}
}
This server has been running with no issued for some weeks now, but at some
point during the weekend the mi command started to fail. This is what the
logs show:

ERROR: core [db_res.c:181]: no private memory left
ERROR: db_postgres [km_res.c:225]: could not allocate rows
ERROR: db_postgres [km_dbase.c:280]: failed to convert rows
ERROR: mtree [mtree_mod.c:627]: Error while fetching result
ERROR: db_postgres [km_dbase.c:318]: invalid parameter value
ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database

I've restarted kamailio and now it's working fine. Should we increase the
private memory? On the other hand, we'd like to detect this failure
condition on the script and act accordingly (for instance sending an email
with an alarm message), is there anyway to do this?

Thanks in advance

Regards

Javier
___
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] no private memory left after mi mt_reload command

2011-02-21 Thread Javier Gallart
Thanks Henning,

I'll go with to recompile option and post the results...

Regards

Javier

2011/2/21 Henning Westerholt henning.westerh...@1und1.de

 On Monday 21 February 2011, Javier Gallart wrote:
  we are running kamailio 3.1.1. Basically for every call it has to query a
  mtree that is reloaded every 15 minutes. The mtree table is about 4M
  records and  is stored in a Pgostgres database. For the reload we use the
  command mi mt_reload embedded in a xmlrpc request. The code for this is:
  route[XMLRPC]{
  if (method == POST || method == GET)
  {
  if (search(^User-Agent:))
  {
  xlog(xmlrpc request\n);
  set_reply_close();
  set_reply_no_connect(); # optional
  dispatch_rpc();
  }
  exit;
  }
  }
  This server has been running with no issued for some weeks now, but at
 some
  point during the weekend the mi command started to fail. This is what the
  logs show:
 
  ERROR: core [db_res.c:181]: no private memory left
  ERROR: db_postgres [km_res.c:225]: could not allocate rows
  ERROR: db_postgres [km_dbase.c:280]: failed to convert rows
  ERROR: mtree [mtree_mod.c:627]: Error while fetching result
  ERROR: db_postgres [km_dbase.c:318]: invalid parameter value
  ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database
 
  I've restarted kamailio and now it's working fine. Should we increase the
  private memory? On the other hand, we'd like to detect this failure
  condition on the script and act accordingly (for instance sending an
 email
  with an alarm message), is there anyway to do this?

 Hi Javier,

 this probably caused of the fragmentation of the internal private memory
 pool
 from the frequent dumps and other load. You could increase the pool, or
 better
 - switch the MI to the system memory pool by uncommenting this line in
 kmi/Makefile

 #DEFS+= -DMI_SYSTEM_MALLOC

 and recompile the server.

 Cheers,

 Henning

___
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] Reconnection to db

2011-01-19 Thread Javier Gallart
Hi Daniel


i just tested the new version, now the mtree module is properly loaded.
Logs when the server has been stopped (fisrt attempt):
r_ctl
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:130]: connection OK
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:159]: sending query ok: 0x92fc00 (7) -
[select tname,tprefix,tvalue from mtree  order by tname]
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: core [db_res.c:118]: allocate 48 bytes for result set at 0x94d020
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:229]: 0x92fc00
PQresultStatus(PGRES_FATAL_ERROR) PQgetResult(0x2b52d00)
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
ERROR: db_postgres [km_dbase.c:247]: 0x92fc00 - invalid query, execution
aborted
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
ERROR: db_postgres [km_dbase.c:249]: 0x92fc00 -
PQresultStatus(PGRES_FATAL_ERROR)
Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
ERROR: db_postgres [km_dbase.c:251]: 0x92fc00: server closed the connection
unexpectedly#012#011This probably means the server terminated
abnormally#012#011before or while processing the request.#012

Server down, second attempt (the server down condition is properly
detected):

Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:133]: connection reset
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:326]: PQclear(0x2b52d00) result set
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
WARNING: db_postgres [km_dbase.c:167]: postgres query command failed,
connection status 1, error [no connection to the server#012]
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:170]: reseting the connection to postgress
server
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
WARNING: db_postgres [km_dbase.c:167]: postgres query command failed,
connection status 1, error [no connection to the server#012]
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:170]: reseting the connection to postgress
server
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
WARNING: db_postgres [km_dbase.c:167]: postgres query command failed,
connection status 1, error [no connection to the server#012]
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:170]: reseting the connection to postgress
server
Jan 19 04:50:18 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
ERROR: db_postgres [km_dbase.c:175]: 0x92fc00 PQsendQuery Error: no
connection to the server#012could not connect to server: Connection
refused#012#011Is the server running on host x.x.x.x and
accepting#012#011TCP/IP connections on port 5432?#012 Query: select
tname,tprefix,tvalue from mtree  order by tname

Server back up (the connection is restarted nad it works fine):

Jan 19 04:50:44 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:133]: connection reset
Jan 19 04:50:44 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:159]: sending query ok: 0x92fc00 (7) -
[select tname,tprefix,tvalue from mtree  order by tname]
Jan 19 04:50:44 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: core [db_res.c:118]: allocate 48 bytes for result set at 0x94d020
Jan 19 04:50:44 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]:
DEBUG: db_postgres [km_dbase.c:229]: 0x92fc00
PQresultStatus(PGRES_TUPLES_OK) PQgetResult(0x2b52d00)


Regards

Javi




On Tue, Jan 18, 2011 at 11:55 AM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,

 I did a new tuning, skipping reconnect in submit query if connection is ok
 - the result might  be broken due to other reasons and will be reported when
 fetching it. If you can try again and report, would be appreciated.

 Thanks,
 Daniel


 On 1/18/11 11:34 AM, Javier Gallart wrote:

 Hi Daniel


 I tested the patch but the mtree module fails to start:
 Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: core [db.c:202]: using
 db bind api for db_postgres
 Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: core [db.c:285]:
 connection 0x931768 not found in pool
 Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
 [km_pg_con.c:51]: db_id = 0x931768
 Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
 [km_pg_con.c:64]: 0x9319b8=pkg_malloc(72)
 Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
 [km_pg_con.c:76]: opening connection: postgres://
 :@79.170.68.171/routing
 Jan 18 04:15:55 kam-test

Re: [SR-Users] Reconnection to db

2011-01-18 Thread Javier Gallart
Hi Daniel


I tested the patch but the mtree module fails to start:
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: core [db.c:202]: using
db bind api for db_postgres
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: core [db.c:285]:
connection 0x931768 not found in pool
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:51]: db_id = 0x931768
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:64]: 0x9319b8=pkg_malloc(72)
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:76]: opening connection: postgres://
:@79.170.68.171/routing
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:80]: PQsetdbLogin(0x2259780)
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: mtree [mtree_mod.c:255]:
database connection opened successfully
Jan 18 04:15:55 kam-test ./kamailio[4616]: WARNING: db_postgres
[km_dbase.c:161]: postgres result check failed with code 7
(PGRES_FATAL_ERROR)
Jan 18 04:15:55 kam-test ./kamailio[4616]: WARNING: db_postgres
[km_dbase.c:165]: postgres query command failed, connection status 0, error
[]
Jan 18 04:15:55 kam-test ./kamailio[4616]: WARNING: db_postgres
[km_dbase.c:165]: postgres query command failed, connection status 0, error
[another command is already in progress#012]
Jan 18 04:15:55 kam-test ./kamailio[4616]: WARNING: db_postgres
[km_dbase.c:165]: postgres query command failed, connection status 0, error
[another command is already in progress#012]
Jan 18 04:15:55 kam-test ./kamailio[4616]: ERROR: db_postgres
[km_dbase.c:173]: 0x931660 PQsendQuery Error: another command is already in
progress#012 Query: select tname,tprefix,tvalue from mtree  order by tname
Jan 18 04:15:55 kam-test ./kamailio[4616]: ERROR: core [db_query.c:101]:
error while submitting query
Jan 18 04:15:55 kam-test ./kamailio[4616]: ERROR: mtree [mtree_mod.c:626]:
Error while querying db
Jan 18 04:15:55 kam-test ./kamailio[4616]: ERROR: mtree [mtree_mod.c:296]:
cannot load trees from database
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: core [db_pool.c:102]:
removing connection from the pool
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:124]: PQfinish(0x2259780)
Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: db_postgres
[km_pg_con.c:128]: pkg_free(0x9319b8)
Jan 18 04:15:55 kam-test ./kamailio[4616]: ERROR: core [sr_module.c:875]:
init_mod(): Error while initializing module mtree
(/usr/local/kamailio.20110117/lib/kamailio/modules/mtree.so)

I don't see an easy way to fix this, because even after the server restart,
PQsendQuery will return 1, and therefore db_postgres_fetch_result is
executed and fails. I will keep looking into this, for now it's not a big
issue since we know that the second attempt works fine


Thanks

Javi

On Sun, Jan 16, 2011 at 11:09 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,

 made a commit to fix in such case, when the broken connection is reported
 after doing actually the query, attempting to reconnect then. Let me know if
 works now.

 Cheers,
 Daniel


 On 1/16/11 6:17 PM, Javier Gallart wrote:

 Hi Daniel,

 I'm using postgres 8.4 at the server and libpq5 library for the client.
 I've been testing again and the problem is that after a db restart (no
 matter if done through a service restart or having t down for some  time),
 the PQstatus(CON_CONNECTION(_con)) function returns a CONNECTION_OK and
 therefore it doesn't try to reconnect. It's on the second attempt of the
 mt_reload that it returns the correct CONNECTION_BAD value, and reconnection
 at that point works perfectly well.

 First attempt after db restart (I've added a dbg message if we get a
 CONNECTION_OK):

 Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
 [km_dbase.c:129]: connection OK
 Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
 [km_dbase.c:155]: sending query ok: 0x92f888 - [select tname,tprefix,tvalue
 from mtree  order by tname]
 Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: core [db_res.c:118]:
 allocate 48 bytes for result set at 0x94cd08
 Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
 [km_dbase.c:222]: 0x92f888 PQresultStatus(PGRES_FATAL_ERROR)
 PQgetResult(0x1a30d10)
 Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
 [km_dbase.c:238]: 0x92f888 - invalid query, execution aborted
 Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
 [km_dbase.c:239]: 0x92f888 - PQresultStatus(PGRES_FATAL_ERROR)
 Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
 [km_dbase.c:240]: 0x92f888: server closed the connection
 unexpectedly#012#011This probably means the server terminated
 abnormally#012#011before or while processing the request.#012

 Second attempt:

 Jan 16 12:03:08 kam-test ./kamailio[22214]: DEBUG: db_postgres
 [km_dbase.c:132]: connection reset
 Jan 16 12:03:08 kam-test ./kamailio[22214]: DEBUG: db_postgres
 [km_dbase.c:315]: PQclear(0x1a30d10) result set
 Jan 16 12:03

Re: [SR-Users] Reconnection to db

2011-01-16 Thread Javier Gallart
Hi Daniel,

I'm using postgres 8.4 at the server and libpq5 library for the client. I've
been testing again and the problem is that after a db restart (no matter if
done through a service restart or having t down for some  time), the
PQstatus(CON_CONNECTION(_con)) function returns a CONNECTION_OK and
therefore it doesn't try to reconnect. It's on the second attempt of the
mt_reload that it returns the correct CONNECTION_BAD value, and reconnection
at that point works perfectly well.

First attempt after db restart (I've added a dbg message if we get a
CONNECTION_OK):

Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:129]: connection OK
Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:155]: sending query ok: 0x92f888 - [select tname,tprefix,tvalue
from mtree  order by tname]
Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: core [db_res.c:118]:
allocate 48 bytes for result set at 0x94cd08
Jan 16 12:03:00 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:222]: 0x92f888 PQresultStatus(PGRES_FATAL_ERROR)
PQgetResult(0x1a30d10)
Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
[km_dbase.c:238]: 0x92f888 - invalid query, execution aborted
Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
[km_dbase.c:239]: 0x92f888 - PQresultStatus(PGRES_FATAL_ERROR)
Jan 16 12:03:00 kam-test ./kamailio[22214]: ERROR: db_postgres
[km_dbase.c:240]: 0x92f888: server closed the connection
unexpectedly#012#011This probably means the server terminated
abnormally#012#011before or while processing the request.#012

Second attempt:

Jan 16 12:03:08 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:132]: connection reset
Jan 16 12:03:08 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:315]: PQclear(0x1a30d10) result set
Jan 16 12:03:08 kam-test ./kamailio[22214]: DEBUG: db_postgres
[km_dbase.c:155]: sending query ok: 0x92f888 - [select tname,tprefix,tvalue
from mtree  order by tname]

Thanks!

Javi



On Fri, Jan 14, 2011 at 11:42 AM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,

 what version of postgres and postgres client library are you using?

 According to the docs from devel manual, this is the function that should
 be used to reconnect:

 PQreset  Resets the communication channel to the server.

 void PQreset(PGconn *conn);

 This function will close the connection to the server and attempt to
 reestablish a new connection to the same server, using all the same
 parameters previously used. This may be useful for error recovery if a
 working connection is lost.

 You may see more here:

 http://www.network-theory.co.uk/docs/postgresql/vol2/DatabaseConnectionControlFunctions.html

 Somehow seems not to work in this case. Can you try also with a shorter
 down time for postgres server, like a normal restart? Would be intrested to
 see if the client side loses somehow connection parameters due to long time
 unconnected.

 Cheers,
 Daniel


 On 1/14/11 11:15 AM, Javier Gallart wrote:

 Hi Daniel


 this is my test:

 1- Kamailio starts and correctly loads the mtree
 2- I make whatever modification in the tree and reload with mt_reload
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue
 from mtree  order by tname]
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:118]:
 allocate 48 bytes for result set at 0x94cd00
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_dbase.c:220]: 0x92f880 PQresultStatus(PGRES_TUPLES_OK)
 PQgetResult(0x29f05f0)
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_res.c:108]: 3 columns returned from the query
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:155]:
 allocate 24 bytes for result names at 0x94cc60
 []
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_res.c:267]: freeing row buffer at 0x94c940
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: mtree [mtree.c:738]:
 adding new tname [1]
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:54]:
 freeing 3 rows
 [...]
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:94]:
 freeing result names at 0x94cc60
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:99]:
 freeing result types at 0x94cbc0
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:136]:
 freeing result set at 0x94cd00
 Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_dbase.c:313]: PQclear(0x29f05f0) result set

 3. Postgres DB restarts (either through restart, or /stop/wait a
 minute/start)
 No log is written in Kamailio when this happens.

 4.- I try again to reload the tree, and these are the logs:
 Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: db_postgres
 [km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue
 from mtree  order by tname]
 Jan 14 04:21:42 kam-test ./kamailio

Re: [SR-Users] Reconnection to db

2011-01-14 Thread Javier Gallart
Hi Daniel


this is my test:

1- Kamailio starts and correctly loads the mtree
2- I make whatever modification in the tree and reload with mt_reload
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue
from mtree  order by tname]
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:118]:
allocate 48 bytes for result set at 0x94cd00
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_dbase.c:220]: 0x92f880 PQresultStatus(PGRES_TUPLES_OK)
PQgetResult(0x29f05f0)
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_res.c:108]: 3 columns returned from the query
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:155]:
allocate 24 bytes for result names at 0x94cc60
[]
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_res.c:267]: freeing row buffer at 0x94c940
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: mtree [mtree.c:738]:
adding new tname [1]
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:54]:
freeing 3 rows
[...]
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:94]:
freeing result names at 0x94cc60
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:99]:
freeing result types at 0x94cbc0
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:136]:
freeing result set at 0x94cd00
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_dbase.c:313]: PQclear(0x29f05f0) result set

3. Postgres DB restarts (either through restart, or /stop/wait a
minute/start)
No log is written in Kamailio when this happens.

4.- I try again to reload the tree, and these are the logs:
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue
from mtree  order by tname]
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:118]:
allocate 48 bytes for result set at 0x94cd00
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: db_postgres
[km_dbase.c:220]: 0x92f880 PQresultStatus(PGRES_FATAL_ERROR)
PQgetResult(0x29ef0a0)
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres
[km_dbase.c:236]: 0x92f880 - invalid query, execution aborted
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres
[km_dbase.c:237]: 0x92f880 - PQresultStatus(PGRES_FATAL_ERROR)
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres
[km_dbase.c:238]: 0x92f880: server closed the connection
unexpectedly#012#011This probably means the server terminated
abnormally#012#011before or while processing the request.#012
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:81]:
freeing 0 columns
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: core [db_res.c:136]:
freeing result set at 0x94cd00
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: mtree [mtree_mod.c:633]:
Error while fetching result
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres
[km_dbase.c:329]: invalid parameter value
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: mtree [mtree_mod.c:744]:
cannot re-load info from database

Thanks in advance


Regards

Javi

On Thu, Jan 13, 2011 at 1:56 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Can you send the log messages (debug=3) for that moment (restart of pg
 server and making a new call/registration)?

 Daniel


 On 1/13/11 12:00 PM, Javier Gallart wrote:

 Hi Daniel

 I have just tested it and I'm getting the same results. This is the
 kamailio version I'm testing:
 root@kam-test:/usr/local/kamailio/sbin# ./kamailio -V
 version: kamailio 3.2.0-dev2 (x86_64/linux) 35568f

 Thanks!

 Javi


 On Tue, Jan 4, 2011 at 3:46 PM, Javier Gallart jgalla...@gmail.comwrote:

 Hi list

  we have been testing the mtree module. We do periodical reloads of the
 mtree table with the mi mt_reload command through xmlrpc. It works fine
 except when the db is restarted. If we manually restart the db and then try
 the mt_reload commands we get this error:
  Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery Error: server
 closed the connection unexpectedly#012#011This probably means the server
 terminated abnormally#012#011before or while processing the request.#012
 Query: select partition,prefix,route from trees  order by partition
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: core [db_query.c:101]: error while submitting query
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: mtree [mtree_mod.c:622]: Error while querying db
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database

  Is there a way to reconnect to the db before sending that command?

  Thanks in advance

  Regards

  Javi



 ___
 SIP Express Router (SER

Re: [SR-Users] Reconnection to db

2011-01-13 Thread Javier Gallart
Hi Daniel

I have just tested it and I'm getting the same results. This is the kamailio
version I'm testing:
root@kam-test:/usr/local/kamailio/sbin# ./kamailio -V
version: kamailio 3.2.0-dev2 (x86_64/linux) 35568f

Thanks!

Javi


On Tue, Jan 4, 2011 at 3:46 PM, Javier Gallart jgalla...@gmail.com wrote:

 Hi list

 we have been testing the mtree module. We do periodical reloads of the
 mtree table with the mi mt_reload command through xmlrpc. It works fine
 except when the db is restarted. If we manually restart the db and then try
 the mt_reload commands we get this error:
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery Error: server
 closed the connection unexpectedly#012#011This probably means the server
 terminated abnormally#012#011before or while processing the request.#012
 Query: select partition,prefix,route from trees  order by partition
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: core [db_query.c:101]: error while submitting query
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: mtree [mtree_mod.c:622]: Error while querying db
 Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
 ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database

 Is there a way to reconnect to the db before sending that command?

 Thanks in advance

 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


Re: [SR-Users] sr-users Digest, Vol 68, Issue 7

2011-01-04 Thread Javier Gallart
Thanks Alex,

it looks like we'll have to move to mysql in that case (we are much more
experienced in postgres). Is this feature expected to be added for
db_postgres?

Regards

Javi


 Message: 6
 Date: Tue, 04 Jan 2011 11:54:20 -0500
 From: Alex Balashov abalas...@evaristesys.com
 Subject: Re: [SR-Users] Reconnection to db
 To: sr-users@lists.sip-router.org
 Message-ID: 4d2350bc.8080...@evaristesys.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 On 01/04/2011 09:46 AM, Javier Gallart wrote:
  Hi list
 
  we have been testing the mtree module. We do periodical reloads of the
  mtree table with the mi mt_reload command through xmlrpc. It works
  fine except when the db is restarted. If we manually restart the db and
  then try the mt_reload commands we get this error:
  Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
  ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery Error: server
  closed the connection unexpectedly#012#011This probably means the server
  terminated abnormally#012#011before or while processing the request.#012
  Query: select partition,prefix,route from trees  order by partition
  Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
  ERROR: core [db_query.c:101]: error while submitting query
  Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
  ERROR: mtree [mtree_mod.c:622]: Error while querying db
  Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
  ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database
 
  Is there a way to reconnect to the db before sending that command?

 Failure to automatically reconnect to Postgres is one of the
 distinguishing features of db_postgres in contrast to db_mysql for the
 moment.

 --
 Alex Balashov - Principal
 Evariste Systems LLC
 260 Peachtree Street NW
 Suite 2200
 Atlanta, GA 30303
 Tel: +1-678-954-0670
 Fax: +1-404-961-1892
 Web: http://www.evaristesys.com/



 --

 ___
 sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 End of sr-users Digest, Vol 68, Issue 7
 ***

___
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] Segmentation fault when loading dialplan

2010-12-06 Thread Javier Gallart
Hello

I haven't been able to fix this problem yet. Has anyone run into a similar
issue?

Thanks

Javi

On Sun, Nov 28, 2010 at 5:39 PM, Javier Gallart jgalla...@gmail.com wrote:

 Hi

 as you say, it also works for me in a 32b architechture (same kamailio
 version,db drivers, insert command, configuration...). I've tried to load
 the same configuration in 2 different Ubuntu 10.04 64b and it fails in both.

 I've applied the ulimit command and then Ive started kamailio with -w /tmp.
 r...@kam-test:/tmp# ls -l core
 -rw--- 1 root root 40361984 2010-11-28 11:23 core

 You will find the core file anasysis here: http://pastebin.ca/2004631

 Thanks

 Javi


 On Sat, Nov 27, 2010 at 10:29 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Helllo,


 On 11/27/10 9:32 AM, Javier Gallart wrote:

 Hi

 sorry if i didn't make myself clear. It's not starting and no core files
 are generated either. The startup logs  are at http://pastebin.ca/2002031

  be sure you do:

 ulimit -c unlimited

 Then give -w parameter with a path where is writable for every user, e.g.:

 /path/to/kamailio -w /tmp -f /path/to/config

 Strange that I test as well ubuntu 10.04, but 32b, and all start fine with
 the same rule.

 Thanks,
 Daniel


 best regards

 javi

 On Fri, Nov 26, 2010 at 7:56 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/26/10 4:30 PM, Javier Gallart wrote:

 Hi Daniel

  no core files are generated after the last upgrade...

 so now is starting ok? Or still fails but no core are generated?

 Cheers,
  DAniel



 Javi




 On Fri, Nov 26, 2010 at 12:32 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/26/10 12:12 PM, Javier Gallart wrote:

 Hi Daniel

  sorry but I'm deeply ignorant of gdb, this is what I get when I try to
 run it:

 use gdb for the core file:

 gdb /path/to/kamailio /path/to/corefile

 Then do the commands I sent.

 Cheers,
 Daniel


 gdb --args  ./kamailio -f ../etc/kamailio/kamailio.cfg
 GNU gdb (GDB) 7.1-ubuntu
 Copyright (C) 2010 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show
 copying
 and show warranty for details.
 This GDB was configured as x86_64-linux-gnu.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
 (gdb) run
 Starting program: /usr/local/kamailio/sbin/kamailio -f
 ../etc/kamailio/kamailio.cfg
 loading modules under
 /usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/
 [Thread debugging using libthread_db enabled]
 Cannot find new threads: generic error


 Regards

 Javi
 On Thu, Nov 25, 2010 at 10:55 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:



 On 11/25/10 4:54 PM, Javier Gallart wrote:

 Hi Daniel

 I completely reinstalled the OS and installed the latest kamailio git,
 but the problem persists, although no core is generated now. Apparently 
 it
 does not depend on the db engine, same thing happens for mysql and 
 postgres.
 You can see the full log here: http://pastebin.ca/2002031
 The architechture details are:
 Ubuntu 10.04.1 LTS \n \l
 Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC
 2010 x86_64 GNU/Linux

  can you send the following output of following commands in gdb?

 # frame 1
 # p rows
 # p *rows
 # p values
 # p *values

 Thanks,
  Daniel


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USA
 http://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com



___
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] Segmentation fault when loading dialplan

2010-12-06 Thread Javier Gallart
Hi Daniel

it's a clean 64 bit instalallation. This is the list of loaded modules:
loadmodule db_mysql.so
#!endif

loadmodule db_postgres.so
loadmodule mi_fifo.so
loadmodule debugger.so
loadmodule kex.so
loadmodule tm.so
loadmodule tmx.so
loadmodule sl.so
loadmodule rr.so
loadmodule pv.so
loadmodule avpops.so
loadmodule maxfwd.so
loadmodule usrloc.so
loadmodule registrar.so
loadmodule textops.so
loadmodule textopsx.so
loadmodule siputils.so
loadmodule xlog.so
loadmodule sanity.so
loadmodule ctl.so
loadmodule mi_rpc.so
loadmodule acc.so
loadmodule cfgutils.so
loadmodule sqlops.so
loadmodule htable.so
loadmodule db_flatstore.so
loadmodule uac_redirect.so
loadmodule dialplan.so
loadmodule auth.so
loadmodule auth_db.so
loadmodule permissions.so


Regards

Javi
On Mon, Dec 6, 2010 at 11:59 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,


 On 12/6/10 11:08 AM, Javier Gallart wrote:

 Hello

 I haven't been able to fix this problem yet. Has anyone run into a similar
 issue?

 is it a clean 64b install, or is a mixed 32b - 64b. I wonder if the modules
 are linked to a different version of the library.

 I will try to get to a 64b for testing, although I was using dialplan on
 such arch many times with older releases.

 Btw, can you paste the list of loaded modules in the config? Just to see
 which ones are using connection to db.

 Cheers,
 Daniel



 Thanks

 Javi

 On Sun, Nov 28, 2010 at 5:39 PM, Javier Gallart jgalla...@gmail.comwrote:

 Hi

 as you say, it also works for me in a 32b architechture (same kamailio
 version,db drivers, insert command, configuration...). I've tried to load
 the same configuration in 2 different Ubuntu 10.04 64b and it fails in both.

 I've applied the ulimit command and then Ive started kamailio with -w
 /tmp.
 r...@kam-test:/tmp# ls -l core
 -rw--- 1 root root 40361984 2010-11-28 11:23 core

 You will find the core file anasysis here: http://pastebin.ca/2004631

 Thanks

 Javi


 On Sat, Nov 27, 2010 at 10:29 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Helllo,


 On 11/27/10 9:32 AM, Javier Gallart wrote:

 Hi

 sorry if i didn't make myself clear. It's not starting and no core files
 are generated either. The startup logs  are at
 http://pastebin.ca/2002031

  be sure you do:

 ulimit -c unlimited

 Then give -w parameter with a path where is writable for every user,
 e.g.:

 /path/to/kamailio -w /tmp -f /path/to/config

 Strange that I test as well ubuntu 10.04, but 32b, and all start fine
 with the same rule.

 Thanks,
  Daniel


 best regards

 javi

 On Fri, Nov 26, 2010 at 7:56 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/26/10 4:30 PM, Javier Gallart wrote:

 Hi Daniel

  no core files are generated after the last upgrade...

 so now is starting ok? Or still fails but no core are generated?

 Cheers,
  DAniel



 Javi




 On Fri, Nov 26, 2010 at 12:32 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/26/10 12:12 PM, Javier Gallart wrote:

 Hi Daniel

  sorry but I'm deeply ignorant of gdb, this is what I get when I try to
 run it:

 use gdb for the core file:

 gdb /path/to/kamailio /path/to/corefile

 Then do the commands I sent.

 Cheers,
 Daniel


 gdb --args  ./kamailio -f ../etc/kamailio/kamailio.cfg
 GNU gdb (GDB) 7.1-ubuntu
 Copyright (C) 2010 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show
 copying
 and show warranty for details.
 This GDB was configured as x86_64-linux-gnu.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
 (gdb) run
 Starting program: /usr/local/kamailio/sbin/kamailio -f
 ../etc/kamailio/kamailio.cfg
 loading modules under
 /usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/
 [Thread debugging using libthread_db enabled]
 Cannot find new threads: generic error


 Regards

 Javi
 On Thu, Nov 25, 2010 at 10:55 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:



 On 11/25/10 4:54 PM, Javier Gallart wrote:

 Hi Daniel

 I completely reinstalled the OS and installed the latest kamailio
 git, but the problem persists, although no core is generated now. 
 Apparently
 it does not depend on the db engine, same thing happens for mysql and
 postgres. You can see the full log here: http://pastebin.ca/2002031
 The architechture details are:
 Ubuntu 10.04.1 LTS \n \l
 Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40
 UTC 2010 x86_64 GNU/Linux

  can you send the following output of following commands in gdb?

 # frame 1
 # p rows
 # p *rows
 # p values
 # p *values

 Thanks,
  Daniel


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USA
 http://www.asipto.com

[SR-Users] Settings adjustments

2010-11-29 Thread Javier Gallart
Hello

I have a Kamailio acting as Redirect server. In some cases I need to include
more that 12 Contact headers in the 302 message. I've set these values in
the config.h file.

#define MAX_BRANCHES20  /*! maximum number of branches per
transaction */
#define MAX_REDIRECTION_LEN 756 /*! maximum length of Contact
header field in redirection replies */

Could these settings cause any collateral damage?

Thanks!

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


Re: [SR-Users] Settings adjustments

2010-11-29 Thread Javier Gallart
Hi


thanks for the reply, I will try with those values...


Javi
On Mon, Nov 29, 2010 at 6:24 PM, Alex Balashov abalas...@evaristesys.comwrote:

 On 11/29/2010 11:57 AM, Javier Gallart wrote:

  Could these settings cause any collateral damage?


 Not really.  They will result in increased memory usage on a small scale;
  they are preprocessor constants that are used to give static sizes to
 character arrays inside dynamically allocated structures.  But it shouldn't
 be a big deal.

 --
 Alex Balashov - Principal
 Evariste Systems LLC
 1170 Peachtree Street NE
 12th Floor, Suite 1200
 Atlanta, GA 30309
 Tel: +1-678-954-0670
 Fax: +1-404-961-1892
 Web: http://www.evaristesys.com/

___
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] Segmentation fault when loading dialplan

2010-11-27 Thread Javier Gallart
Hi

sorry if i didn't make myself clear. It's not starting and no core files are
generated either. The startup logs  are at http://pastebin.ca/2002031

best regards

javi

On Fri, Nov 26, 2010 at 7:56 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,


 On 11/26/10 4:30 PM, Javier Gallart wrote:

 Hi Daniel

 no core files are generated after the last upgrade...

 so now is starting ok? Or still fails but no core are generated?

 Cheers,
 DAniel



 Javi




 On Fri, Nov 26, 2010 at 12:32 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/26/10 12:12 PM, Javier Gallart wrote:

 Hi Daniel

  sorry but I'm deeply ignorant of gdb, this is what I get when I try to
 run it:

 use gdb for the core file:

 gdb /path/to/kamailio /path/to/corefile

 Then do the commands I sent.

 Cheers,
 Daniel


 gdb --args  ./kamailio -f ../etc/kamailio/kamailio.cfg
 GNU gdb (GDB) 7.1-ubuntu
 Copyright (C) 2010 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show copying
 and show warranty for details.
 This GDB was configured as x86_64-linux-gnu.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
 (gdb) run
 Starting program: /usr/local/kamailio/sbin/kamailio -f
 ../etc/kamailio/kamailio.cfg
 loading modules under
 /usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/
 [Thread debugging using libthread_db enabled]
 Cannot find new threads: generic error


 Regards

 Javi
 On Thu, Nov 25, 2010 at 10:55 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:



 On 11/25/10 4:54 PM, Javier Gallart wrote:

 Hi Daniel

 I completely reinstalled the OS and installed the latest kamailio git,
 but the problem persists, although no core is generated now. Apparently it
 does not depend on the db engine, same thing happens for mysql and 
 postgres.
 You can see the full log here: http://pastebin.ca/2002031
 The architechture details are:
 Ubuntu 10.04.1 LTS \n \l
 Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC
 2010 x86_64 GNU/Linux

  can you send the following output of following commands in gdb?

 # frame 1
 # p rows
 # p *rows
 # p values
 # p *values

 Thanks,
  Daniel


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USA
 http://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


___
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] Segmentation fault when loading dialplan

2010-11-26 Thread Javier Gallart
Hi Daniel

sorry but I'm deeply ignorant of gdb, this is what I get when I try to run
it:

gdb --args  ./kamailio -f ../etc/kamailio/kamailio.cfg
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
(gdb) run
Starting program: /usr/local/kamailio/sbin/kamailio -f
../etc/kamailio/kamailio.cfg
loading modules under
/usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error


Regards

Javi
On Thu, Nov 25, 2010 at 10:55 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:



 On 11/25/10 4:54 PM, Javier Gallart wrote:

 Hi Daniel

 I completely reinstalled the OS and installed the latest kamailio git, but
 the problem persists, although no core is generated now. Apparently it does
 not depend on the db engine, same thing happens for mysql and postgres. You
 can see the full log here: http://pastebin.ca/2002031
 The architechture details are:
 Ubuntu 10.04.1 LTS \n \l
 Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC
 2010 x86_64 GNU/Linux

 can you send the following output of following commands in gdb?

 # frame 1
 # p rows
 # p *rows
 # p values
 # p *values

 Thanks,
 Daniel


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USA
 http://www.asipto.com


___
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] Segmentation fault when loading dialplan

2010-11-26 Thread Javier Gallart
Hi Daniel

no core files are generated after the last upgrade...

Javi




On Fri, Nov 26, 2010 at 12:32 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,


 On 11/26/10 12:12 PM, Javier Gallart wrote:

 Hi Daniel

 sorry but I'm deeply ignorant of gdb, this is what I get when I try to run
 it:

 use gdb for the core file:

 gdb /path/to/kamailio /path/to/corefile

 Then do the commands I sent.

 Cheers,
 Daniel


 gdb --args  ./kamailio -f ../etc/kamailio/kamailio.cfg
 GNU gdb (GDB) 7.1-ubuntu
 Copyright (C) 2010 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show copying
 and show warranty for details.
 This GDB was configured as x86_64-linux-gnu.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/...
 Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
 (gdb) run
 Starting program: /usr/local/kamailio/sbin/kamailio -f
 ../etc/kamailio/kamailio.cfg
 loading modules under
 /usr/local/kamailio/lib/kamailio/modules_k/:/usr/local/kamailio/lib/kamailio/modules/
 [Thread debugging using libthread_db enabled]
 Cannot find new threads: generic error


 Regards

 Javi
 On Thu, Nov 25, 2010 at 10:55 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:



 On 11/25/10 4:54 PM, Javier Gallart wrote:

 Hi Daniel

 I completely reinstalled the OS and installed the latest kamailio git,
 but the problem persists, although no core is generated now. Apparently it
 does not depend on the db engine, same thing happens for mysql and postgres.
 You can see the full log here: http://pastebin.ca/2002031
 The architechture details are:
 Ubuntu 10.04.1 LTS \n \l
 Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC
 2010 x86_64 GNU/Linux

  can you send the following output of following commands in gdb?

 # frame 1
 # p rows
 # p *rows
 # p values
 # p *values

 Thanks,
  Daniel


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USA
 http://www.asipto.com



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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


___
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] db_flatstore not loading

2010-11-25 Thread Javier Gallart
Hi Daniel

working now...Thanks!

Regards

Javi

On Wed, Nov 24, 2010 at 10:42 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,

 fetch the latest git version of branch 3.1 and try again. It proved that
 the function to bind to DB API v1 used by k modules was no longer exported
 upon addition of implementation for DB API v2.

 I had no test framework for it, let me know if it works.

 Thanks,
 Daniel


 On 11/24/10 6:50 PM, Javier Gallart wrote:

 Hi

 I'd like to test db_flatstore module at 3.1 to write accounting data. The
 module is not loading though. The config is really simple:
 loadmodule db_flatstore.so
 modparam(acc, db_url, flatstore:/var/log/kamailio/cdr)

 I'm getting this error:
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_bind_api
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_bind_api
 in module db_flatstore not found
  0(27360) DEBUG: core [db.c:210]: using export interface to bind
 db_flatstore
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_use_table not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_use_table
 in module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_init
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_init in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_close
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_close in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_query
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_query in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_fetch_result not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
 db_fetch_result in module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_raw_query not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_raw_query
 in module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_free_result not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
 db_free_result in module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_insert
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_insert in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_delete
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_delete in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_update
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_update in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_replace
 not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_replace in
 module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_last_inserted_id not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
 db_last_inserted_id in module db_flatstore not found
  0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
 db_insert_update not found
  0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
 db_insert_update in module db_flatstore not found
  0(27360) ERROR: core [db.c:79]: module db_flatstore does not export
 db_use_table function
  0(27360) ERROR: acc [acc.c:333]: bind_db failed
  0(27360) ERROR: acc [acc_mod.c:459]: failed...did you load a database
 module?
  0(27360) ERROR: core [sr_module.c:875]: init_mod(): Error while
 initializing module acc
 (/usr/local/kamailio-3.1/lib/kamailio/modules_k/acc.so)
 ERROR: error while initializing modules

 Any idea?

 Thanks in advance

 Javier


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


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


___
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] Segmentation fault when loading dialplan

2010-11-25 Thread Javier Gallart
Hi Daniel

I completely reinstalled the OS and installed the latest kamailio git, but
the problem persists, although no core is generated now. Apparently it does
not depend on the db engine, same thing happens for mysql and postgres. You
can see the full log here: http://pastebin.ca/2002031
The architechture details are:
Ubuntu 10.04.1 LTS \n \l
Linux kam-test 2.6.32-24-server #39-Ubuntu SMP Wed Jul 28 06:21:40 UTC 2010
x86_64 GNU/Linux

Regards

Javi


On Wed, Nov 24, 2010 at 11:18 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:

  Hello,


 On 11/23/10 12:36 PM, Javier Gallart wrote:

 Hi,

  same result after adding a second row in the table.

 I just did a configuration file with dialplan and a record like you showed
 and it started ok. My log messages are pasted next:

  0(10267) DEBUG: db_mysql [km_res.c:136]: use DB1_STRING result type
  0(10267) DEBUG: db_mysql [km_dbase.c:354]: converting row 0 of 1 count 1
  0(10267) DEBUG: core [db_row.c:119]: allocate 160 bytes for row values
 at 0x82f53f4
  0(10267) DEBUG: core [db_val.c:73]: converting INT [1]
  0(10267) DEBUG: core [db_val.c:73]: converting INT [1]
  0(10267) DEBUG: core [db_val.c:73]: converting INT [1]
  0(10267) DEBUG: core [db_val.c:117]: converting STRING [^00]
  0(10267) DEBUG: core [db_val.c:73]: converting INT [0]
  0(10267) DEBUG: core [db_val.c:117]: converting STRING [^00]
  0(10267) DEBUG: core [db_val.c:117]: converting STRING [011]
  0(10267) DEBUG: core [db_val.c:117]: converting STRING [dp1]
  0(10267) DEBUG: dialplan [dp_db.c:387]: build_rule
  0(10267) DEBUG: dialplan [dp_db.c:447]: attrs are dp1
  0(10267) DEBUG: dialplan [dp_db.c:493]: new dpl_id 1
  0(10267) DEBUG: dialplan [dp_db.c:506]: new index , len 0
  0(10267) DEBUG: dialplan [dp_db.c:542]: added the rule id 1 index 0 pr 1
 next (nil) to the index with 0 len
  0(10267) DEBUG: core [db_res.c:54]: freeing 1 rows

 Is it a fresh installation or an update over an older installation? If is
 the second, can you doublecheck to see if all modules were compiled and
 installed at the same time and are no longer older versions?

 Also, what is your operating system and architecture type?

 I tried with both master/devel and 3.1 branches.

 Thanks,
 Daniel



  Regards

  Javier

 On Tue, Nov 23, 2010 at 11:17 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Thanks, I will look over it and try to reproduce in the lab, it may take
 a bit since I am pretty much time offline these days.

 Can you add a second rule and see what happens? At the first sight of the
 debug messages, the result from database is ok, should not be a null value
 there.

 Cheers,
  Daniel


 On 11/23/10 10:38 AM, Javier Gallart wrote:

 Thanks Daniel

  you can find both the gdb and ./kamailio output at
 http://pastebin.ca/1999786

  Regards

  Javier

 On Mon, Nov 22, 2010 at 10:19 PM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 11/22/10 5:32 PM, Javier Gallart wrote:

 Hello

  I'd like to do some tests with the dialplan module, but Kamailio is
 crashing when it loads it. Actually the module is properly loaded if the
 table is empty, but it fails when a row is added; so I guess it's related
 with the way I've inserted the values. A core file is generated:

  Core was generated by `./kamailio -f ../etc/kamailio/kamailio.cfg'.
 Program terminated with signal 11, Segmentation fault.
 #0  build_rule (values=0x0) at dp_db.c:439
  439 new_rule-dpid = VAL_INT(values);

  this looks a bit strange at first sight, 'values' parameter is NULL and
 should not happen. Besides that, in build_rule() functions there are other
 uses of 'values' before line 439, so the crash should have been earlier.

 Please send full backtrace of the core, in gdb, run 'bt' command (or
 better 'bt full').

 Also, if this reproducible, run:

 ./kamailio -f ../etc/kamailio/kamailio.cfg -E -

 and send the output.

 Cheers,
 Daniel


  This is the relevant config:

  #- dialplan params ---
 modparam(dialplan, db_url, mysql://:yy...@localhost/db)
 modparam(dialplan, table_name, dialplan)
 modparam(dialplan, dpid_col, dpid)
 modparam(dialplan, attrs_pvar, $avp(s:dp_attrs))

  mysql describe dialplan;

 +---+--+--+-+-++
 | Field | Type | Null | Key | Default | Extra  |
 +---+--+--+-+-++
 | id| int(10) unsigned | NO   | PRI | NULL| auto_increment |
 | dpid  | int(11)  | NO   | | NULL||
 | pr| int(11)  | NO   | | NULL||
 | match_op  | int(11)  | NO   | | NULL||
 | match_exp | varchar(64)  | NO   | | NULL||
 | match_len | int(11)  | NO   | | NULL||
 | subst_exp | varchar(64)  | NO   | | NULL||
 | repl_exp  | varchar(32)  | NO   | | NULL

[SR-Users] db_flatstore not loading

2010-11-24 Thread Javier Gallart
Hi

I'd like to test db_flatstore module at 3.1 to write accounting data. The
module is not loading though. The config is really simple:
loadmodule db_flatstore.so
modparam(acc, db_url, flatstore:/var/log/kamailio/cdr)

I'm getting this error:
0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_bind_api
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_bind_api in
module db_flatstore not found
 0(27360) DEBUG: core [db.c:210]: using export interface to bind
db_flatstore
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_use_table not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_use_table
in module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_init not
found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_init in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_close
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_close in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_query
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_query in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_fetch_result not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
db_fetch_result in module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_raw_query not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_raw_query
in module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_free_result not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_free_result
in module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_insert
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_insert in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_delete
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_delete in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_update
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_update in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record: db_replace
not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export: db_replace in
module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_last_inserted_id not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
db_last_inserted_id in module db_flatstore not found
 0(27360) DEBUG: core [sr_module.c:631]: find_export_record:
db_insert_update not found
 0(27360) DEBUG: core [sr_module.c:684]: find_mod_export:
db_insert_update in module db_flatstore not found
 0(27360) ERROR: core [db.c:79]: module db_flatstore does not export
db_use_table function
 0(27360) ERROR: acc [acc.c:333]: bind_db failed
 0(27360) ERROR: acc [acc_mod.c:459]: failed...did you load a database
module?
 0(27360) ERROR: core [sr_module.c:875]: init_mod(): Error while
initializing module acc
(/usr/local/kamailio-3.1/lib/kamailio/modules_k/acc.so)
ERROR: error while initializing modules

Any idea?

Thanks in advance

Javier
___
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] Segmentation fault when loading dialplan

2010-11-22 Thread Javier Gallart
Hello

I'd like to do some tests with the dialplan module, but Kamailio is crashing
when it loads it. Actually the module is properly loaded if the table is
empty, but it fails when a row is added; so I guess it's related with the
way I've inserted the values. A core file is generated:

Core was generated by `./kamailio -f ../etc/kamailio/kamailio.cfg'.
Program terminated with signal 11, Segmentation fault.
#0  build_rule (values=0x0) at dp_db.c:439
439 new_rule-dpid = VAL_INT(values);

This is the relevant config:

#- dialplan params ---
modparam(dialplan, db_url, mysql://:yy...@localhost/db)
modparam(dialplan, table_name, dialplan)
modparam(dialplan, dpid_col, dpid)
modparam(dialplan, attrs_pvar, $avp(s:dp_attrs))

mysql describe dialplan;
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| id| int(10) unsigned | NO   | PRI | NULL| auto_increment |
| dpid  | int(11)  | NO   | | NULL||
| pr| int(11)  | NO   | | NULL||
| match_op  | int(11)  | NO   | | NULL||
| match_exp | varchar(64)  | NO   | | NULL||
| match_len | int(11)  | NO   | | NULL||
| subst_exp | varchar(64)  | NO   | | NULL||
| repl_exp  | varchar(32)  | NO   | | NULL||
| attrs | varchar(32)  | NO   | | NULL||
+---+--+--+-+-++
9 rows in set (0.00 sec)

mysql select * from dialplan;
++--++--+---+---+---+--+---+
| id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp |
attrs |
++--++--+---+---+---+--+---+
|  1 |1 |  1 |1 | ^00   | 0 | ^00   | 011  |
dp1   |
++--++--+---+---+---+--+---+
1 row in set (0.00 sec)

I'm probably making some stupid mistake...any clue?

Thanks in advance

Javier
___
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] Drouting usage

2010-10-26 Thread Javier Gallart
Thanks Marius,


that was it.

Regards

Javier

On Mon, Oct 25, 2010 at 10:08 PM, sr-users-requ...@lists.sip-router.orgwrote:

 Send sr-users mailing list submissions to
sr-users@lists.sip-router.org

 To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 or, via email, send a message with subject or body 'help' to
sr-users-requ...@lists.sip-router.org

 You can reach the person managing the list at
sr-users-ow...@lists.sip-router.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of sr-users digest...


 Today's Topics:

   1. Drouting usage (Javier Gallart)
   2. PSTN call (michel freiha)
   3. Re: Drouting usage (marius zbihlei)
   4. bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)
   5. Re: bflag under failure_route (kamailio 1.5)
  (Daniel-Constantin Mierla)
   6. Re: bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)
   7. Re: bflag under failure_route (kamailio 1.5)
  (Daniel-Constantin Mierla)
   8. Re: bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)


 --

 Message: 1
 Date: Mon, 25 Oct 2010 15:16:56 +0200
 From: Javier Gallart jgalla...@gmail.com
 Subject: [SR-Users] Drouting usage
 To: sr-users@lists.sip-router.org
 Message-ID:
aanlktik8pwtu9ut1=mpb_zsnztej5khzprevpubgz...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hello

 sorry if this sounds too newbie. I'm interested in the drouting module.
 The first INVITE is correctly forwarded to the gw foudn in the drouting
 table:
 if (is_method(INVITE)  !has_totag()) {
do_routing(0);
record_route();
}
 However for subsequent messages (ACK, BYE) in the dialog I don't know how
 to
 keep track of the ip resolved by the drouting logic so the messages are
 correctly forwarded to the same gw. I've made some tests using the dialog
 module with no success. Any hint?

 Thanks in advance

 Javier
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/8c5c5a6c/attachment-0001.htm
 

 --

 Message: 2
 Date: Mon, 25 Oct 2010 16:49:24 +0300
 From: michel freiha mich...@gmail.com
 Subject: [SR-Users] PSTN call
 To: us...@lists.kamailio.org
 Message-ID:
aanlktimkdfnxtaarb8gvkdb4haen8ey03wo9mk6mn...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Dear All,

 Can someone help me to connect my kamilio in order to make a PSTN call by
 rewriting host tp PSTN gateway? I changed my config in a manner to do
 that...The line is ringing but as soon as I open the line on other side the
 call will hangup...Please find the piece of code

 # RTPProxy control
 route[RTPPROXY] {
 #!ifdef WITH_NAT
if (is_method(BYE)) {
unforce_rtp_proxy();
} else if (is_method(INVITE)){
 rewritehost(XX.XX.XX.XX);
force_rtp_proxy();
}
if (!has_totag()) add_rr_param(;nat=yes);
 #!endif
return;
 }


 Regards
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/eeae5259/attachment-0001.htm
 

 --

 Message: 3
 Date: Mon, 25 Oct 2010 16:51:32 +0300
 From: marius zbihlei marius.zbih...@1and1.ro
 Subject: Re: [SR-Users] Drouting usage
 To: sr-users@lists.sip-router.org
 Message-ID: 4cc58b64.4040...@1and1.ro
 Content-Type: text/plain; charset=iso-8859-1; Format=flowed

 On 10/25/2010 04:16 PM, Javier Gallart wrote:
  Hello
 
  sorry if this sounds too newbie. I'm interested in the drouting
  module. The first INVITE is correctly forwarded to the gw foudn in the
  drouting table:
  if (is_method(INVITE)  !has_totag()) {
  do_routing(0);
  record_route();
  }
  However for subsequent messages (ACK, BYE) in the dialog I don't know
  how to keep track of the ip resolved by the drouting logic so the
  messages are correctly forwarded to the same gw. I've made some tests
  using the dialog module with no success. Any hint?
 
  Thanks in advance
 
  Javier
 Hello

 You might want to use loose_route() to perform loose routing (defined in
 RFC 3261) of in-dialog requests. (Loose_route also performs strict routing)

 if (has_totag()){
 loose_route();
 t_relay();
 exit;
 }

 Marius

 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/bc0d7d5d/attachment-0001.htm
 

 --

 Message: 4
 Date: Mon, 25 Oct 2010 18:25:17 +0200
 From: I?aki Baz Castillo i...@aliax.net
 Subject: [SR-Users] bflag under failure_route (kamailio 1.5)
 To: SR-Users sr-users@lists.sip-router.org
 Message-ID

Re: [SR-Users] getting unexpected values from htable

2010-10-15 Thread Javier Gallart
Hello

thanksI think It's working now; I had defined the key_type and
value_type columns as char; I've changed them to integer and now it's
showing the correct values.


Regards

Javi
On Fri, Oct 15, 2010 at 12:32 PM, Elena-Ramona Modroiu ram...@asipto.comwrote:

  Hi,


 On 10/14/2010 04:26 PM, Javier Gallart wrote:

 Hi all

  I'm testing the htable module at Kamailio 3.1. Currently it's an
 extremely simple table with a single row loaded from a postgres DB.
 These are the relevant lines in the configuration file:

  modparam(htable, db_url, postgres://user:passw...@localhost
 :5432/database)
 modparam(htable, htable, a=size=2;autoexpire=0;dbtable=h_table;)
 modparam(htable, key_name_column, key_name)
 modparam(htable, key_type_column, key_type)
 modparam(htable, value_type_column, value_type)
 modparam(htable, key_value_column, key_value)

  The only line in the table is:

   key_name | key_value | key_type | value_type
 --+---+--+
  5| 1 | 1| 0


 do you want to store the value in an array-like format? I see you have
 key_type=1


 For key_type 1 the key name in htable should be 5[0] and another item with
 key 5::size should be there, but sht_print() does not show it.

 Are you sure this is the record you had in database? I tested with same
 record but with mysql and it looks ok in sht_print().

 Regards,
 Ramona


  However, sht_print() shows this:

   0(8570) ERROR: htable [ht_api.c:488]: = htable[a] hid: 109 exp: 0
  0(8570) ERROR: htable [ht_api.c:492]: htable[0] -- 0
  0(8570) ERROR: htable [ht_api.c:492]: htable[1] -- 0
  0(8570) ERROR: htable [ht_api.c:492]: htable[2] -- 0
  0(8570) ERROR: htable [ht_api.c:492]: htable[3] -- 1
  0(8570) ERROR: htable [ht_api.c:496]: cell: 5
  0(8570) ERROR: htable [ht_api.c:498]: hid: 51 msize: 74 flags: 0 expire:
 0
  0(8570) ERROR: htable [ht_api.c:502]: v-i:9585128

  Any idea of what might be happening?

  Thanks in advance.




 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://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


[SR-Users] getting unexpected values from htable

2010-10-14 Thread Javier Gallart
Hi all

I'm testing the htable module at Kamailio 3.1. Currently it's an extremely
simple table with a single row loaded from a postgres DB.
These are the relevant lines in the configuration file:

modparam(htable, db_url, postgres://user:passw...@localhost
:5432/database)
modparam(htable, htable, a=size=2;autoexpire=0;dbtable=h_table;)
modparam(htable, key_name_column, key_name)
modparam(htable, key_type_column, key_type)
modparam(htable, value_type_column, value_type)
modparam(htable, key_value_column, key_value)

The only line in the table is:

 key_name | key_value | key_type | value_type
--+---+--+
 5| 1 | 1| 0

However, sht_print() shows this:

 0(8570) ERROR: htable [ht_api.c:488]: = htable[a] hid: 109 exp: 0
 0(8570) ERROR: htable [ht_api.c:492]: htable[0] -- 0
 0(8570) ERROR: htable [ht_api.c:492]: htable[1] -- 0
 0(8570) ERROR: htable [ht_api.c:492]: htable[2] -- 0
 0(8570) ERROR: htable [ht_api.c:492]: htable[3] -- 1
 0(8570) ERROR: htable [ht_api.c:496]: cell: 5
 0(8570) ERROR: htable [ht_api.c:498]: hid: 51 msize: 74 flags: 0 expire: 0
 0(8570) ERROR: htable [ht_api.c:502]: v-i:9585128

Any idea of what might be happening?

Thanks in advance.
___
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