Re: [SR-Users] Can't start Kamailio with both db_postgres and tls

2015-01-28 Thread Olle E. Johansson

On 28 Jan 2015, at 13:57, Daniel-Constantin Mierla mico...@gmail.com wrote:

 To conclude this thread -- it was reported that the patches I did to
 break the initialization of libssl have solved the issue. Postgres
 module connects ok when tls module is loaded. Also, tls connections
 seems to work as expected. Patches are for now in master and 4.2
 branches (backport to 4.1 also considered).
Thank you for working on this!

/O
 
 Cheers,
 Daniel
 
 On 09/01/15 18:30, Daniel-Constantin Mierla wrote:
 Do you have a testbed server where I can login and try couple of
 patches? It might be faster to try to get it solved this way ... Or
 maybe someone can make one server available with postgress and you
 configure it there in a similar way -- I am not a postgres user and no
 resourse to setup something new at this moment.
 
 If not, I will try to give some other steps to try to fix it this way,
 just is going to be probably slow ...
 
 Daniel
 
 On 09/01/15 16:02, Øyvind Kolbu wrote:
 On 07.01.2015 14:27, Daniel-Constantin Mierla wrote:
 So it complains that the ssl lib is not initialized completely.
 
 Can you try the following:
 
 - edit modules/tls/tls_init.c and add at the beginning of function 'int
 init_tls_h(void)':
 
 if(tls_mod_initialized  0) return 0;
 
 - in modules/db_postgres/km_pg_con.c, add:
 
 #include ../../tls_hooks_init.h
 
 - then in same file, before the line you added with PQinitSSL(0); add:
 
 init_tls();
 
 Recompile, reinstall, restart and test only with tls module loaded
 before the db_postgres.
 
 Let's see the results and then I will make a proper patch if works.
 
 
 Crashed again, this time with core dump. Used the following patch:
 --- modules/db_postgres/km_pg_con.c.orig2015-01-09
 15:39:02.411067822 +0100
 +++ modules/db_postgres/km_pg_con.c 2015-01-09 15:40:32.980577115
 +0100
 @@ -29,6 +29,7 @@
 #include ../../mem/mem.h
 #include ../../dprint.h
 #include ../../ut.h
 +#include ../../tls_hooks_init.h
 #include string.h
 #include time.h
 
 @@ -74,6 +75,9 @@
ZSW(id-database));
}
 
 +init_tls();
 +PQinitSSL(0);
 +
ptr-con = PQsetdbLogin(id-host, ports, NULL, NULL,
 id-database, id-username, id-password);
LM_DBG(PQsetdbLogin(%p)\n, ptr-con);
 
 --- modules/tls/tls_init.c.orig 2015-01-09 15:37:16.268298551 +0100
 +++ modules/tls/tls_init.c  2015-01-09 15:38:31.924559696 +0100
 @@ -498,6 +498,8 @@
str s;
cfg_ctx_t* cfg_ctx;
 
 +if(tls_mod_initialized  0) return 0;
 +
 #if OPENSSL_VERSION_NUMBER  0x00907000L
WARN(You are using an old version of OpenSSL ( 0.9.7).
 Upgrade!\n);
 #endif
 
 And got this message:
 /usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:346]: mod_init(): With
 ECDH-Support!
 /usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:349]: mod_init(): With
 Diffie Hellman
 /usr/sbin/kamailio[22789]: INFO: ldap [ldap_mod.c:246]: mod_init():
 OpenLDAP - 20439
 /usr/sbin/kamailio[22789]: INFO: rr [../outbound/api.h:54]:
 ob_load_api(): Failed to import bind_ob
 /usr/sbin/kamailio[22789]: INFO: rr [rr_mod.c:159]: mod_init():
 outbound module not available
 /usr/sbin/kamailio[22789]: INFO: usrloc [hslot.c:53]: ul_init_locks():
 locks array size 512
 /usr/sbin/kamailio[22789]: INFO: tls [tls_init.c:551]: init_tls_h():
 tls: _init_tls_h:  compiled  with  openssl  version OpenSSL
 1.0.1e-fips 11 Feb 2013 (0x1000105f), kerberos support: on,
 compression: on [...]
 /usr/sbin/kamailio[22789]: : core [pt.c:164]: get_max_procs(): BUG:
 get_max_procs() called too early (it must _not_ be called from
 mod_init())
 
 and the following backtrace:
 #0  0x003196e32625 in raise () from /lib64/libc.so.6
 #1  0x003196e33e05 in abort () from /lib64/libc.so.6
 #2  0x0049138f in get_max_procs () at pt.c:165
 #3  0x7f8ca8655106 in init_tls_h () at tls_init.c:598
 #4  0x005372b9 in init_tls () at tls_hooks.c:70
 #5  0x7f8c9fffb655 in db_postgres_new_connection (id=0x7f8ca8d7d0b0)
at km_pg_con.c:78
 #6  0x7f8c9fbd0eaa in db_do_init2 (url=0x7f8c9ca52cd0,
new_connection=0x7f8c9fffac47 db_postgres_new_connection,
pooling=DB_POOLING_PERMITTED) at db.c:320
 #7  0x7f8c9fbd06d5 in db_do_init (url=0x7f8c9ca52cd0,
new_connection=0x7f8c9fffac47 db_postgres_new_connection) at
 db.c:273
 #8  0x7f8c9fff4bbc in db_postgres_init (_url=0x7f8c9ca52cd0)
at km_dbase.c:133
 #9  0x7f8c9c81429f in dlg_connect_db (db_url=0x7f8c9ca52cd0)
at dlg_db_handler.c:132
 #10 0x7f8c9c814457 in init_dlg_db (db_url=0x7f8c9ca52cd0,
dlg_hash_size=4096, db_update_period=60, fetch_num_rows=200)
at dlg_db_handler.c:146
 #11 0x7f8c9c80c7cd in mod_init () at dialog.c:700
 #12 0x004f884d in init_mod (m=0x7f8ca88e82d8) at sr_module.c:967
 #13 0x004f8703 in init_mod (m=0x7f8ca88e8f98) at sr_module.c:964
 #14 0x004f8703 in init_mod (m=0x7f8ca88e94c0) at sr_module.c:964
 
 
 (gdb) bt full
 #0  0x003196e32625 in raise () from 

Re: [SR-Users] Can't start Kamailio with both db_postgres and tls

2015-01-28 Thread Øyvind Kolbu

Great work, thank you!

Best regards,
Øyvind

Den 28.01.2015 13:57, skrev Daniel-Constantin Mierla:

To conclude this thread -- it was reported that the patches I did to
break the initialization of libssl have solved the issue. Postgres
module connects ok when tls module is loaded. Also, tls connections
seems to work as expected. Patches are for now in master and 4.2
branches (backport to 4.1 also considered).

Cheers,
Daniel

On 09/01/15 18:30, Daniel-Constantin Mierla wrote:

Do you have a testbed server where I can login and try couple of
patches? It might be faster to try to get it solved this way ... Or
maybe someone can make one server available with postgress and you
configure it there in a similar way -- I am not a postgres user and no
resourse to setup something new at this moment.

If not, I will try to give some other steps to try to fix it this way,
just is going to be probably slow ...

Daniel

On 09/01/15 16:02, Øyvind Kolbu wrote:

On 07.01.2015 14:27, Daniel-Constantin Mierla wrote:

So it complains that the ssl lib is not initialized completely.

Can you try the following:

- edit modules/tls/tls_init.c and add at the beginning of function 'int
init_tls_h(void)':

if(tls_mod_initialized  0) return 0;

- in modules/db_postgres/km_pg_con.c, add:

#include ../../tls_hooks_init.h

- then in same file, before the line you added with PQinitSSL(0); add:

init_tls();

Recompile, reinstall, restart and test only with tls module loaded
before the db_postgres.

Let's see the results and then I will make a proper patch if works.



Crashed again, this time with core dump. Used the following patch:
--- modules/db_postgres/km_pg_con.c.orig2015-01-09
15:39:02.411067822 +0100
+++ modules/db_postgres/km_pg_con.c 2015-01-09 15:40:32.980577115
+0100
@@ -29,6 +29,7 @@
  #include ../../mem/mem.h
  #include ../../dprint.h
  #include ../../ut.h
+#include ../../tls_hooks_init.h
  #include string.h
  #include time.h

@@ -74,6 +75,9 @@
 ZSW(id-database));
 }

+init_tls();
+PQinitSSL(0);
+
 ptr-con = PQsetdbLogin(id-host, ports, NULL, NULL,
id-database, id-username, id-password);
 LM_DBG(PQsetdbLogin(%p)\n, ptr-con);

--- modules/tls/tls_init.c.orig 2015-01-09 15:37:16.268298551 +0100
+++ modules/tls/tls_init.c  2015-01-09 15:38:31.924559696 +0100
@@ -498,6 +498,8 @@
 str s;
 cfg_ctx_t* cfg_ctx;

+if(tls_mod_initialized  0) return 0;
+
  #if OPENSSL_VERSION_NUMBER  0x00907000L
 WARN(You are using an old version of OpenSSL ( 0.9.7).
Upgrade!\n);
  #endif

And got this message:
/usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:346]: mod_init(): With
ECDH-Support!
/usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:349]: mod_init(): With
Diffie Hellman
/usr/sbin/kamailio[22789]: INFO: ldap [ldap_mod.c:246]: mod_init():
OpenLDAP - 20439
/usr/sbin/kamailio[22789]: INFO: rr [../outbound/api.h:54]:
ob_load_api(): Failed to import bind_ob
/usr/sbin/kamailio[22789]: INFO: rr [rr_mod.c:159]: mod_init():
outbound module not available
/usr/sbin/kamailio[22789]: INFO: usrloc [hslot.c:53]: ul_init_locks():
locks array size 512
/usr/sbin/kamailio[22789]: INFO: tls [tls_init.c:551]: init_tls_h():
tls: _init_tls_h:  compiled  with  openssl  version OpenSSL
1.0.1e-fips 11 Feb 2013 (0x1000105f), kerberos support: on,
compression: on [...]
/usr/sbin/kamailio[22789]: : core [pt.c:164]: get_max_procs(): BUG:
get_max_procs() called too early (it must _not_ be called from
mod_init())

and the following backtrace:
#0  0x003196e32625 in raise () from /lib64/libc.so.6
#1  0x003196e33e05 in abort () from /lib64/libc.so.6
#2  0x0049138f in get_max_procs () at pt.c:165
#3  0x7f8ca8655106 in init_tls_h () at tls_init.c:598
#4  0x005372b9 in init_tls () at tls_hooks.c:70
#5  0x7f8c9fffb655 in db_postgres_new_connection (id=0x7f8ca8d7d0b0)
 at km_pg_con.c:78
#6  0x7f8c9fbd0eaa in db_do_init2 (url=0x7f8c9ca52cd0,
 new_connection=0x7f8c9fffac47 db_postgres_new_connection,
 pooling=DB_POOLING_PERMITTED) at db.c:320
#7  0x7f8c9fbd06d5 in db_do_init (url=0x7f8c9ca52cd0,
 new_connection=0x7f8c9fffac47 db_postgres_new_connection) at
db.c:273
#8  0x7f8c9fff4bbc in db_postgres_init (_url=0x7f8c9ca52cd0)
 at km_dbase.c:133
#9  0x7f8c9c81429f in dlg_connect_db (db_url=0x7f8c9ca52cd0)
 at dlg_db_handler.c:132
#10 0x7f8c9c814457 in init_dlg_db (db_url=0x7f8c9ca52cd0,
 dlg_hash_size=4096, db_update_period=60, fetch_num_rows=200)
 at dlg_db_handler.c:146
#11 0x7f8c9c80c7cd in mod_init () at dialog.c:700
#12 0x004f884d in init_mod (m=0x7f8ca88e82d8) at sr_module.c:967
#13 0x004f8703 in init_mod (m=0x7f8ca88e8f98) at sr_module.c:964
#14 0x004f8703 in init_mod (m=0x7f8ca88e94c0) at sr_module.c:964


(gdb) bt full
#0  0x003196e32625 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x003196e33e05 in abort () from 

Re: [SR-Users] topoh ACK Call-ID mismatch

2015-01-28 Thread Daniel-Constantin Mierla

On 27/01/15 17:40, Daniel Tryba wrote:
 On Tuesday 27 January 2015 11:24:59 Daniel Tryba wrote:
 Works for my 488, will test some more to see if nothing else is broken.
 I was a bit optimistic, patch breaks if the called endpoint responds with a 
 4xx :(

One solution I thought of is to propagate the direction via topoh
'cookie' header, as it is done by the dialog module for the local
generated BYE. Tm code needs to be changed, but I haven't found the time
for it yet.

Being an hob-by-hop ack for a within dialog request, there is no info
that can be used to determine the direction. Topoh hooks are in the
core, after the new sip message is printed, with no relation to
transaction (or in this case, the reply).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/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] Can't start Kamailio with both db_postgres and tls

2015-01-28 Thread Daniel-Constantin Mierla
To conclude this thread -- it was reported that the patches I did to
break the initialization of libssl have solved the issue. Postgres
module connects ok when tls module is loaded. Also, tls connections
seems to work as expected. Patches are for now in master and 4.2
branches (backport to 4.1 also considered).

Cheers,
Daniel

On 09/01/15 18:30, Daniel-Constantin Mierla wrote:
 Do you have a testbed server where I can login and try couple of
 patches? It might be faster to try to get it solved this way ... Or
 maybe someone can make one server available with postgress and you
 configure it there in a similar way -- I am not a postgres user and no
 resourse to setup something new at this moment.

 If not, I will try to give some other steps to try to fix it this way,
 just is going to be probably slow ...

 Daniel

 On 09/01/15 16:02, Øyvind Kolbu wrote:
 On 07.01.2015 14:27, Daniel-Constantin Mierla wrote:
 So it complains that the ssl lib is not initialized completely.

 Can you try the following:

 - edit modules/tls/tls_init.c and add at the beginning of function 'int
 init_tls_h(void)':

 if(tls_mod_initialized  0) return 0;

 - in modules/db_postgres/km_pg_con.c, add:

 #include ../../tls_hooks_init.h

 - then in same file, before the line you added with PQinitSSL(0); add:

 init_tls();

 Recompile, reinstall, restart and test only with tls module loaded
 before the db_postgres.

 Let's see the results and then I will make a proper patch if works.


 Crashed again, this time with core dump. Used the following patch:
 --- modules/db_postgres/km_pg_con.c.orig2015-01-09
 15:39:02.411067822 +0100
 +++ modules/db_postgres/km_pg_con.c 2015-01-09 15:40:32.980577115
 +0100
 @@ -29,6 +29,7 @@
  #include ../../mem/mem.h
  #include ../../dprint.h
  #include ../../ut.h
 +#include ../../tls_hooks_init.h
  #include string.h
  #include time.h

 @@ -74,6 +75,9 @@
 ZSW(id-database));
 }

 +init_tls();
 +PQinitSSL(0);
 +
 ptr-con = PQsetdbLogin(id-host, ports, NULL, NULL,
 id-database, id-username, id-password);
 LM_DBG(PQsetdbLogin(%p)\n, ptr-con);

 --- modules/tls/tls_init.c.orig 2015-01-09 15:37:16.268298551 +0100
 +++ modules/tls/tls_init.c  2015-01-09 15:38:31.924559696 +0100
 @@ -498,6 +498,8 @@
 str s;
 cfg_ctx_t* cfg_ctx;

 +if(tls_mod_initialized  0) return 0;
 +
  #if OPENSSL_VERSION_NUMBER  0x00907000L
 WARN(You are using an old version of OpenSSL ( 0.9.7).
 Upgrade!\n);
  #endif

 And got this message:
 /usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:346]: mod_init(): With
 ECDH-Support!
 /usr/sbin/kamailio[22789]: INFO: tls [tls_mod.c:349]: mod_init(): With
 Diffie Hellman
 /usr/sbin/kamailio[22789]: INFO: ldap [ldap_mod.c:246]: mod_init():
 OpenLDAP - 20439
 /usr/sbin/kamailio[22789]: INFO: rr [../outbound/api.h:54]:
 ob_load_api(): Failed to import bind_ob
 /usr/sbin/kamailio[22789]: INFO: rr [rr_mod.c:159]: mod_init():
 outbound module not available
 /usr/sbin/kamailio[22789]: INFO: usrloc [hslot.c:53]: ul_init_locks():
 locks array size 512
 /usr/sbin/kamailio[22789]: INFO: tls [tls_init.c:551]: init_tls_h():
 tls: _init_tls_h:  compiled  with  openssl  version OpenSSL
 1.0.1e-fips 11 Feb 2013 (0x1000105f), kerberos support: on,
 compression: on [...]
 /usr/sbin/kamailio[22789]: : core [pt.c:164]: get_max_procs(): BUG:
 get_max_procs() called too early (it must _not_ be called from
 mod_init())

 and the following backtrace:
 #0  0x003196e32625 in raise () from /lib64/libc.so.6
 #1  0x003196e33e05 in abort () from /lib64/libc.so.6
 #2  0x0049138f in get_max_procs () at pt.c:165
 #3  0x7f8ca8655106 in init_tls_h () at tls_init.c:598
 #4  0x005372b9 in init_tls () at tls_hooks.c:70
 #5  0x7f8c9fffb655 in db_postgres_new_connection (id=0x7f8ca8d7d0b0)
 at km_pg_con.c:78
 #6  0x7f8c9fbd0eaa in db_do_init2 (url=0x7f8c9ca52cd0,
 new_connection=0x7f8c9fffac47 db_postgres_new_connection,
 pooling=DB_POOLING_PERMITTED) at db.c:320
 #7  0x7f8c9fbd06d5 in db_do_init (url=0x7f8c9ca52cd0,
 new_connection=0x7f8c9fffac47 db_postgres_new_connection) at
 db.c:273
 #8  0x7f8c9fff4bbc in db_postgres_init (_url=0x7f8c9ca52cd0)
 at km_dbase.c:133
 #9  0x7f8c9c81429f in dlg_connect_db (db_url=0x7f8c9ca52cd0)
 at dlg_db_handler.c:132
 #10 0x7f8c9c814457 in init_dlg_db (db_url=0x7f8c9ca52cd0,
 dlg_hash_size=4096, db_update_period=60, fetch_num_rows=200)
 at dlg_db_handler.c:146
 #11 0x7f8c9c80c7cd in mod_init () at dialog.c:700
 #12 0x004f884d in init_mod (m=0x7f8ca88e82d8) at sr_module.c:967
 #13 0x004f8703 in init_mod (m=0x7f8ca88e8f98) at sr_module.c:964
 #14 0x004f8703 in init_mod (m=0x7f8ca88e94c0) at sr_module.c:964


 (gdb) bt full
 #0  0x003196e32625 in raise () from /lib64/libc.so.6
 No symbol table info available.
 #1  0x003196e33e05 in abort () from /lib64/libc.so.6
 No symbol table 

[SR-Users] Registration to Kamailio World 2015 is open

2015-01-28 Thread Daniel-Constantin Mierla
Hello,

I would like to announce that registration to Kamailio World 2015 is open:

  - http://conference.kamailio.com/k03/registration/

The schedule is still work in progress, a preview list with several
speakers is available at:

  - http://conference.kamailio.com/k03/speakers/

The structure of the event contains:
 - pre-conference technical tutorials in the afternoon of May 27, 2015
 - conference presentations during May 28-29, 2015

More details at:
   - http://conference.kamailio.com/k03/schedule/

Looking forward to meeting many of you and have a great time again in
Berlin!

Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/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] Async module taking down our server

2015-01-28 Thread Daniel-Constantin Mierla
Hello,

great that it was sorted out and it was not on Kamailio side :-)

Also, glad to hear that async processing did increase capacity to handle
more concurrent calls, even it was causing troubles to other
applications ...

Cheers,
Daniel

On 28/01/15 05:40, Will Ferrer wrote:
 Hello

 I wanted to give an update on this.

 My business partner that found the issue and has been monitoring the
 problem has tracked down the issue. It turns out that the features we
 implemented using the async module were leading to more calls going on
 con currently (as they were intended to) and this was causing and
 issue with voip monitor. So the issue was not with the Async module.

 All the best.

 Will Ferrer

 Switchsoft

 On Mon, Jan 19, 2015 at 8:43 PM, Will Ferrer
 will.fer...@switchsoft.com mailto:will.fer...@switchsoft.com wrote:

 Hi All

 We are trying to use the async module to to delay sending a bye on
 from one end of the call to the other.

 We are using async_route(routename, seconds) to delay
 the WITHINDLG route. The idea is that in the future we want to be
 able to have our billing min duration enforced (though currently
 we are having issues with the dialog module that we are discussing
 in another thread).

 After running this on our deploy servers, the delays before
 sending on the byes get longer and longer, and then kamailio goes
 down. Then the receive udp buffer fills up.

 We tried it with both 4 and 400 async workers, and it made no
 difference.

 I am including a screen capture of the servers stats when this
 happens taken from voip monitor.

 Here are the relevant parts of the config:

 ...
 loadmodule async.so
 ...
 modparam(async, workers, ASYNC_THREADS)
 ...
 request_route {
 ...
 route(DELAYED_BYE_STATIC);
 ...
 route[DELAYED_BYE_STATIC] {
 xlog(L_DEBUG,route DELAYED_BYE_STATIC);
 #!ifdef WITH_DELAYED_BYE_STATIC
 if (is_method(BYE)) {
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, from self \n);
 #if (from_uri == myself) {
 if ((allow_trusted() || allow_source_address())  from_uri ==
 myself) {
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, Bye detected, from self
 \n);
 send_reply(200, OK);
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, sent 200 about to sleep
 \n);
 setflag(FLT_ACC); # do accounting ...
 setflag(FLT_ACCFAILED); # ... even if the transaction fails
 if (has_totag()) {
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, sleeping to
 WITHINDLG_DELAYED \n);
 async_route(WITHINDLG_DELAYED, MIN_DURATION);
 } else {
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, sleeping to WITHINDLG \n);
 async_route(WITHINDLG, MIN_DURATION);
 }
 xlog(L_DEBUG,route DELAYED_BYE_STATIC, slept\n);
 exit;
 }
 }
 #!endif
 return;
 }
 ...
 route[WITHINDLG_DELAYED] {
 xlog(L_DEBUG, route WITHINDLG_DELAYED: triggered \n);
 $avp(was_delayed) = 1;
 route(WITHINDLG);
 }
 ...
 route[WITHINDLG] {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG triggered, request
 method: $rm \n);
 #!ifdef WITH_DISPATCHER
 if(is_method(BYE|CANCEL)) {
 xlog(L_DEBUG,route WITHINDLG:  cancel or bye detected, request
 method: $rm \n);
 #!ifdef WITH_DISPATCHER_LOAD_AWARE
 xlog(L_DEBUG,route WITHINDLG: running ds_load_update, request
 method: $rm \n);
 ds_load_update();
 #dlg_get ($ci,$ft,$tt); 
#dlg_bye (all);
 #!endif
 }
 #!endif

 if (has_totag() || $avp(was_delayed) == 1) {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG has totag or
 was_delayed: $avp(was_delayed)  \n);
 # sequential request withing a dialog should
 # take the path determined by record-routing
 if (loose_route()) {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG has loose route \n);
 route(DLGURI);
 if (is_method(BYE)) {
 xlog(L_DEBUG,route WITHINDLG: BYE detected);
 setflag(FLT_ACC); # do accounting ...
 setflag(FLT_ACCFAILED); # ... even if the transaction fails
 xlog(L_DEBUG,route WITHINDLG: ACC flag set);
 }
 else if ( is_method(ACK) ) {
 # ACK is forwarded statelessy
 route(NATMANAGE);
 }
 else if ( is_method(NOTIFY) ) {
 # Add Record-Route for in-dialog NOTIFY as per RFC 6665.
 record_route();
 }
 xlog(L_DEBUG, route WITHINDLG: will -- DLG RELAY 1\n);
 route(RELAY);
 } else {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG else \n);
 if (is_method(SUBSCRIBE)  uri == myself) {
 # in-dialog subscribe requests
 route(PRESENCE);
 exit;
 }
 if ( is_method(ACK) ) {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG is ack \n);
 if ( t_check_trans() ) {
 xlog(L_DEBUG, route WITHINDLG: will -- DLG t_check_trans \n);
 # no loose-route, but stateful ACK;
 # must be an ACK after a 487
 # or e.g. 404 from upstream server
 xlog(L_DEBUG, route 

Re: [SR-Users] CDRs for failed calls

2015-01-28 Thread Mickael Marrache
Hi Will,

 

Thanks for your reply!

 

I finally can create transaction records manually by calling commands like 
acc_db_request.

However, I am forced to use a different schema (CDR schema is different than 
transaction schema) but it may make sense.

 

Mickael

 

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Will 
Ferrer
Sent: Wednesday, January 28, 2015 6:08 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] CDRs for failed calls

 

Hi Mickael

 

Have you tried looking at these examples in the ACC module to see if what you 
are looking for can be accomplished at least as far creating ACC records:

 

http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1626120

http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1628288

http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1632512

http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1644232

 

We also use a mysql routine to move ACC into CDRs in the database, so if we 
wan't CDRs for failed calls I would modify our routine to make them.

 

While we do not use it our selves, there is this info here on having the ACC 
module make CDRs: 
http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp91080

 

I hope that helps.

 

All the best.

 

Will Ferrer

 

Switchsoft

 

On Mon, Jan 26, 2015 at 5:23 AM, Mickael Marrache mickaelmarra...@gmail.com 
wrote:

Hi,

 

Is there a way to write CDRs for failed calls?

 

I tried calling the acc_db_request command from my script, but it inserts a 
transaction log not a CDR.

 

Thanks,

Mickael


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

 

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


[SR-Users] usrloc and MongoDB

2015-01-28 Thread Mickael Marrache
Hi,

 

Is it possible to save user location data in a MongoDB database?

 

If not, are you guys using p_usrloc in your projects? Can you please give me
some feedback?

 

Thanks,

Mickael

___
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] Async module taking down our server

2015-01-28 Thread Will Ferrer
Hi Daniel

Yeah I am happy to be able to report the success. Thanks for everything as
always!

I hope you are well.

Will

On Wed, Jan 28, 2015 at 5:54 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,

 great that it was sorted out and it was not on Kamailio side :-)

 Also, glad to hear that async processing did increase capacity to handle
 more concurrent calls, even it was causing troubles to other applications
 ...

 Cheers,
 Daniel


 On 28/01/15 05:40, Will Ferrer wrote:

 Hello

  I wanted to give an update on this.

  My business partner that found the issue and has been monitoring the
 problem has tracked down the issue. It turns out that the features we
 implemented using the async module were leading to more calls going on con
 currently (as they were intended to) and this was causing and issue with
 voip monitor. So the issue was not with the Async module.

  All the best.

  Will Ferrer

  Switchsoft

 On Mon, Jan 19, 2015 at 8:43 PM, Will Ferrer will.fer...@switchsoft.com
 wrote:

 Hi All

 We are trying to use the async module to to delay sending a bye on from
 one end of the call to the other.

 We are using async_route(routename, seconds) to delay
 the WITHINDLG route. The idea is that in the future we want to be able to
 have our billing min duration enforced (though currently we are having
 issues with the dialog module that we are discussing in another thread).

  After running this on our deploy servers, the delays before sending on
 the byes get longer and longer, and then kamailio goes down. Then the
 receive udp buffer fills up.

 We tried it with both 4 and 400 async workers, and it made no difference.

  I am including a screen capture of the servers stats when this happens
 taken from voip monitor.

  Here are the relevant parts of the config:

  ...
 loadmodule async.so
  ...
 modparam(async, workers, ASYNC_THREADS)
  ...
 request_route {
 ...
 route(DELAYED_BYE_STATIC);
  ...
  route[DELAYED_BYE_STATIC] {
  xlog(L_DEBUG,route DELAYED_BYE_STATIC);
  #!ifdef WITH_DELAYED_BYE_STATIC
  if (is_method(BYE)) {
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, from self \n);
  #if (from_uri == myself) {
  if ((allow_trusted() || allow_source_address())  from_uri == myself) {
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, Bye detected, from self \n);
  send_reply(200, OK);
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, sent 200 about to sleep \n);
  setflag(FLT_ACC); # do accounting ...
  setflag(FLT_ACCFAILED); # ... even if the transaction fails
  if (has_totag()) {
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, sleeping to WITHINDLG_DELAYED
 \n);
  async_route(WITHINDLG_DELAYED, MIN_DURATION);
  } else {
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, sleeping to WITHINDLG \n);
  async_route(WITHINDLG, MIN_DURATION);
  }
  xlog(L_DEBUG,route DELAYED_BYE_STATIC, slept\n);
  exit;
  }
  }
  #!endif
  return;
 }
  ...
  route[WITHINDLG_DELAYED] {
  xlog(L_DEBUG, route WITHINDLG_DELAYED: triggered \n);
  $avp(was_delayed) = 1;
  route(WITHINDLG);
 }
  ...
  route[WITHINDLG] {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG triggered, request
 method: $rm \n);
  #!ifdef WITH_DISPATCHER
  if(is_method(BYE|CANCEL)) {
  xlog(L_DEBUG,route WITHINDLG:  cancel or bye detected, request
 method: $rm \n);
  #!ifdef WITH_DISPATCHER_LOAD_AWARE
  xlog(L_DEBUG,route WITHINDLG: running ds_load_update, request
 method: $rm \n);
  ds_load_update();
  #dlg_get ($ci,$ft,$tt);
  #dlg_bye (all);
 #!endif
  }
  #!endif

  if (has_totag() || $avp(was_delayed) == 1) {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG has totag or was_delayed:
 $avp(was_delayed)  \n);
  # sequential request withing a dialog should
  # take the path determined by record-routing
  if (loose_route()) {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG has loose route \n);
  route(DLGURI);
  if (is_method(BYE)) {
  xlog(L_DEBUG,route WITHINDLG: BYE detected);
  setflag(FLT_ACC); # do accounting ...
  setflag(FLT_ACCFAILED); # ... even if the transaction fails
  xlog(L_DEBUG,route WITHINDLG: ACC flag set);
   }
  else if ( is_method(ACK) ) {
  # ACK is forwarded statelessy
  route(NATMANAGE);
  }
  else if ( is_method(NOTIFY) ) {
  # Add Record-Route for in-dialog NOTIFY as per RFC 6665.
  record_route();
  }
  xlog(L_DEBUG, route WITHINDLG: will -- DLG RELAY 1\n);
  route(RELAY);
  } else {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG else \n);
  if (is_method(SUBSCRIBE)  uri == myself) {
  # in-dialog subscribe requests
  route(PRESENCE);
  exit;
  }
  if ( is_method(ACK) ) {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG is ack \n);
  if ( t_check_trans() ) {
  xlog(L_DEBUG, route WITHINDLG: will -- DLG t_check_trans \n);
  # no loose-route, but stateful ACK;
  # must be an ACK after a 487
  # or e.g. 404 from upstream server
  xlog(L_DEBUG, route WITHINDLG: will -- DLG RELAY 2\n);
  route(RELAY);
  exit;
  } else {
  # ACK without matching transaction ... ignore and discard
  exit;
  }
  }
  sl_send_reply(404,Not here);
  }
  exit;
  }
 

Re: [SR-Users] Does forking impact max_inv_lifetime?

2015-01-28 Thread Alex Balashov

Hi,

To return to this topic, it definitely does not appear that 
max_inv_lifetime runs concurrently with the fr_[inv]_timers. The 
documentation suggests that max_inv_lifetime is a transaction-level 
construct that is logically independent of the fr_ timers on any 
particular branch, but that does not appear to be the case.


I tested with a UAS that sends continuous 183 Session Progress ad 
infinitum. My TM parameters are:


   modparam(tm, fr_timer, 3000)# 3 seconds
   modparam(tm, fr_inv_timer, 12)   # was: 4.
   modparam(tm, fr_inv_timer_avp, $avp(inv_timer))
   modparam(tm, max_inv_lifetime, 6)

Now, one critical aspect of this issue is that I initially set 
$avp(inv_timer) to 10 sec to deal with PDD. This is reset to the default 
120s in an onreply_route using t_reset_fr() once a 18x or 2xx reply is 
received:


if(t_check_status(1[1-9][0-9]|200))
t_reset_fr();

The top of my failure_route looks like this:

failure_route[ROUTE_OUTBOUND_TRY_FAILURE] {
if(t_is_canceled()) {
xlog(L_INFO, [FR-ROUTE-OUTBOUND-TRY-FAILURE:$ci] - 
Transaction cancelled\n);

return;
}

if(t_is_expired()) {
xlog(L_INFO, [FR-ROUTE-OUTBOUND-TRY-FAILURE:$ci] - 
			Transaction timed out because max_inv_lifetime has been reached; no 
more attempts will be made\n);


t_reply(503, Service Unavailable);
exit;
}

if(t_branch_timeout()) {
xlog(L_INFO, [FR-ROUTE-OUTBOUND-TRY-FAILURE:$ci] - 
Route attempt timed out\n);
}

...
}

So, my expectation would be that even though the successive 183s cause 
the fr_inv_timer to be reset every time and thus never hit, that 
max_inv_lifetime would kick in at 60 seconds and thus kill the transaction.


Instead, here's what happens:

[Jan 28 16:24:36] Initial INVITE --
[Jan 28 16:24:36] -- 100 Trying
[Jan 28 16:24:38] -- 183 Session Progress
[Jan 28 16:25:26] -- 183 Session Progress
[Jan 28 16:26:01] -- 183 Session Progress
[Jan 28 16:26:03] -- 183 Session Progress
[Jan 28 16:26:25] -- 183 Session Progress
[Jan 28 16:26:59] -- 183 Session Progress
[Jan 28 16:27:31] -- 183 Session Progress
[Jan 28 16:28:03] -- 183 Session Progress
[Jan 28 16:28:25] -- 183 Session Progress
[Jan 28 16:28:59] -- 183 Session Progress
[Jan 28 16:29:26] -- 183 Session Progress
[Jan 28 16:29:36] -- max_inv_lifetime finally hits, and branch is 
CANCEL'd by Kamailio, i.e.


Jan 28 16:29:36 sip /usr/local/sbin/kamailio[5816]: INFO: script: 
[FR-ROUTE-OUTBOUND-TRY-FAILURE:4551-5851-9ab6@x.x.x.x] - Transaction 
timed out because max_inv_lifetime has been reached; no more attempts 
will be made


That's a full 5 minutes later!

Furthermore, if I remove the t_reset_fr() call in the onreply_route and 
don't initialise $avp(inv_timer) to 10 sec, everything works like 
clockwork and max_inv_lifetime does kick in after 60 seconds, as expected.


So, there is definitely some logical connection between the 
fr_[inv]_timers and max_inv_lifetime, although the documentation seems 
to suggest otherwise.


Any insight would be appreciated!

--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States

Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.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


[SR-Users] How the README file in each module's directory is generated?

2015-01-28 Thread Ding Ma
Is there a doc tool? Or just use an editor?
Thanks
___
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] CDRs for failed calls

2015-01-28 Thread Will Ferrer
Hi Mickael

Glad I could help some at least.

I hope all is going well with you and best of luck with your development.

Will

On Wed, Jan 28, 2015 at 8:39 AM, Mickael Marrache mickaelmarra...@gmail.com
 wrote:

 Hi Will,



 Thanks for your reply!



 I finally can create transaction records manually by calling commands like
 acc_db_request.

 However, I am forced to use a different schema (CDR schema is different
 than transaction schema) but it may make sense.



 Mickael



 *From:* sr-users [mailto:sr-users-boun...@lists.sip-router.org] *On
 Behalf Of *Will Ferrer
 *Sent:* Wednesday, January 28, 2015 6:08 AM
 *To:* Kamailio (SER) - Users Mailing List
 *Subject:* Re: [SR-Users] CDRs for failed calls



 Hi Mickael



 Have you tried looking at these examples in the ACC module to see if what
 you are looking for can be accomplished at least as far creating ACC
 records:



 http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1626120

 http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1628288

 http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1632512

 http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp1644232



 We also use a mysql routine to move ACC into CDRs in the database, so if
 we wan't CDRs for failed calls I would modify our routine to make them.



 While we do not use it our selves, there is this info here on having the
 ACC module make CDRs:
 http://kamailio.org/docs/modules/4.0.x/modules/acc.html#idp91080



 I hope that helps.



 All the best.



 Will Ferrer



 Switchsoft



 On Mon, Jan 26, 2015 at 5:23 AM, Mickael Marrache 
 mickaelmarra...@gmail.com wrote:

 Hi,



 Is there a way to write CDRs for failed calls?



 I tried calling the acc_db_request command from my script, but it inserts
 a transaction log not a CDR.



 Thanks,

 Mickael


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



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


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


Re: [SR-Users] Dispatcher weight dont work

2015-01-28 Thread Will Ferrer
Hi Yuri

I shared your issue with my business partner who works on the configs with
me. I had remembered he had some similar issue he pinged me about some time
back.

His response to your issue follows:

Looks like he is missing flags 8 and the trailing ; after weight in attrs.
CREATE TABLE `dispatcher` (
`id`   `setid` `destination` `flags` `priority` `attrs`  `description`
1 1 sip:10.0.0.1 8 1 weight=50;
2 1 sip:10.0.0.2 8 2 weight=50;

To see if it changes is being used by Kamailio run:
kamcmd dispatcher.list

BODY: weight=50  -- this is the raw attrs
WEIGHT: 50 -- this show that the attribute has been processed.

{
NRSETS: 1
RECORDS: {
SET: {
ID: 1
TARGETS: {
DEST: {
URI: sip:10.0.0.1
FLAGS: AP
PRIORITY: 1
ATTRS: {
BODY: weight=50
DUID:
MAXLOAD: 0
WEIGHT: 50
}
}
DEST: {
URI: sip:10.0.0.2
FLAGS: AP
PRIORITY: 1
ATTRS: {
BODY: weight=50
DUID:
MAXLOAD: 0
WEIGHT: 50
}
}
}
}
}
}

I hope that helps.

All the best.

Will

On Tue, Jan 27, 2015 at 3:12 AM, Yuriy Gorlichenko ovoshl...@gmail.com
wrote:

 Hello I use dipatcher  algorithm 8 that works with weight. I added  2
 Asterisks and try to call its with my kam.We use 4.3 version.

 Tthis config select needed dst from database with my scenario.

 if(!ds_select_dst($var(setid), 8))

 $var(setid)- is variable for setting setid that i get from database with
 my own scenario. IT does not matter.

 When running asterisk with weight 90 - all calls goes through it. When I
 starting asterisk with weight 10 -calls going through asterisk 90. When I
 shut down asterisk with weight 90 -calls goes through asterisk 10? but when
 i start asterisk weight 90 all calls goes through sterisk 10 until I shut
 down it.

 root@Kamailio:~# kamailio -v
 version: kamailio 4.3.0-dev3 (x86_64/linux) 8cdbe7
 flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
 DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
 F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
 USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
 ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
 poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
 id: 8cdbe7
 compiled on 01:17:56 Jan 21 2015 with gcc 4.8.2


 id setid   destination  flags priority attrs
 1   2   sip:34.25.123.45:506000  0 weight=10



 2   2   sip:10.0.1.6:506000  0weight=90

 modparam(dispatcher, db_url,DBURL)
 modparam(dispatcher, table_name, dispatcher)
 modparam(dispatcher, setid_col, setid)
 modparam(dispatcher, destination_col, destination)
 modparam(dispatcher, force_dst, 1)
 modparam(dispatcher, flags, 3)
 modparam(dispatcher, dst_avp, $avp(i:271))
 modparam(dispatcher, grp_avp, $avp(i:272))
 modparam(dispatcher, cnt_avp, $avp(i:273))
 modparam(dispatcher, ds_ping_from, sip:proxy@10.0.1.1)
 modparam(dispatcher, ds_ping_interval,15)
 modparam(dispatcher, ds_probing_mode, 1)
 modparam(dispatcher, ds_ping_reply_codes,
 class=2;code=403;code=404;code=484;class=3)
 modparam(tm, reparse_on_dns_failover, 0)


 Thanks

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


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


Re: [SR-Users] why do not support tcp:eth1:5062,only support eht1:5062

2015-01-28 Thread 张顺通
especially i want to use tls:eth1:5063

2015-01-29 15:52 GMT+08:00 张顺通 shuntongzh...@gmail.com:

 what can i do to user tcp:eth1:5062

 2014-11-12 10:53 GMT+08:00 张顺通 shuntongzh...@gmail.com:

 why do not support tcp:eth1:5062,only support eht1:5062?
 I need to bind on eth1 only tcp.



___
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] Core dump while saving user location in mongo

2015-01-28 Thread Mickael Marrache
Hi,

 

When my proxy receives a REGISTER request, it crashes while saving the user
location in MongoDB.

 

This is the backtrace from the core dump:

 

#0  0x003f08e32625 in raise () from /lib64/libc.so.6

#1  0x003f08e33e05 in abort () from /lib64/libc.so.6

#2  0x006196f9 in fm_free (qm=0x7f4368bf7010, p=0x210add0,
file=0x7f4367fd7608 core: db_res.c, func=0x7f4367fd8100
db_free_columns, line=86) at mem/f_malloc.c:588

#3  0x7f4367fc37ab in db_free_columns (_r=0x7f4368ca0430) at db_res.c:86

#4  0x7f4367fc479e in db_free_result (_r=0x7f4368ca0430) at db_res.c:134

#5  0x7f4367da37cb in db_mongodb_free_result (_h=0x7f4368c94718,
_r=0x7f4368ca0430) at mongodb_dbase.c:646

#6  0x7f4367da5d65 in db_mongodb_query (_h=0x7f4368c94718,
_k=0x7fffa03d5550, _op=0x0, _v=0x7fffa03d5510, _c=0x7fffa03d5560, _n=1,
_nc=16, _o=0x7f4365ed2c80, _r=0x7fffa03d5508) at mongodb_dbase.c:783

#7  0x7f4365cac7d2 in db_load_urecord (_c=0x7f4368c94718,
_d=0x7f436154a0e8, _aor=0x7fffa03d59d0) at udomain.c:601

#8  0x7f4365cb1e8e in get_urecord (_d=0x7f436154a0e8,
_aor=0x7fffa03d59d0, _r=0x7fffa03d5760) at udomain.c:1106

#9  0x7f4365a75dea in add_contacts (_m=0x7f4368cbdc40,
_d=0x7f436154a0e8, _a=0x7fffa03d59d0, _mode=1, _use_regid=1) at save.c:832

#10 0x7f4365a77d32 in save (_m=0x7f4368cbdc40, _d=0x7f436154a0e8,
_cflags=4, _uri=0x0) at save.c:986

#11 0x7f4365a606db in w_save2 (_m=0x7f4368cbdc40, _d=0x7f436154a0e8
H\240TaC\177, _cflags=0x4 Address 0x4 out of bounds) at reg_mod.c:447

#12 0x0041d489 in do_action (h=0x7fffa03d6180, a=0x7f4368c71e98,
msg=0x7f4368cbdc40) at action.c:1100

#13 0x00429a7a in run_actions (h=0x7fffa03d6180, a=0x7f4368c71e98,
msg=0x7f4368cbdc40) at action.c:1583

#14 0x0042a0df in run_actions_safe (h=0x7fffa03d7470,
a=0x7f4368c71e98, msg=0x7f4368cbdc40) at action.c:1648

#15 0x00540b7c in rval_get_int (h=0x7fffa03d7470,
msg=0x7f4368cbdc40, i=0x7fffa03d6658, rv=0x7f4368c72830, cache=0x0) at
rvalue.c:924

#16 0x00544db4 in rval_expr_eval_int (h=0x7fffa03d7470,
msg=0x7f4368cbdc40, res=0x7fffa03d6658, rve=0x7f4368c72828) at rvalue.c:1918

#17 0x005451aa in rval_expr_eval_int (h=0x7fffa03d7470,
msg=0x7f4368cbdc40, res=0x7fffa03d6ae0, rve=0x7f4368c72070) at rvalue.c:1926

#18 0x0041ce4e in do_action (h=0x7fffa03d7470, a=0x7f4368c73148,
msg=0x7f4368cbdc40) at action.c:1064

#19 0x00429a7a in run_actions (h=0x7fffa03d7470, a=0x7f4368c71cc0,
msg=0x7f4368cbdc40) at action.c:1583

#20 0x00419dea in do_action (h=0x7fffa03d7470, a=0x7f4368c3bdb8,
msg=0x7f4368cbdc40) at action.c:712

#21 0x00429a7a in run_actions (h=0x7fffa03d7470, a=0x7f4368c33898,
msg=0x7f4368cbdc40) at action.c:1583

#22 0x0042a1a7 in run_top_route (a=0x7f4368c33898,
msg=0x7f4368cbdc40, c=0x0) at action.c:1669

#23 0x0050747e in receive_msg (

buf=0xa6f780 REGISTER sip::5060;transport=tcp
SIP/2.0\r\nVia: SIP/2.0/UDP
X;branch=z9hG4bK242c.26de52a75c8675f6757e0958454a0ad5.0;i=1\r\nv:
SIP/2.0/TCP XX:62051;received=...,

len=1004, rcv_info=0x7fffa03d7760) at receive.c:216

#24 0x00606e76 in udp_rcv_loop () at udp_server.c:521

#25 0x004a5c97 in main_loop () at main.c:1629

#26 0x004aaf2a in main (argc=13, argv=0x7fffa03d7b78) at main.c:2561

 

I tested multiple times, it occurs everytime.

 

Let me know if you need more information.

 

Thanks,

Mickael

___
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 4.2.1 core in timer.c:877

2015-01-28 Thread 张顺通
hi  daniel, look at the following info,thks.

(gdb) bt full
#0  0x005fda98 in timer_list_expire (t=1263625687,
h=0x7fa5e01c19b0, slow_l=0x7fa5e01c3010, slow_mark=325) at timer.c:877
tl = 0x7fa5e03e77d0
ret = 0
#1  0x005fc686 in timer_handler () at timer.c:953
saved_ticks = 1263625687
run_slow_timer = 0
i = 325
__FUNCTION__ = timer_handler
#2  0x005fdd4d in timer_main () at timer.c:992
No locals.
#3  0x004aa571 in main_loop () at main.c:1700
i = 12
pid = 0
si = 0x0
si_desc = udp receiver child=11
sock=10.103.252.159:5160\000\000\b\000\000\000\000\000\000\000\000\200\024\340\245\177\000\000
;\032\000\001\000\000\000(\325\027\340\245\177\000\000
;\032\000\377\177\000\000\214\216N\000\000\000\000\000\335\233}{\000\000\000\000(\325\027\340\245\177\000\000\200\032\000\377\177\000\000\000\000\000\000\001\000\000
nrprocs = 12
__FUNCTION__ = main_loop
#4  0x004af166 in main (argc=11, argv=0x7fff001a3e88) at main.c:2561
cfg_stream = 0x19e15e0
c = -1
r = 0
tmp = 0x7fff001a4681 
tmp_len = 32767
port = 1719808
proto = 32680
options = 0x706ec0
:f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:
ret = -1
seed = 3548653977
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0xb
p = 0x0
__FUNCTION__ = main


(gdb) p *tl

$1 = {next = 0x0, prev = 0x7fa5e01c19b0, expire = 1263625760,
initial_timeout = 80, data = 0x7fa5e03e7750, f = 0x7fa864720942
wait_handler, flags = 513,

  slow_idx = 0}

2015-01-17 0:40 GMT+08:00 Daniel-Constantin Mierla mico...@gmail.com:

  Can you get the output in gdb for:

 p *tl

 ?

 Cheers,
 Daniel


 On 16/01/15 04:29, 张顺通 wrote:

 I user rtimer module :

 loadmodule rtimer.so
   modparam(rtimer, timer, name=p_route;interval=1;mode=1;)
 modparam(rtimer, exec, timer=p_route;route=P_ROUTE)

  application will coredump in sometimes, and core file in below, what's
 the reason?

  Program terminated with signal 11, Segmentation fault.
 #0  0x005fda98 in timer_list_expire (t=1043586690,
 h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
 877 timer.c: No such file or directory.
  in timer.c
 (gdb) bt full
 #0  0x005fda98 in timer_list_expire (t=1043586690,
 h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
 tl = 0x7f9ed47f7e98
 ret = 0
 #1  0x005fc686 in timer_handler () at timer.c:953
 saved_ticks = 1043586690
 run_slow_timer = 0
 i = 268
 __FUNCTION__ = timer_handler
 #2  0x005fdd4d in timer_main () at timer.c:992
 No locals.
 #3  0x004aa571 in main_loop () at main.c:1700
 i = 12
 pid = 0
 si = 0x0
 si_desc = udp receiver child=11
 sock=10.1.*.*:5160\000\000\b\000\000\000\000\000\000\000\000\060S\324\236\177\000\000\060=#z\001\000\000\000(\205V\324\236\177\000\000\060=#z\377\177\000\000\214\216N\000\000\000\000\000\037t\372D\000\000\000\000(\205V\324\236\177\000\000\220@
 #z\377\177\000\000\000\000\000\000\001\000\000
 nrprocs = 12
 __FUNCTION__ = main_loop
 #4  0x004af166 in main (argc=11, argv=0x7fff7a234098) at
 main.c:2561
 cfg_stream = 0x1da75e0
 c = -1
 r = 0
 tmp = 0x7fff7a234681 
 tmp_len = 32767
 port = 2049130512
 proto = 32673
 options = 0x706ec0
 :f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:
 ret = -1
 seed = 220012340
 rfd = 4
 debug_save = 0
 debug_flag = 0
 dont_fork_cnt = 0
 n_lst = 0xb
 p = 0x0
 __FUNCTION__ = main



 ___
 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 Mierlahttp://twitter.com/#!/miconda - 
 http://www.linkedin.com/in/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] usrloc and MongoDB

2015-01-28 Thread Daniel-Constantin Mierla
Hello,

yes, it is possible by using db_mongodb module for usrloc.

Thinking of it, perhaps there is a limitation on handling natted
contacts in DB_ONLY mode (no cache) if you use nathelper, related to
sending options keepalives. You might need to enable pinging all contact.

Storing and retrieving records in mongodb should work fine -- report any
issue on mailing list and it will be fixed.

Cheers,
Daniel


On 28/01/15 16:37, Mickael Marrache wrote:

 Hi,

  

 Is it possible to save user location data in a MongoDB database?

  

 If not, are you guys using p_usrloc in your projects? Can you please
 give me some feedback?

  

 Thanks,

 Mickael



 ___
 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://twitter.com/#!/miconda - http://www.linkedin.com/in/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] How to run Kamailio as a stateful proxy

2015-01-28 Thread Thomas Bäumer
Hello all,

we are are a small network-provider and selling internet via FTTC and
FTTH. To complete the portfolio we also sell telephony via a rented
ClassV Service with provisioning API, but its not our system and not in
our network.
To get more informations about Registration-Status and calls I have now
installed a kamailio as a statefull proxy between the subscriber and the
softwitch:

|--|
|subscriber|\-
|--| \  /| Mobile|
  \  --/ -
|--|   \ |  Class V   |   /   
|subscriber|-| Kamailio || Softswitch |---| PSTN |
|--|   / ||   \   
  /  --\ -
|--| /  \| World |
|subscriber|/-
|--|


I am really new in kamailio, so I just use the configuration named Edge
Proxy Configuration shown in the documentation to the outbound module,
see http://kamailio.org/docs/modules/4.2.x/modules/outbound.html
example 1.1. We dont need NAT and STUN because all our subscribers get
official IPv4 addresses.

Outgoing calls (subscriber - PSTN) are working fine, all SIP messages
pass the Kamailio Proxy. But incoming Calls (World - subscriber) miss
the proxy and will be routed  directly from the Softwitch to the subscriber.
I think because of the Contact-Header in the subscriber REGISTER:

Contact: sip:49xxyyy...@134.xx.yy.zz;uniq=E41120B46C92D3818E72B

This is the IP of the subscriber FritzBox.

So I just added some lines to replace the Contact-Header in the REGISTER
to get all incoming Calls from the Softswitch to the Kamailio:


if (is_method(REGISTER)) {

   if (src_ip==CUSTOMER_NET) {
remove_hf(Route);
add_path();
$du = sip:REGISTRAR_IP:REGISTRAR_PORT;

if ($ct != $null) {

subst('/^Contact:(.*)@[a-zA-Z0-9.]+(.*)$/Contact:\1@KAMAILIO_IP\2/ig');
}
   }
}

and now the Contact-Header looks better:

Contact: sip:49xxyy@KAMAILIO_IP;uniq=E41120B46C92D3818E72B

Now the subscriber is registered on the Softswitch with the IP from the
Kamailio. And now  the Kamailio get the incoming Call, but directly
route it back to the Softwitch and the call failed.

Now my questions:

 - Is the Edge Proxy Configuration right for this setup?
 - How the Kamailio keep all registered IPs and Lines to route an
   incoming Call to the right subscriber?
 - Why the Kamailio route an incoming call directly back to the
   Softswitch?


Thanks a lot.

Regards
  Thomas

___
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] usrloc and MongoDB

2015-01-28 Thread Daniel-Constantin Mierla
Good spot -- I will update the docs.

The query should be implemented with the commit
666ffd55f4d2a14d89bbe7d18f75a9e2d398420b and it is part of 4.2 series.

Cheers,
Daniel

On 28/01/15 17:25, Mickael Marrache wrote:

 Thanks Daniel for your reply, I asked this question because the
 DB_MONGODB documentation states queries don't store the result yet,
 but I guess queries are now supported?

  

 *From:*sr-users [mailto:sr-users-boun...@lists.sip-router.org] *On
 Behalf Of *Daniel-Constantin Mierla
 *Sent:* Wednesday, January 28, 2015 6:20 PM
 *To:* Kamailio (SER) - Users Mailing List
 *Subject:* Re: [SR-Users] usrloc and MongoDB

  

 Hello,

 yes, it is possible by using db_mongodb module for usrloc.

 Thinking of it, perhaps there is a limitation on handling natted
 contacts in DB_ONLY mode (no cache) if you use nathelper, related to
 sending options keepalives. You might need to enable pinging all contact.

 Storing and retrieving records in mongodb should work fine -- report
 any issue on mailing list and it will be fixed.

 Cheers,
 Daniel


 On 28/01/15 16:37, Mickael Marrache wrote:

 Hi,

  

 Is it possible to save user location data in a MongoDB database?

  

 If not, are you guys using p_usrloc in your projects? Can you
 please give me some feedback?

  

 Thanks,

 Mickael




 ___

 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

 sr-users@lists.sip-router.org mailto:sr-users@lists.sip-router.org

 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




 -- 
 Daniel-Constantin Mierla
 http://twitter.com/#!/miconda http://twitter.com/#%21/miconda - 
 http://www.linkedin.com/in/miconda

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/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] usrloc and MongoDB

2015-01-28 Thread Mickael Marrache
Thanks Daniel for your reply, I asked this question because the DB_MONGODB
documentation states queries don't store the result yet, but I guess queries
are now supported?

 

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of
Daniel-Constantin Mierla
Sent: Wednesday, January 28, 2015 6:20 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] usrloc and MongoDB

 

Hello,

yes, it is possible by using db_mongodb module for usrloc.

Thinking of it, perhaps there is a limitation on handling natted contacts in
DB_ONLY mode (no cache) if you use nathelper, related to sending options
keepalives. You might need to enable pinging all contact.

Storing and retrieving records in mongodb should work fine -- report any
issue on mailing list and it will be fixed.

Cheers,
Daniel


On 28/01/15 16:37, Mickael Marrache wrote:

Hi,

 

Is it possible to save user location data in a MongoDB database?

 

If not, are you guys using p_usrloc in your projects? Can you please give me
some feedback?

 

Thanks,

Mickael






___
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://twitter.com/#!/miconda - http://www.linkedin.com/in/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