Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread jenus

Daniel,

Here is the backtrace.

(gdb) backtrace
#0  0x7fe41140e067 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56

#1  0x7fe41140f448 in __GI_abort () at abort.c:89
#2  0x7fe41144c1b4 in __libc_message (do_abort=do_abort@entry=1, 
fmt=fmt@entry=0x7fe411541210 "*** Error in `%s': %s: 0x%s ***\n") at 
../sysdeps/posix/libc_fatal.c:175
#3  0x7fe41145198e in malloc_printerr (action=1, str=0x7fe41153d42a 
"realloc(): invalid next size", ptr=) at malloc.c:4996
#4  0x7fe41145476b in _int_realloc (av=av@entry=0x7fe41177e620 
, oldp=oldp@entry=0x21789c0, oldsize=oldsize@entry=736, 
nb=nb@entry=1552) at malloc.c:4234
#5  0x7fe411455769 in __GI___libc_realloc (oldmem=0x21789d0, 
bytes=1536) at malloc.c:3029
#6  0x7fe40c460cae in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#7  0x7fe40c45c9aa in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#8  0x7fe40c46166d in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#9  0x7fe40c4640b3 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#10 0x7fe40c45ccd1 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#11 0x7fe40c45c92e in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#12 0x7fe40c45d7bb in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#13 0x7fe40c45d8c2 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#14 0x7fe40c459528 in lua_load () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#15 0x7fe40c469d8c in luaL_loadbuffer () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0

#16 0x7fe40c6fe7d7 in lua_sr_init_probe () at app_lua_api.c:228
#17 0x7fe40c68a97d in child_init (rank=-127) at app_lua_mod.c:197
#18 0x00549944 in init_mod_child (m=0x7fe410c3b998, rank=-127) 
at core/sr_module.c:938
#19 0x00549662 in init_mod_child (m=0x7fe410c3bec0, rank=-127) 
at core/sr_module.c:935
#20 0x00549662 in init_mod_child (m=0x7fe410c3c708, rank=-127) 
at core/sr_module.c:935
#21 0x00549662 in init_mod_child (m=0x7fe410c3cd78, rank=-127) 
at core/sr_module.c:935
#22 0x00549662 in init_mod_child (m=0x7fe410c3d360, rank=-127) 
at core/sr_module.c:935
#23 0x00549662 in init_mod_child (m=0x7fe410c3e1e8, rank=-127) 
at core/sr_module.c:935
#24 0x00549662 in init_mod_child (m=0x7fe410c3e938, rank=-127) 
at core/sr_module.c:935
#25 0x00549662 in init_mod_child (m=0x7fe410c3f4c8, rank=-127) 
at core/sr_module.c:935
#26 0x00549662 in init_mod_child (m=0x7fe410c3fca0, rank=-127) 
at core/sr_module.c:935
#27 0x00549662 in init_mod_child (m=0x7fe410c40118, rank=-127) 
at core/sr_module.c:935
#28 0x00549662 in init_mod_child (m=0x7fe410c40780, rank=-127) 
at core/sr_module.c:935
#29 0x00549662 in init_mod_child (m=0x7fe410c422f8, rank=-127) 
at core/sr_module.c:935
#30 0x00549662 in init_mod_child (m=0x7fe410c42968, rank=-127) 
at core/sr_module.c:935
#31 0x00549662 in init_mod_child (m=0x7fe410c42e50, rank=-127) 
at core/sr_module.c:935
#32 0x00549662 in init_mod_child (m=0x7fe410c43b48, rank=-127) 
at core/sr_module.c:935
#33 0x00549662 in init_mod_child (m=0x7fe410c43f20, rank=-127) 
at core/sr_module.c:935
#34 0x00549662 in init_mod_child (m=0x7fe410c446e0, rank=-127) 
at core/sr_module.c:935
#35 0x00549662 in init_mod_child (m=0x7fe410c44bd0, rank=-127) 
at core/sr_module.c:935
#36 0x00549662 in init_mod_child (m=0x7fe410c44ec8, rank=-127) 
at core/sr_module.c:935
#37 0x00549662 in init_mod_child (m=0x7fe410c45378, rank=-127) 
at core/sr_module.c:935
#38 0x00549662 in init_mod_child (m=0x7fe410c458f0, rank=-127) 
at core/sr_module.c:935
#39 0x00549662 in init_mod_child (m=0x7fe410c45e48, rank=-127) 
at core/sr_module.c:935
#40 0x00549662 in init_mod_child (m=0x7fe410c464e8, rank=-127) 
at core/sr_module.c:935
#41 0x00549662 in init_mod_child (m=0x7fe410c47278, rank=-127) 
at core/sr_module.c:935
#42 0x00549662 in init_mod_child (m=0x7fe410c476f0, rank=-127) 
at core/sr_module.c:935
#43 0x00549662 in init_mod_child (m=0x7fe410c47b68, rank=-127) 
at core/sr_module.c:935

#44 0x00549c72 in init_child (rank=-127) at core/sr_module.c:964
#45 0x00422c1c in main_loop () at main.c:1576
#46 0x0042aab9 in main (argc=3, argv=0x7ffe17f0e788) at 
main.c:2646



Jan

Daniel-Constantin Mierla schreef op 2018-01-09 22:21:

Can you install the debug symbols for kamailio as well? There should be
a kamailio-dbg package or so ...

Then take again the backtrace, it should provide more information --
file and line for each frame, ...

Cheers,
Daniel


On 09.01.18 21:21, je...@cyberchaos.nl wrote:

Daniel,

Just upgraded to 5.1 but kamailio now generates a core file. I'm
running debian 8.10. It seems to crash on liblua5.1.so.0 :

Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `kamailio -m 1500'

Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread Daniel-Constantin Mierla
Can you install the debug symbols for kamailio as well? There should be
a kamailio-dbg package or so ...

Then take again the backtrace, it should provide more information --
file and line for each frame, ...

Cheers,
Daniel


On 09.01.18 21:21, je...@cyberchaos.nl wrote:
> Daniel,
>
> Just upgraded to 5.1 but kamailio now generates a core file. I'm
> running debian 8.10. It seems to crash on liblua5.1.so.0 :
>
> Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `kamailio -m 1500'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x7f30c17f25a0 in ?? () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> (gdb) backtrace
> #0  0x7f30c17f25a0 in ?? () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> #1  0x7f30c17f3b62 in ?? () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> #2  0x7f30c17e6040 in lua_settable () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> #3  0x7f30c17f6412 in luaL_findtable () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> #4  0x7f30c17f6581 in luaL_openlib () from
> /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
> #5  0x7f30c1a40870 in lua_sr_kemi_register_libs () from
> /usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
> #6  0x7f30c1a8b107 in lua_sr_openlibs () from
> /usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
> #7  0x7f30c1a8b7c1 in lua_sr_init_probe () from
> /usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
> #8  0x7f30c1a1797d in ?? () from
> /usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
> #9  0x00549944 in ?? ()
> #10 0x00549c72 in init_child ()
> #11 0x00421498 in main_loop ()
> #12 0x0042aab9 in main ()
>
>
>
> Thanks,
>
> Jan
>
> je...@cyberchaos.nl schreef op 2018-01-09 20:53:
>> Daniel,
>>
>> Currently running kamailio 5.0.5.
>>
>> Jan
>>
>> Daniel-Constantin Mierla schreef op 2018-01-09 13:27:
>>> Hello,
>>>
>>> what version of kamailio are you using?
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 07.01.18 22:14, je...@cyberchaos.nl wrote:
 Hello,

 I'm doing some tests with a lua script and app_lua. I'm using
 sr.sqlops.query to insert records into the database but would like to
 test the exit status of the sql query. In kamailio i can do:

 if(!sql_query("kamailio", "INSERT INTO subscriber ..."))

 Is there some kind of exit status for the lua function sr.sqlops.query
 in order to do the same check in lua? In other words, is it possible
 to check if a sql query was successful in lua? The result seems to be
 nill in all cases for a INSERT in lua using sr.sqlops.query.


 Thanks,

 Jan Hazenberg

 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

I needed to know in order to suggest use of "KSR" package or not,
instead of "sr". The "sr" package likely to be obsoleted soon, as KSR
has lot more exported functions and it is part of the kemi framework. See:

http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/

http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#sqlops

However, 5.0 doesn't have so many KSR exports as 5.1, and not sure if
KSR has the sqlops exports in that version -- too late to check more in
the code now...

Looking at the code, sr.sqlops.query() should return -1 in case of error
and 0 if ok.

Cheers,
Daniel

On 09.01.18 20:53, je...@cyberchaos.nl wrote:
> Daniel,
>
> Currently running kamailio 5.0.5.
>
> Jan
>
> Daniel-Constantin Mierla schreef op 2018-01-09 13:27:
>> Hello,
>>
>> what version of kamailio are you using?
>>
>> Cheers,
>> Daniel
>>
>>
>> On 07.01.18 22:14, je...@cyberchaos.nl wrote:
>>> Hello,
>>>
>>> I'm doing some tests with a lua script and app_lua. I'm using
>>> sr.sqlops.query to insert records into the database but would like to
>>> test the exit status of the sql query. In kamailio i can do:
>>>
>>> if(!sql_query("kamailio", "INSERT INTO subscriber ..."))
>>>
>>> Is there some kind of exit status for the lua function sr.sqlops.query
>>> in order to do the same check in lua? In other words, is it possible
>>> to check if a sql query was successful in lua? The result seems to be
>>> nill in all cases for a INSERT in lua using sr.sqlops.query.
>>>
>>>
>>> Thanks,
>>>
>>> Jan Hazenberg
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread jenus
If i use the default config and load app_lua.so there it starts fine. 
But with my own config only loading (no app_lua params) the app_lua.so 
module seems to crash kamailio.


Jan

je...@cyberchaos.nl schreef op 2018-01-09 21:21:

Daniel,

Just upgraded to 5.1 but kamailio now generates a core file. I'm
running debian 8.10. It seems to crash on liblua5.1.so.0 :

Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".

Core was generated by `kamailio -m 1500'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7f30c17f25a0 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0

(gdb) backtrace
#0  0x7f30c17f25a0 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#1  0x7f30c17f3b62 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0

#2  0x7f30c17e6040 in lua_settable () from
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#3  0x7f30c17f6412 in luaL_findtable () from
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#4  0x7f30c17f6581 in luaL_openlib () from
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#5  0x7f30c1a40870 in lua_sr_kemi_register_libs () from
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#6  0x7f30c1a8b107 in lua_sr_openlibs () from
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#7  0x7f30c1a8b7c1 in lua_sr_init_probe () from
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#8  0x7f30c1a1797d in ?? () from
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#9  0x00549944 in ?? ()
#10 0x00549c72 in init_child ()
#11 0x00421498 in main_loop ()
#12 0x0042aab9 in main ()



Thanks,

Jan

je...@cyberchaos.nl schreef op 2018-01-09 20:53:

Daniel,

Currently running kamailio 5.0.5.

Jan

Daniel-Constantin Mierla schreef op 2018-01-09 13:27:

Hello,

what version of kamailio are you using?

Cheers,
Daniel


On 07.01.18 22:14, je...@cyberchaos.nl wrote:

Hello,

I'm doing some tests with a lua script and app_lua. I'm using
sr.sqlops.query to insert records into the database but would like 
to

test the exit status of the sql query. In kamailio i can do:

if(!sql_query("kamailio", "INSERT INTO subscriber ..."))

Is there some kind of exit status for the lua function 
sr.sqlops.query

in order to do the same check in lua? In other words, is it possible
to check if a sql query was successful in lua? The result seems to 
be

nill in all cases for a INSERT in lua using sr.sqlops.query.


Thanks,

Jan Hazenberg

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread jenus

Daniel,

Just upgraded to 5.1 but kamailio now generates a core file. I'm running 
debian 8.10. It seems to crash on liblua5.1.so.0 :


Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".

Core was generated by `kamailio -m 1500'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7f30c17f25a0 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0

(gdb) backtrace
#0  0x7f30c17f25a0 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#1  0x7f30c17f3b62 in ?? () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#2  0x7f30c17e6040 in lua_settable () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#3  0x7f30c17f6412 in luaL_findtable () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#4  0x7f30c17f6581 in luaL_openlib () from 
/usr/lib/x86_64-linux-gnu/liblua5.1.so.0
#5  0x7f30c1a40870 in lua_sr_kemi_register_libs () from 
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#6  0x7f30c1a8b107 in lua_sr_openlibs () from 
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#7  0x7f30c1a8b7c1 in lua_sr_init_probe () from 
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so
#8  0x7f30c1a1797d in ?? () from 
/usr/lib/x86_64-linux-gnu/kamailio/modules/app_lua.so

#9  0x00549944 in ?? ()
#10 0x00549c72 in init_child ()
#11 0x00421498 in main_loop ()
#12 0x0042aab9 in main ()



Thanks,

Jan

je...@cyberchaos.nl schreef op 2018-01-09 20:53:

Daniel,

Currently running kamailio 5.0.5.

Jan

Daniel-Constantin Mierla schreef op 2018-01-09 13:27:

Hello,

what version of kamailio are you using?

Cheers,
Daniel


On 07.01.18 22:14, je...@cyberchaos.nl wrote:

Hello,

I'm doing some tests with a lua script and app_lua. I'm using
sr.sqlops.query to insert records into the database but would like to
test the exit status of the sql query. In kamailio i can do:

if(!sql_query("kamailio", "INSERT INTO subscriber ..."))

Is there some kind of exit status for the lua function 
sr.sqlops.query

in order to do the same check in lua? In other words, is it possible
to check if a sql query was successful in lua? The result seems to be
nill in all cases for a INSERT in lua using sr.sqlops.query.


Thanks,

Jan Hazenberg

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread jenus

Daniel,

Currently running kamailio 5.0.5.

Jan

Daniel-Constantin Mierla schreef op 2018-01-09 13:27:

Hello,

what version of kamailio are you using?

Cheers,
Daniel


On 07.01.18 22:14, je...@cyberchaos.nl wrote:

Hello,

I'm doing some tests with a lua script and app_lua. I'm using
sr.sqlops.query to insert records into the database but would like to
test the exit status of the sql query. In kamailio i can do:

if(!sql_query("kamailio", "INSERT INTO subscriber ..."))

Is there some kind of exit status for the lua function sr.sqlops.query
in order to do the same check in lua? In other words, is it possible
to check if a sql query was successful in lua? The result seems to be
nill in all cases for a INSERT in lua using sr.sqlops.query.


Thanks,

Jan Hazenberg

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio-5.0.5 active/passive pcs/cluster with rtpengine - how to fix calls after failover

2018-01-09 Thread Karsten Horsmann
Hello Daniel,

yes the extra rtpengine server would also an solution but what is if that
fails. Two of them are maybe or more.

But that makes the public ip stuff more tricky.

And I found the dialog modules (there are two of them) would be also a good
idea. But brings more complexity to kamailio.cfg.

Thanks for the hints.



Am 09.01.2018 1:36 nachm. schrieb "Daniel-Constantin Mierla" <
mico...@gmail.com>:

> Hello,
>
> maybe not directly related to the issue, but could be better to separate
> rtpengine on its own system, likely it requires less failover scenarios, so
> active calls are not affected at all if you have to do a failover for the
> signaling server...
>
> Anyhow, as you trigger a failover and you know it is not going to recover
> the active calls, you can close them via dialog module.
>
> Cheers,
> Daniel
>
> On 05.01.18 09:45, Karsten Horsmann wrote:
>
> Hi Daniel,
>
> Yes, they are.
>
> At this point I using only one redis key space for both rtpengines. I just
> fire it up on the backup machine so it reads the RTP sessions from redis.
>
> Both rtpengines had the same configuration. Only one is active.
>
> But I found the nice redis key space separated and active / active -
> multiple rtpengine feature for it. Not implemented this at the moment.
>
> Am 05.01.2018 8:49 vorm. schrieb "Daniel-Constantin Mierla" <
> mico...@gmail.com>:
>
>> Hello,
>>
>> are kamailio and rtpenigine on same system?
>>
>> Cheers,
>> Daniel
>>
>> On 04.01.18 12:21, Karsten Horsmann wrote:
>>
>> Hello List,
>>
>> and also an happy new year to everyone.
>>
>> I use CentOS 7.4.x with kamailio 5.0.5 and rtpengine on a
>> pacemaker/corosync cluster
>> in front of an internal kamailio siprouter and media-services.
>>
>> If i did an "pcs node standby" to failover my frontend-kamailio (udp/tcp
>> 5060, udp/tcp 5061-tls and tcp websocket-secure) i noticed the following
>> scenarios:
>>
>> 1) Plain RTP: just stocks a few seconds and flows. Everything fine.
>> 2) SDES/RTP: silence - but REINVITE manually in my client brings audio
>> back. Need improvement.
>> 3) DTLS/RTP WebRTC: silence - all clients shows an active call. I know
>> that there is NO way to recover this call - because of the temporay DTLS
>> certificate due the rtpengine start-up.
>>
>>
>> So i thought - for scenario1) i dont need anything to do. Works nice.
>> For scenario2) i need something to "remember its SDES/RTP calls and send
>> them an REINVITE"
>> And for scenario3) i should just hangup all WebRTC calls - IMHO the best
>> for that.
>>
>> How can i fire-up these tasks to get an "clean-up" or "reinvite" after an
>> failover?
>>
>>
>> scenario legend:
>> 1) unencrypted call
>> 2) TLS/SDES encrypted call
>> 3) DTÖS WebRTC encrypted call
>>
>> --
>> Kind Regards
>> *Karsten Horsmann*
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing 
>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlawww.twitter.com/miconda -- 
>> www.linkedin.com/in/miconda
>> Kamailio Advanced Training - www.asipto.com
>> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
>>
>>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] t_relay dying ?

2018-01-09 Thread Jean Cérien
Many thanks, I've managed to handle a call properly.

I really want to thank Daniel, and all that have helped on this subject.

Regards
J.

On Mon, Jan 8, 2018 at 11:42 PM, Joel Serrano  wrote:

> Just a hint here, try setting $du and then t_relay...
>
> On Mon, Jan 8, 2018 at 11:55 Jean Cérien  wrote:
>
>>
>> Hi
>>
>> While I'm trying to get the provider fix the SBC, I am implementing the
>> workaround.
>>
>> Almost done here, storing and retrieving the correct address is fine, but
>> when I set my $ru to the corrected value (asterisk IP), the t_relay still
>> sends the packet to the kamailio IP -
>>
>> $ru="sip:number@asteriskip:5060";
>> if (!t_relay()) {
>> 
>>
>> Why would the t_relay forward to the kamailio IP and not the asterisk ?
>>
>> Rgds
>> J
>>
>>
>> On Mon, Jan 8, 2018 at 11:49 AM, Jean Cérien 
>> wrote:
>>
>>> Many, many thanks !
>>>
>>> I've posted the full dialog unredacted here: https://pastebin.com/
>>> EE9iwgZf
>>>
>>> The OK from Kamailio back to VOIP provider has
>>> Record-Route: >> -;did=e0c.e0a1>
>>> Contact: 
>>>
>>> So my understanding is that the ACK should be
>>> ACK sip:NUMBER@ASTERISKIP:5060 SIP/2.0
>>> 
>>> and not
>>> ACK sip:NUMBER@KAMAILIOIP:5060 SIP/2.0
>>>
>>> Am I understanding correctly ?
>>>
>>> Rgds
>>> J
>>>
>>> On Mon, Jan 8, 2018 at 11:28 AM, Sebastian Damm  wrote:
>>>
 Hi,

 On Mon, Jan 8, 2018 at 2:39 PM, Jean Cérien 
 wrote:

>
> Thanks for this answer. The voip provider is not really eager to alter
> its SBC as it considers that the contact field is not mandatory in the 
> ACK.
> The RFC states (section 8.1.1.8)
>

 The problem is not that the ACK doesn't carry a Contact header. The
 problem is that the ACK is constructed incorrectly. This is what the RfC
 says to UAC behavior (section 12.1.2):

 The route set MUST be set to the list of URIs in the Record-Route
 header field from the response, taken in reverse order and preserving all
 URI parameters. If no Record-Route header field is present in the response,
 the route set MUST be set to the empty set. This route set, even if empty,
 overrides any pre-existing route set for future requests in this dialog. 
 *The
 remote target MUST be set to the URI from the Contact header field of the
 response.*

 This is what the carrier's SBC gets wrong. It doesn't address your
 Asterisk but instead addresses your Kamailio, although the Contact of your
 200 OK (hopefully) contains the Asterisk IP.

 Please verify that your 200 OK going to the carrier actually does carry
 a Contact header with the Asterisk IP, but if it does, section 12.1.2 of
 the SIP RfC could help when arguing with the carrier.

 Regards
 Sebastian

 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


>>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] topos redis -> failed to store

2018-01-09 Thread Abdoul Osséni
Hello,

I am using kamailio 5.1.0 version

root@sip-africallshop-com:/home/aosseni# kamailio -V
version: kamailio 5.1.0 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, 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: unknown
compiled on 20:04:57 Jan  4 2018 with gcc 4.9.2

Regards

Abdoul OSSENI

2018-01-09 13:27 GMT+01:00 Daniel-Constantin Mierla :

> Hello,
>
> what version of kamailio are you using?
>
> Cheers,
> DAniel
>
> On 06.01.18 07:37, Abdoul Osséni wrote:
>
> Hello list,
>
> I activated topos and topos_redis backend.
>
> Now, I have the following errors:
>
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30288]: {1 102 NOTIFY
> 645f4b58537f9df53b9ce65f4937d652@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30292]: {1 102 NOTIFY
> 5b678085378e62c12c6f18154501feb3@163.172.83.169:5064} INFO: topos_redis
> [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no uuid for this
> message
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30292]: {1 102 NOTIFY
> 5b678085378e62c12c6f18154501feb3@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102 NOTIFY
> 2799d4a61e9defbc66dc67735e1c6e6c@163.172.83.169:5064} INFO: topos_redis
> [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no uuid for this
> message
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102 NOTIFY
> 2799d4a61e9defbc66dc67735e1c6e6c@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30290]: {1 102 NOTIFY
> 760fe2ce3427748514441de25cade2e4@163.172.83.169:5064} INFO: topos_redis
> [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no uuid for this
> message
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30290]: {1 102 NOTIFY
> 760fe2ce3427748514441de25cade2e4@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:33 sd-110402 /usr/local/sbin/kamailio[30291]: {1 102 NOTIFY
> 7464fc2b503427423b0aba925fb13bc7@163.172.83.169:5064} INFO: topos_redis
> [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no uuid for this
> message
> Jan  6 07:34:33 sd-110402 /usr/local/sbin/kamailio[30291]: {1 102 NOTIFY
> 7464fc2b503427423b0aba925fb13bc7@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:35 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102 NOTIFY
> 581e88181527f4221fbc7f893a564d6a@163.172.83.169:5064} INFO: topos_redis
> [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no uuid for this
> message
> Jan  6 07:34:35 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102 NOTIFY
> 581e88181527f4221fbc7f893a564d6a@163.172.83.169:5064} ERROR: topos
> [tps_storage.c:394]: tps_storage_record(): failed to store
>
> Could you help me to fix it?
>
> Abdoul OSSENI
>
>
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] WebRTC proxy for legacy systems

2018-01-09 Thread Daniel-Constantin Mierla
Hello,


On 05.01.18 09:55, Karsten Horsmann wrote:
> Hello,
>
> you also be aware of longer callsetups to webrtc clients (13 - 38
> seconds) if there are many ICE candidates on the client (like
> different networking devices).
>
> There maybe also fixes in the js SIP libraries for that (I don't touch
> this area). 
>
if you know that it is low chance to work without a rtp relay (such as
rtpengine), one option here is to remove all ice candidates and let only
the ones from the relay. This is a solution in kamailio.cfg.

Otherwise, there are some variants of ICE that should make the setup
faster (e.g., use relay first, they try other better variants and if one
works switch to it). Not sure the state of implementation in browsers
and the options offered by various sip js libraries.

Cheers,
Daniel

>
> Am 05.01.2018 9:04 vorm. schrieb "Daniel-Constantin Mierla"
> mailto:mico...@gmail.com>>:
>
> Hello,
>
> another thing that one should be aware of is that in
> webrtc/websocket some sip headers (e.g., via, contact) use a
> random string instead of ip addresses and many old devices will
> throw parsing error. jssip (and maybe other js sip stacks) has an
> option to enable using a private ip address instead of a random ip
> address.
>
> Cheers,
> Daniel
>
>
> On 27.12.17 12:55, Karsten Horsmann wrote:
>> Hello Paul and List,
>>
>>
>> you can use the nice WebRTC Example from havfo at github
>> https://github.com/havfo/WEBRTC-to-SIP
>> 
>>
>> The magic with kamailio, rtpengine and WebRTC / SIP Bridging
>> starts in this route.
>>
>> 
>> https://github.com/havfo/WEBRTC-to-SIP/blob/master/etc/kamailio/kamailio.cfg#L599
>> 
>> 
>>
>> You can merge this with the default kamailio advanced config to
>> create an kamailio/rtpengine SBC.
>>
>>
>> Kind Regards
>>
>>
>> 2017-12-26 14:35 GMT+01:00 > >:
>>
>> Hi,
>>
>> I'm looking to use kamailio as a webrtc proxy for legacy sip
>> system that
>> doesnt have this capability, is there a example or blueprint
>> i can
>> follow to get started with this? I'm RTFMing the docs but still
>> need a while to understand kamailio internals :-)
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>>
>>
>>
>>
>> -- 
>> Mit freundlichen Grüßen
>> *Karsten Horsmann*
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com 
> 
> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com 
> 
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org 
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] kamailio-5.0.5 active/passive pcs/cluster with rtpengine - how to fix calls after failover

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

maybe not directly related to the issue, but could be better to separate
rtpengine on its own system, likely it requires less failover scenarios,
so active calls are not affected at all if you have to do a failover for
the signaling server...

Anyhow, as you trigger a failover and you know it is not going to
recover the active calls, you can close them via dialog module.

Cheers,
Daniel


On 05.01.18 09:45, Karsten Horsmann wrote:
> Hi Daniel, 
>
> Yes, they are.
>
> At this point I using only one redis key space for both rtpengines. I
> just fire it up on the backup machine so it reads the RTP sessions
> from redis.
>
> Both rtpengines had the same configuration. Only one is active. 
>
> But I found the nice redis key space separated and active / active -
> multiple rtpengine feature for it. Not implemented this at the moment. 
>
> Am 05.01.2018 8:49 vorm. schrieb "Daniel-Constantin Mierla"
> mailto:mico...@gmail.com>>:
>
> Hello,
>
> are kamailio and rtpenigine on same system?
>
> Cheers,
> Daniel
>
>
> On 04.01.18 12:21, Karsten Horsmann wrote:
>> Hello List,
>>
>> and also an happy new year to everyone.
>>
>> I use CentOS 7.4.x with kamailio 5.0.5 and rtpengine on a
>> pacemaker/corosync cluster
>> in front of an internal kamailio siprouter and media-services.
>>
>> If i did an "pcs node standby" to failover my frontend-kamailio
>> (udp/tcp 5060, udp/tcp 5061-tls and tcp websocket-secure) i
>> noticed the following scenarios:
>>
>> 1) Plain RTP: just stocks a few seconds and flows. Everything fine.
>> 2) SDES/RTP: silence - but REINVITE manually in my client brings
>> audio back. Need improvement.
>> 3) DTLS/RTP WebRTC: silence - all clients shows an active call. I
>> know that there is NO way to recover this call - because of the
>> temporay DTLS certificate due the rtpengine start-up.
>>
>>
>> So i thought - for scenario1) i dont need anything to do. Works nice.
>> For scenario2) i need something to "remember its SDES/RTP calls
>> and send them an REINVITE"
>> And for scenario3) i should just hangup all WebRTC calls - IMHO
>> the best for that.
>>
>> How can i fire-up these tasks to get an "clean-up" or "reinvite"
>> after an failover?
>>
>>
>> scenario legend:
>> 1) unencrypted call
>> 2) TLS/SDES encrypted call
>> 3) DTÖS WebRTC encrypted call
>>
>> -- 
>> Kind Regards
>> *Karsten Horsmann*
>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>> 
>
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Kamailio Advanced Training - www.asipto.com 
> Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com 
> 
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] TLS cipher suites

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

can you see what are the supported cypher advertised by kamailio with
tls? Next link should provide some options to do it, searching on web
should reveal more:

  -
https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers

Cheers,
Daniel


On 05.01.18 16:40, Steve wrote:
>
> Hello,
>
> Thank you both for your responses to my query about TLS cipher suites
> supported by Kamailio 4.3.4. When I used a self-signed certificate
> generated from an RSA key, the server selected the
> RSA-AES256-GCM-SHA384 cipher suite for the connection. When I used a
> self-signed certificate generated from an EC key, the server selected
> the ECDH-ECDSA-AES256-GCM-SHA384 cipher suite for the connection. This
> was confirmed using the OpenSSL /s_client/ command and with Wireshark.
> In short, I am still unable to establish an ECDHE ephemeral key
> exchange even though the OpenSSL version 1.0.2g on Lubuntu 16.4.3
> supports it. So I must not have the correct configuration of the TLS
> module for Kamailio 4.3.4 or else need to generate some other kind of
> key/certificate.  I'm using the Kamailio and TLS config files that
> came with the package downloads, minimally modified to enable TLS and
> specify the file location of the key and certificate. I googled
> "ephemeral key exchange" and came across a posting on Stack Exchange
> talking about commands such as /SSL_CTX_set_temp_ecdh_callback/ that
> enable ephemeral key exchange. This command is not listed as a
> configuration setting in the TLS module man-page so I assume it is a
> coding command used within the module. In any case, I'd appreciate any
> further suggestions.
>
> Thanks,
>
> Steve 
>
>
> 
>   Virus-free. www.avast.com
> 
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] topos redis -> failed to store

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

what version of kamailio are you using?

Cheers,
DAniel


On 06.01.18 07:37, Abdoul Osséni wrote:
> Hello list,
>
> I activated topos and topos_redis backend.
>
> Now, I have the following errors:
>
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30288]: {1 102
> NOTIFY 645f4b58537f9df53b9ce65f4937d652@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30292]: {1 102
> NOTIFY 5b678085378e62c12c6f18154501feb3@163.172.83.169:5064
> } INFO:
> topos_redis [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no
> uuid for this message
> Jan  6 07:34:11 sd-110402 /usr/local/sbin/kamailio[30292]: {1 102
> NOTIFY 5b678085378e62c12c6f18154501feb3@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102
> NOTIFY 2799d4a61e9defbc66dc67735e1c6e6c@163.172.83.169:5064
> } INFO:
> topos_redis [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no
> uuid for this message
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102
> NOTIFY 2799d4a61e9defbc66dc67735e1c6e6c@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30290]: {1 102
> NOTIFY 760fe2ce3427748514441de25cade2e4@163.172.83.169:5064
> } INFO:
> topos_redis [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no
> uuid for this message
> Jan  6 07:34:18 sd-110402 /usr/local/sbin/kamailio[30290]: {1 102
> NOTIFY 760fe2ce3427748514441de25cade2e4@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:33 sd-110402 /usr/local/sbin/kamailio[30291]: {1 102
> NOTIFY 7464fc2b503427423b0aba925fb13bc7@163.172.83.169:5064
> } INFO:
> topos_redis [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no
> uuid for this message
> Jan  6 07:34:33 sd-110402 /usr/local/sbin/kamailio[30291]: {1 102
> NOTIFY 7464fc2b503427423b0aba925fb13bc7@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
> Jan  6 07:34:35 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102
> NOTIFY 581e88181527f4221fbc7f893a564d6a@163.172.83.169:5064
> } INFO:
> topos_redis [topos_redis_storage.c:163]: tps_redis_insert_dialog(): no
> uuid for this message
> Jan  6 07:34:35 sd-110402 /usr/local/sbin/kamailio[30287]: {1 102
> NOTIFY 581e88181527f4221fbc7f893a564d6a@163.172.83.169:5064
> } ERROR:
> topos [tps_storage.c:394]: tps_storage_record(): failed to store
>
> Could you help me to fix it?
>
> Abdoul OSSENI
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] app_lua sr.sqlops.query exit status

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

what version of kamailio are you using?

Cheers,
Daniel


On 07.01.18 22:14, je...@cyberchaos.nl wrote:
> Hello,
>
> I'm doing some tests with a lua script and app_lua. I'm using
> sr.sqlops.query to insert records into the database but would like to
> test the exit status of the sql query. In kamailio i can do:
>
> if(!sql_query("kamailio", "INSERT INTO subscriber ..."))
>
> Is there some kind of exit status for the lua function sr.sqlops.query
> in order to do the same check in lua? In other words, is it possible
> to check if a sql query was successful in lua? The result seems to be
> nill in all cases for a INSERT in lua using sr.sqlops.query.
>
>
> Thanks,
>
> Jan Hazenberg
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kami as NAT traversal + FS as media

2018-01-09 Thread Daniel-Constantin Mierla
Hello,


On 05.01.18 12:33, Yu Boot wrote:
> Thanks for an answer? but what I want to do (already done :)) is
> totally opposite to your solution.
>
> The main thing I wanted, so I don't need to open 5060/UDP on
> FreeSwitch for (entire world), BUT at the same time АЫ should work
> with RTP traffic directly, no matter is it NATed UAC or not.
>
> This kind of "NAT traversal" (call it RTP NAT traversal :)) and UAC
> registrar are on Kami side. FS is pure softswitch here.
>
>
> What I did to perform this is replace
>     rtpproxy_manage("co");
>
> with
>
>   fix_nated_sdp("10");
>
> Now it works exactly as I wanted. Thanks for advice.

this is not fixing anything from RTP point of view, or better said, it
is not something that is working alone with a symmetric nat. You rewrite
the SDP IP with source IP, but it should just work the same without
rewriting it. For a symmetric nat the media port advertised in SDP is
not going to match the allocated port for the rtp flow in the public
side of the nat router -- if it does, can be just a luck, which is not
going to work forever, especially if there are many sip clients behind
same nat router.

Anyhow, what I meant is to fix the SIP headers (not the SDP), so you do
SIP routing properly for requests within dialog. The port 5060/udp for
FreeSwitch should be open only for traffic from/to kamailio and doesn't
have anything to do with the SDP and RTP, nor eliminated if you do nat
fix for the headers...

Cheers,
Daniel
>
>
> 04.01.2018 12:42, Daniel-Constantin Mierla пишет:
>> Hello,
>>
>>
>> On 25.12.17 10:16, Yu Boot wrote:
>>> Hello. I want to implement the following scheme:
>>>
>>> Kami takes inbound call, replces SPD for correct NAT trversal and
>>> forward that call to FS. Kami should NOT be in RTP stream. Is it
>>> possible? Any advices?
>>>
>> Kamailio should not touch the SDP if it is not going to do the RTP
>> relaying with rtpengine or rtpproxy. Just leave it untouch, freeswitch
>> will handle what is needed in this regard.
>>
>> What you have to do is to fix the signaling for nat traversal, which may
>> mean to use path module for handling registrations as well as doing
>> set_contact_alias() as well as handle_ruri_alias(), so you can route
>> requests within dialog.
>>
>> Cheers,
>> Daniel
>>
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio fail to start with db_mongodb and ndb_mongodb modules

2018-01-09 Thread Mojtaba
Hi, Please check the definition of DBURL in your code. Before i had
the same problem, I solved this issue like this:
# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
#
#as: auth_db, acc, usrloc, a.s.o.
#!define DBURL "mysql://openser:openserrw@localhost/openser"
#!endif

#!ifdef WITH_MONGODB
#!define MONGODB "mongodb://localhost/Kamailio"
#!endif
.
.
.
# - usrloc params -
/* enable DB persistency for location entries */
#!ifdef WITH_USRLOCDB
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", MULTIDOMAIN)
#!ifdef WITH_MONGODB
modparam("usrloc", "db_url", MONGODB)
#!else
modparam("usrloc", "db_url", DBURL)
#!endif
#!endif

With Regards.
Mojtaba Esfandiari.S

On Mon, Jan 8, 2018 at 12:36 PM, Abdul Basit  wrote:
> Hi Team,
>
> Any comments/ guidelines?
>
> --
> regards,
>
> abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445
>
> On 6 January 2018 at 00:39, Abdul Basit  wrote:
>>
>> Hi Daniel & K-Team,
>>
>> I setup kamailio 5.0.5 from git on vanilla Debian GNU/Linux 8.3 (jessie)
>>
>> # kamailio -v
>> version: kamailio 5.0.5 (x86_64/linux)
>> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE,
>> USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
>> TLSF_MALLOC, DBG_SR_MEMORY, 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: unknown
>> compiled on 16:53:42 Jan  5 2018 with gcc 4.9.2
>>
>>
>> Installed mongodb from debian repo
>>
>> # dpkg -l | grep mongodb
>> ii  mongodb1:3.2.17-1amd64
>> object/document-oriented database (metapackage)
>> ii  mongodb-clients1:3.2.17-1amd64
>> object/document-oriented database (client apps)
>> ii  mongodb-dev1:2.4.10-5+deb8u1 amd64
>> object/document-oriented database (development)
>> ii  mongodb-server 1:3.2.17-1amd64
>> object/document-oriented database (server package)
>>
>> # mongo --version
>> MongoDB shell version: 3.2.17
>>
>> Will try sometime with mongodb latest version 3.6 as well as I will get
>> time.
>>
>> Installed libmongoc driver through sid repo "deb
>> http://ftp.de.debian.org/debian sid main"
>>
>> # dpkg -l | grep libmongoc
>> ii  libmongoc-1.0-0  1.9.0+dfsg-1
>> amd64MongoDB C client library - runtime files
>> ii  libmongoc-dev1.9.0+dfsg-1
>> amd64MongoDB C client library - dev files
>>
>> Kamailio compiled with
>>
>> # make cfg include_modules="utils app_lua json evapi db_mongodb
>> ndb_mongodb"
>>
>> Created version collection in mongodb
>>
>> # cat
>> /usr/local/src/kamailio/utils/kamctl/mongodb/kamailio/version-create.mongo |
>> mongo
>>
>> Setup kamailio.cfg as per https://telerain.com/kamailio
>>
>> This time kamailio started successfully without any crash :)
>>
>> -
>>
>> Now its time to use mongodb for kamailio backend database.
>>
>> Used default kamailio configuration and defined mongodb connection as
>>
>> #!define DBURL "mongodb://localhost/kamailio"
>>
>> I enabled WITH_USRLOCDB [#!define WITH_USRLOCDB], kamailio refuse to start
>> with errors.
>>
>> Jan  5 19:16:05 kmaongo kamailio: CRITICAL:  [core/cfg.y:3411]:
>> yyerror_at(): parse error in config file
>> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 30-34: syntax error
>> Jan  5 19:16:05 kmaongo kamailio: CRITICAL:  [core/cfg.y:3411]:
>> yyerror_at(): parse error in config file
>> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 30-34: Invalid
>> arguments
>> Jan  5 19:16:05 kmaongo kamailio: CRITICAL:  [core/cfg.y:3414]:
>> yyerror_at(): parse error in config file
>> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 35:
>> Jan  5 19:16:05 kmaongo kamailio[28067]: ERROR: bad config file (3 errors)
>> Jan  5 19:16:05 kmaongo kamailio: WARNING:  [core/ppcfg.c:221]:
>> pp_ifdef_level_check(): different number of preprocessor directives:
>> N(#!IF[N]DEF) - N(#!ENDIF) = 1
>> Jan  5 19:16:05 kmaongo kamailio: INFO:  [core/sctp_core.c:53]:
>> sctp_core_destroy(): SCTP API not initialized
>> Jan  5 19:16:05 kmaongo systemd[1]: kamailio.service: control process
>> exited, code=exited status=255
>> [FAILJan  5 19:16:05 kmaongo systemd[1]: Failed to start Kamailio
>> (OpenSER) - the Open Source SIP Server.
>> Jan  5 19:16:05 kmaongo systemd[1]: Unit kamailio.service entered failed
>> state.
>>  failed!
>>
>>
>> Default userloc params in kamailio.cfg states line 365 as
>>
>> # - usrloc params -
>> /* enable DB persistency for location entries */
>> #!ifdef WITH_USRLOCDB
>> modparam("usrloc", "db_url", DBURL) [ << line 365 ]
>> modparam("usrloc", "db_mode", 2)

Re: [SR-Users] Kamailio fail to start with db_mongodb and ndb_mongodb modules

2018-01-09 Thread Daniel-Constantin Mierla
Hello,

can you check that the #!ifdef ... #!endif are properly paired? There is
a warning about it:

Jan  5 19:16:05 kmaongo kamailio: WARNING:  [core/ppcfg.c:221]:
pp_ifdef_level_check(): different number of preprocessor directives:
N(#!IF[N]DEF) - N(#!ENDIF) = 1

The error is now in the config file ... something is broken there.

Cheers,
Daniel

On 08.01.18 10:06, Abdul Basit wrote:
> Hi Team,
>
> Any comments/ guidelines?
>
> --
> regards,
>
> abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445
>
> On 6 January 2018 at 00:39, Abdul Basit  > wrote:
>
> Hi Daniel & K-Team,
>
> I setup kamailio 5.0.5 from git on vanilla Debian GNU/Linux 8.3
> (jessie)
>
> # kamailio -v
> version: kamailio 5.0.5 (x86_64/linux)
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
> DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP,
> PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY,
> 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: unknown
> compiled on 16:53:42 Jan  5 2018 with gcc 4.9.2
>
>
> Installed mongodb from debian repo
>
> # dpkg -l | grep mongodb
> ii  mongodb    1:3.2.17-1   
> amd64    object/document-oriented database (metapackage)
> ii  mongodb-clients    1:3.2.17-1       
> amd64    object/document-oriented database (client apps)
> ii  mongodb-dev    1:2.4.10-5+deb8u1
> amd64    object/document-oriented database (development)
> ii  mongodb-server 1:3.2.17-1   
> amd64    object/document-oriented database (server package)
>
> # mongo --version
> MongoDB shell version: 3.2.17
>
> Will try sometime with mongodb latest version 3.6 as well as I
> will get time.
>
> Installed libmongoc driver through sid repo "deb
> http://ftp.de.debian.org/debian 
> sid main"
>
> # dpkg -l | grep libmongoc
> ii  libmongoc-1.0-0 
> 1.9.0+dfsg-1    amd64    MongoDB C client
> library - runtime files
> ii  libmongoc-dev    1.9.0+dfsg-1  
>  amd64    MongoDB C client library - dev files
>
> Kamailio compiled with
>
> # make cfg include_modules="utils app_lua json evapi db_mongodb
> ndb_mongodb"
>
> Created version collection in mongodb
>
> # cat
> /usr/local/src/kamailio/utils/kamctl/mongodb/kamailio/version-create.mongo
> | mongo
>
> Setup kamailio.cfg as per https://telerain.com/kamailio
> 
>
> This time kamailio started successfully without any crash :)
>
> -
>
> Now its time to use mongodb for kamailio backend database.
>
> Used default kamailio configuration and defined mongodb connection as
>
> #!define DBURL "mongodb://localhost/kamailio"
>
> I enabled WITH_USRLOCDB [#!define WITH_USRLOCDB], kamailio refuse
> to start with errors.
>
> Jan  5 19:16:05 kmaongo kamailio: CRITICAL: 
> [core/cfg.y:3411]: yyerror_at(): parse error in config file
> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 30-34:
> syntax error
> Jan  5 19:16:05 kmaongo kamailio: CRITICAL: 
> [core/cfg.y:3411]: yyerror_at(): parse error in config file
> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 30-34:
> Invalid arguments
> Jan  5 19:16:05 kmaongo kamailio: CRITICAL: 
> [core/cfg.y:3414]: yyerror_at(): parse error in config file
> /usr/local/etc/kamailio/kamailio.cfg, line 365, column 35:
> Jan  5 19:16:05 kmaongo kamailio[28067]: ERROR: bad config file (3
> errors)
> Jan  5 19:16:05 kmaongo kamailio: WARNING: 
> [core/ppcfg.c:221]: pp_ifdef_level_check(): different number of
> preprocessor directives: N(#!IF[N]DEF) - N(#!ENDIF) = 1
> Jan  5 19:16:05 kmaongo kamailio: INFO: 
> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
> Jan  5 19:16:05 kmaongo systemd[1]: kamailio.service: control
> process exited, code=exited status=255
> [FAILJan  5 19:16:05 kmaongo systemd[1]: Failed to start Kamailio
> (OpenSER) - the Open Source SIP Server.
> Jan  5 19:16:05 kmaongo systemd[1]: Unit kamailio.service entered
> failed state.
>  failed!
>
>
> Default userloc params in kamailio.cfg states line 365 as
>
> # - usrloc params -
> /* enable DB persistency for location entries */
> #!ifdef WITH_USRLOCDB
> modparam("usrloc", "db_url", DBURL) [ << line 365 ]
> modparam("usrloc", "db_mode", 2)
> modparam("usrloc", "use_d

Re: [SR-Users] cdr processing questions

2018-01-09 Thread Евгений Голей

Hello!

Regarding the second and third question.  I once did like this:

route
{
    route(checks);
    route(reqinit);
..
    route(class4);
}

route[reqinit]
{
    

    if (has_totag() && (uri == myself) && is_method("INVITE|ACK|BYE|UPDATE"))
    {
        if(match_dialog())
        {
            # sequential request -> obey Route indication
            if(is_method("BYE"))
            {
                t_on_reply("manage_reply_class4");
                xlog("[$ci] INFO BYE DIALOG_DID=$DLG_did 
DLG_lifetime=$DLG_lifetime \n");
                route(acc_stop);

            }
            else
            if(is_method("INVITE"))
            {
                xlog("[$ci] INFO Re-Invite has come for: $fU");
                if(match_dialog())
                {
                    xlog("[$ci] INFO dialog matched");
                    t_relay();
                    exit;
                }
            }
            #loose_route();
            t_relay();
            exit;
        }
        if ( is_method("ACK") ) 
        {
            if ( t_check_trans() ) 
            {
                # non loose-route, but stateful ACK; must be an ACK after 
                # a 487 or e.g. 404 from upstream server
                route(acc_stop);
                t_relay();
                exit;
            } 
            else 
            {
                # ACK without matching transaction ->
                # ignore and discard
                exit;
            }
        }
        xlog("[$ci] INFO No such dialog\n");
    }
    # handle cancel and re-transmissions
    if ( is_method("CANCEL") )
    {
        xlog("[$ci] INFO Cancel message from: $fU\n");
        if ( t_check_trans() )
        {
    route(acc_stop);
            t_relay();
        }
        exit;
    }
}

route[class4]
{
    if is_method("INVITE")
    {
        .
        route(acc_start);
    }
..
}

onreply_route[manage_reply_class4]
{
    
    if (is_method("INVITE") && t_check_status("200") || 
t_check_status("[4|5|6][0-9][0-9]") && !t_check_status("1[0-9][0-9]"))
    {
    $avp(call_time_setup) = $Ts - $avp(call_time_created_Ts);
           route(acc_update);
    }
}

route[acc_start]
{
       $avp(time_call_created) = $time(%F %T);
    $avp(call_time_created_Ts) =$Ts;
    $avp(call_fuo) = $fU;
    $avp(call_tuo) = $tU;
    $avp(call_mi) = $mi;
        avp_db_query("insert into acc (method, from_tag, callid, time, created, 
ruo, fuo, tuo, mi, fgw) 
                values ('$rm', '$ft', '$ci', '$avp(time_call_created)', 
                    '$avp(time_call_created)', '$avp(call_ruo)', 
'$avp(call_fuo)', '$avp(call_tuo)', 
                    '$avp(call_mi)', '$avp(call_gw_source)')");
}

route[acc_update]
{
    avp_db_query("select callid from acc where callid='$ci'","$avp(call_id)");
    if($avp(call_id))
    {
        avp_db_query("update acc set to_tag = '$tt', sip_code = '$rs', 
sip_reason = '$rr', 
                        setuptime = '$avp(call_time_setup)', tgw = 
'$avp(call_gw_dest)',
                        ru = '$avp(call_ru)', fu = '$fU', tu = '$tU' 
                    where callid='$ci'");
    }

}

route[acc_stop]
{
    avp_db_query("select callid from acc where callid='$ci'","$avp(call_id)");  
  
    if($avp(call_id))
    {
        avp_db_query("update acc set duration = '$DLG_lifetime'    where 
callid = '$ci'");
    }
}


>Понедельник,  8 января 2018, 0:50 +03:00 от voipspace voipspace 
>:
>
>
>
>A few question;
>
>Firstly
>
>With mod acc and acc_cdr i see the default fields logged is only start_time, 
>end_time, duration.
>
>This is an actual entry logged.
>
>start_time, end_time, duration
>1515353126, 1515353135, 9.66
>Hello!
>
>Regarding the second and third question.  I once did like this:
>Why is the duration 9.66? 
>
>It seems wrong because it is more then the difference in time
>
>1515353135 - 1515353126 = 9
>
>
>
>Secondly
>
>What is a reliable way to capture and log start time, answer time, and end 
>time.
>How do I get the duration info. a) start time to end time. b) answer to end 
>time. 
>
>Is there an built in variable that store this info?
>
>
>Thirdly
>
>dialog events listed as:
>
>event_route[dialog:start]
>event_route[dialog:end]
>event_route[dialog:failed]
>
>There does not seems to be a event for answer so then how to be notified when 
>a dialog is answered?
>
>Regards
>
>___
>Kamailio (SER) - Users Mailing List
>sr-users@lists.kamailio.org
>https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


-- 
С уважением,
Евгений Голей
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users