Re: [SR-Users] Critical : Kamilio is not starting when loading Dispatcher module .

2021-02-22 Thread Olle E. Johansson


> On 23 Feb 2021, at 05:36, Amul Tyagi  wrote:
> 
> Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: ERROR:  
> [core/tcp_main.c:2863]: tcp_init(): bind(d, 0x7f81495f1efc, 16) on 
> 127.0.0.1:5060 : Address already in use
Please check the above log for your reference. There’s one ERROR in your output 
that you need to
check.

Something is already listening to loopback interface port 5060 that blocks 
Kamailio from starting.

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


Re: [SR-Users] Critical : Kamilio is not starting when loading Dispatcher module .

2021-02-22 Thread Alex Balashov
It sounds like your answer is in the log:

SO_RCVBUF is finally 425984
Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: ERROR:  
[core/tcp_main.c:2863]: tcp_init(): bind(d, 0x7f81495f1efc, 16) on 
127.0.0.1:5060 : Address already in use

—
Sent from mobile, with due apologies for brevity and errors.

> On Feb 23, 2021, at 2:02 AM, Amul Tyagi  wrote:
> 
> SO_RCVBUF is finally 425984
> 
> Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: ERROR:  
> [core/tcp_main.c:2863]: tcp_init(): bind(d, 0x7f81495f1efc, 16) on 
> 127.0.0.1:5060 : Address already in use
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Critical : Kamilio is not starting when loading Dispatcher module .

2021-02-22 Thread Amul Tyagi
Dear Kamailio Team , 

 

I have installed Kamailio on Ubuntu 18.04 with SIREMIS and its working fine
. But I want to use the Dispatcher module for load balancing . When enabling
the dispatcher module Kamailio is not starting up and giving error in
syslog. Please check below the logs for your reference.

 

root@CICTPH01LLB01:/usr/lib/x86_64-linux-gnu/kamailio/modules# kamailio -E

0(19009) INFO:  [core/sctp_core.c:74]: sctp_core_check_support(): SCTP
API not enabled - if you want to use it, load sctp module

Listening on

 udp: 127.0.0.1:5060

 udp: 192.168.180.200:5060

 tcp: 127.0.0.1:5060

 tcp: 192.168.180.200:5060

Aliases:

 tcp: CICTPH01LLB01:5060

 tcp: localhost:5060

 udp: CICTPH01LLB01:5060

 udp: localhost:5060

 

0(19009) INFO:  [core/tcp_main.c:4735]: init_tcp(): using epoll_lt as
the io watch method (auto detected)

0(19011) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import
bind_ob - maybe module is not loaded

0(19011) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available

0(19011) INFO: auth [auth_mod.c:347]: mod_init(): qop set, but nonce-count
(nonce_count) support disabled

0(19011) INFO:  [main.c:2683]: main(): processes (at least): 32 - shm
size: 67108864 - pkg size: 8388608

0(19011) INFO:  [core/udp_server.c:153]: probe_max_receive_buffer():
SO_RCVBUF is initially 212992

0(19011) INFO:  [core/udp_server.c:205]: probe_max_receive_buffer():
SO_RCVBUF is finally 425984

0(19011) INFO:  [core/udp_server.c:153]: probe_max_receive_buffer():
SO_RCVBUF is initially 212992

0(19011) INFO:  [core/udp_server.c:205]: probe_max_receive_buffer():
SO_RCVBUF is finally 425984

21(19044) INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a
new child 0/19044

root@CICTPH01LLB01:/usr/lib/x86_64-linux-gnu/kamailio/modules# 22(19053)
INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using
epoll_lt io watch method (config)

 


=

 

Feb 18 18:33:19 CICTPH01LLB01 systemd[1]: Starting Kamailio (OpenSER) - the
Open Source SIP Server...

Feb 18 18:33:19 CICTPH01LLB01 kamailio: INFO:  [core/sctp_core.c:74]:
sctp_core_check_support(): SCTP API not enabled - if you want to use it,
load sct

p module

Feb 18 18:33:19 CICTPH01LLB01 kamailio: INFO:  [core/tcp_main.c:4735]:
init_tcp(): using epoll_lt as the io watch method (auto detected)

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]: Listening on

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  udp:
127.0.0.1:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  udp:
192.168.180.200:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  tcp:
127.0.0.1:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  tcp:
192.168.180.200:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]: Aliases:

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  tcp:
CICTPH01LLB01:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  tcp:
localhost:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  udp:
CICTPH01LLB01:5060

Feb 18 18:33:19 CICTPH01LLB01 kamailio[18815]:  udp:
localhost:5060

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: rr
[../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe
module is not loaded

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: rr
[rr_mod.c:177]: mod_init(): outbound module not available

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: auth
[auth_mod.c:347]: mod_init(): qop set, but nonce-count (nonce_count) support
disabled

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[main.c:2683]: main(): processes (at least): 32 - shm size: 67108864 - pkg
size: 8388608

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially
212992

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally
425984

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially
212992

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally
425984

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: ERROR: 
[core/tcp_main.c:2863]: tcp_init(): bind(d, 0x7f81495f1efc, 16) on
127.0.0.1:5060 : Address already in use

Feb 18 18:33:19 CICTPH01LLB01 /usr/sbin/kamailio[18817]: INFO: 
[core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized

Feb 18 18:33:19 CICTPH01LLB01 systemd[1]: kamailio.service: Control process
exited, code=exited status=255

Feb 18 18:33:19 CICTPH01LLB01 systemd[1]: kamailio.service: Failed with

Re: [SR-Users] Kamailio 5.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Daniel-Constantin Mierla
Hello,

probably the module code needs also some updates, it is rather old and
likely designed for db backends that enforce non-null values, like in
the create statement:

  *
https://github.com/kamailio/kamailio/blob/master/utils/kamctl/mysql/dialplan-create.sql#L10

So it does not do much extra checks in the code, but these days there
are other db connectors that may not have strict schema implementation
like db_redis or db_mongodb.

For now, I pushed a push a patch to jsonrpcs module to print 'null'
value in jsonrpc response, when the value passed from other modules to
it is C-NULL. This should prevent (hopefully) the crash from happening,
even you revert back to have null value in database:

  *
https://github.com/kamailio/kamailio/commit/c48e409b741821fa470788b3bca0ead32e4d6efc

I will have to check the ctl and xmlrpc modules to see what they do in
similar cases, to cover also the use of kamcmd for the same situation.

Cheers,
Daniel

On 22.02.21 13:50, Julia Bo wrote:
> Hello Daniel,
>
> I use mysqldb. 
> I have added the default value "" to column "attr" and It's working now.
>
> Thank you so much!  
> Julia.
>
>
> On Mon, Feb 22, 2021 at 12:19 PM Daniel-Constantin Mierla
> mailto:mico...@gmail.com>> wrote:
>
> Hello,
>
> did you change the database structure? Because the crash seems to
> be because attrs field is NULL, but database schema should prevent
> it. Or, maybe you use a database backend that cannot enforce that,
> which one do you use (db_myql, ...)?
>
> Cheers,
> Daniel
>
> On 22.02.21 10:57, Daniel-Constantin Mierla wrote:
>>
>> Hello,
>>
>> ohhh, indeed -- I thought it was the corefile itself, which
>> cannot be investigated on other system than the one generating it.
>>
>> Cheers,
>> Daniel
>>
>> On 22.02.21 10:05, Julia Bo wrote:
>>> Hello,
>>>
>>> The corefile has been already attached in previous mail.
>>> Send it again.
>>>
>>> Thank you,
>>> Julia.
>>>
>>> On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla
>>> mailto:mico...@gmail.com>> wrote:
>>>
>>> Hello,
>>>
>>> are you able to get a core file for the crash? If yes, then
>>> send here the output of gdb command "bt full" to see where
>>> the crash happens and try to fix it.
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 21.02.21 16:11, Julia Bo wrote:
 Hello,
 Kamailio version 5.4.4.
 Kamailio  segmentation fault after kamctl rpc dialplan.dump
 ,
 when dialplan includes variables in the replacement
 expression (repl_exp) field.
 Please see attached corefile.

 Thank you,
 Julia.

 ___
 Kamailio (SER) - Users Mailing List
 sr-users@lists.kamailio.org 
 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users 
 
>>>
>>> -- 
>>> Daniel-Constantin Mierla -- www.asipto.com 
>>> www.twitter.com/miconda  -- 
>>> www.linkedin.com/in/miconda 
>>> Funding: https://www.paypal.me/dcmierla 
>>> 
>>>
>> -- 
>> Daniel-Constantin Mierla -- www.asipto.com 
>> www.twitter.com/miconda  -- 
>> www.linkedin.com/in/miconda 
>> Funding: https://www.paypal.me/dcmierla 
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Funding: https://www.paypal.me/dcmierla 
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
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.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Julia Bo
Hello Daniel,

I use mysqldb.
I have added the default value "" to column "attr" and It's working now.

Thank you so much!
Julia.


On Mon, Feb 22, 2021 at 12:19 PM Daniel-Constantin Mierla 
wrote:

> Hello,
>
> did you change the database structure? Because the crash seems to be
> because attrs field is NULL, but database schema should prevent it. Or,
> maybe you use a database backend that cannot enforce that, which one do you
> use (db_myql, ...)?
>
> Cheers,
> Daniel
> On 22.02.21 10:57, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> ohhh, indeed -- I thought it was the corefile itself, which cannot be
> investigated on other system than the one generating it.
>
> Cheers,
> Daniel
> On 22.02.21 10:05, Julia Bo wrote:
>
> Hello,
>
> The corefile has been already attached in previous mail.
> Send it again.
>
> Thank you,
> Julia.
>
> On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>> are you able to get a core file for the crash? If yes, then send here the
>> output of gdb command "bt full" to see where the crash happens and try to
>> fix it.
>>
>> Cheers,
>> Daniel
>> On 21.02.21 16:11, Julia Bo wrote:
>>
>> Hello,
>> Kamailio version 5.4.4.
>> Kamailio  segmentation fault after kamctl rpc dialplan.dump ,
>> when dialplan includes variables in the replacement expression (repl_exp)
>> field.
>> Please see attached corefile.
>>
>> Thank you,
>> Julia.
>>
>> ___
>> Kamailio (SER) - Users Mailing 
>> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> --
>> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
>> www.linkedin.com/in/miconda
>> Funding: https://www.paypal.me/dcmierla
>>
>> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio how to make UAC challenge on Dispatcher failure route

2021-02-22 Thread Antonio Couto
I have one Kamailio that makes an outbound register on two Asterisk.
I have a dispatcher with that same two Asterisk destinations, on INVITE
message I call replace_from("", ) in order
to call a internal extension and on failure route I receive 401 and call

the process of authorization is OK.

The problem is that if the first Asterisk fail and I get 500 on
failure route I can not call replace_from() because
is not valid on the block.

Is there any way to make this type of authorization process after receiving
a 500 on failure route of dispatcher ?

Below my cfg file.

Thanks in advance.
Antonio Couto

#!KAMAILIO#!ifdef WITH_DEBUG#!define DBGLEVEL 3#!else#!define DBGLEVEL 2#!endif
# - flags#   FLT_ - per transaction (message) flags#FLB_ - per branch
flags#!define FLT_ACC 1#!define FLT_ACCMISSED 2#!define FLT_ACCFAILED
3#!define FLT_NATS 5
#!define FLB_NATB 6#!define FLB_NATSIPPING 7
### Global Parameters #

/* LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR, ... */
debug=DBGLEVEL

/* set to 'yes' to print log messages to terminal or use '-E' cli
option */log_stderror=no

memdbg=5
memlog=5
log_facility=LOG_LOCAL0log_prefix="{$mt $hdr(CSeq) $ci} "

children=8
auto_aliases=noenable_tls=noenable_sctp=no
tcp_accept_no_cl=yes
# SIP port
listen=udp:192.168.0.201:5060# xhttp port
listen=tcp:127.0.0.1:8181

loadmodule "xhttp.so"
loadmodule "jsonrpcs.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "acc.so"
loadmodule "dispatcher.so"
loadmodule "htable.so"
loadmodule "db_text.so"
loadmodule "dialog.so"
loadmodule "uac.so"
# - setting module-specific parameters ---
# - jsonrpcs params -
modparam("jsonrpcs", "pretty_format", 1)
modparam("jsonrpcs", "transport", 1)
# - sanity params -
modparam("sanity", "autodrop", 0)
# - tm params -# default retransmission timeout: 2sec
modparam("tm", "fr_timer", 1500)# default invite retransmission
timeout after 1xx: 40sec
modparam("tm", "fr_inv_timer", 4)
# - rr params -# set next param to 1 to add value to ;lr param
(helps with some UAs)
modparam("rr", "enable_full_lr", 0)
modparam("rr", "append_fromtag", 1)
# account triggers (flags)
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
# - dispatcher params -
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "xavp_dst", "_dsdst_")
modparam("dispatcher", "xavp_ctx", "_dsctx_")
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_from", "sip:pr...@kamailio.org")
modparam("dispatcher", "ds_ping_interval", 1)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshold", 1)
modparam("dispatcher", "ds_inactive_threshold", 1)
modparam("dispatcher", "ds_timer_mode", 1)

modparam("db_text", "db_mode", 1)
modparam("db_text", "emptystring", 1)

modparam("dialog", "dlg_flag", 4)
modparam("dialog", "track_cseq_updates", 1)

modparam("uac", "restore_dlg", 1)
modparam("uac", "reg_db_url", "text:///etc/kamailio/dbtext")
modparam("uac", "reg_db_table", "uacreg")
modparam("uac", "reg_timer_interval", 60)
modparam("uac", "reg_retry_interval", 60)
modparam("uac", "reg_contact_addr", "192.168.0.201:5060")
modparam("uac","auth_username_avp","$avp(auser)")
modparam("uac","auth_password_avp","$avp(apass)")
modparam("uac","auth_realm_avp","$avp(arealm)")
### Routing Logic 
# main request routing logic
request_route {

# per request initial checks
route(REQINIT);

# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}

# handle retransmissions
if (!is_method("ACK")) {
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
}

# handle requests within SIP dialogs
route(WITHINDLG);

# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");

if (is_method("INVITE|SUBSCRIBE")) {
record_route();
}

# account only INVITEs
if (is_method("INVITE")) {
setflag(FLT_ACC); # do accounting
}

if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}


Re: [SR-Users] Kamailio Crash in TLS acceppt

2021-02-22 Thread surendra p
I am running source code based, I don't see any changes in tls module with
respect to implementation. I have recompiled my kamailio source using
openssl 1.1.1j version.

I tried this below by upgrading openssl using the latest source code.

Vulnerability in OpenSSL - Integer overflow in CipherUpdate (vulners.com)


Going to monitor kamailio for some days, this core is not straightforward.


On Mon, Feb 22, 2021 at 1:04 PM Henning Westerholt  wrote:

> Hi,
>
>
>
> try to update to a maintained version (e.g. recent 5.3.x or 5.4.x) – in
> TLS support there have been several bugs fixed in newer releases.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> --
>
> Henning Westerholt – https://skalatan.de/blog/
>
> Kamailio services – https://gilawa.com
>
>
>
> *From:* sr-users  *On Behalf Of *surendra
> p
> *Sent:* Monday, February 22, 2021 5:26 AM
> *To:* sr-users@lists.kamailio.org
> *Subject:* [SR-Users] Kamailio Crash in TLS acceppt
>
>
>
> Hi Team,
>
>
>
> Kamailio 5.2 getting crashed in tls_accept. Can someone help over here.
>
>
>
> #0  0x7f1b135c09b2 in EVP_DecryptUpdate () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #1  0x7f1b135f3034 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #2  0x7f1b135f36a3 in ?? () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #3  0x7f1b135f4051 in RAND_DRBG_reseed () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #4  0x7f1b135f457d in RAND_DRBG_generate () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #5  0x7f1b135f46f1 in RAND_DRBG_bytes () from
> /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
>
> #6  0x7f1b1378649e in ?? () from
> /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>
> #7  0x7f1b13777f5f in ?? () from
> /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>
> #8  0x7f1b13763f34 in SSL_do_handshake () from
> /usr/lib/x86_64-linux-gnu/libssl.so.1.1
>
> #9  0x7f1acf246fce in tls_accept (c=0x7f1ad35fdc60,
> error=0x7ffc238dd1dc) at tls_server.c:411
>
> #10 0x7f1acf2503a3 in tls_read_f (c=0x7f1ad35fdc60,
> flags=0x7ffc238dd50c) at tls_server.c:1097
>
> #11 0x559ac2ec9b46 in tcp_read_headers (c=0x7f1ad35fdc60,
> read_flags=0x7ffc238dd50c) at core/tcp_read.c:462
>
> #12 0x559ac2eced1c in tcp_read_req (con=0x7f1ad35fdc60,
> bytes_read=0x7ffc238dd514, read_flags=0x7ffc238dd50c) at
> core/tcp_read.c:1348
>
> #13 0x559ac2ed5442 in handle_io (fm=0x7f1b13d2cef8, events=8193,
> idx=-1) at core/tcp_read.c:1715
>
> #14 0x559ac2ec424a in io_wait_loop_epoll (h=0x559ac3153f80 ,
> t=2, repeat=0) at core/io_wait.h:1073
>
> #15 0x559ac2ed6df4 in tcp_receive_loop (unix_sock=75) at
> core/tcp_read.c:1829
>
> #16 0x559ac2db8685 in tcp_init_children () at core/tcp_main.c:4802
>
> #17 0x559ac2cb6867 in main_loop () at main.c:1714
>
> #18 0x559ac2cbd6af in main (argc=15, argv=0x7ffc238ddb88) at
> main.c:2644
>
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Cockroachdb and kamailio 5.4

2021-02-22 Thread Jonathan Hunter
Hi Noah and Henning,

Thank you for your responses, I am currently digesting them!

If I can be of any help testing/working on this please let me know as Im very 
keen to implement it so will review and also happy to take direction as I will 
be testing this week on it.

Thanks again

Jon

Sent from Mail for Windows 10

From: Henning Westerholt
Sent: 22 February 2021 07:44
To: Noah Mehl; Jonathan 
Hunter
Cc: Kamailio (SER) - Users Mailing List
Subject: RE: Cockroachdb and kamailio 5.4

Hi Noah,

sure – let me give you some pointers. So basically, the SQL files are generated 
from the XSL infrastructure in the quoted directory. This file e.g. is for 
postgres:
https://github.com/kamailio/kamailio/blob/5.4/doc/stylesheets/dbschema/xsl/postgres.xsl

You basically need to copy it to a new file and adapt the types in it to the 
cockroachdb types. If you execute “make dbschema” in the kamailio source tree, 
it will generate all the SQL files. Then you could generate the appropriate SQL 
files also for your database and it will stay in sync after future changes. 
There might be also a small extension necessary in the Makefile, but we can 
have a look to this later on.

About the questions why the SQL files are then also checked in after creation – 
because otherwise everybody needs to install the xstl dependencies just for 
installing Kamailio.

About the rand()/random() topic – I did not find anything in the LCR module as 
well. It might be obsolete. I would consider dropping this, maybe after asking 
on the sr-dev list for this again.

Cheers,

Henning

--
Henning Westerholt – 
https://skalatan.de/blog/
Kamailio services – 
https://gilawa.com

From: Noah Mehl 
Sent: Sunday, February 21, 2021 8:47 PM
To: Jonathan Hunter 
Cc: Henning Westerholt ; Kamailio (SER) - Users Mailing List 

Subject: Re: Cockroachdb and kamailio 5.4

Jon,

I’m not sure what would get my branch accepted.  Henning mentioned on 9/16/2020 
that the .sql files are generated from XML/XLST scripts, I have found: 
https://github.com/kamailio/kamailio/tree/5.4/doc/stylesheets/dbschema
 which was updated just 3 days ago.  However, I don’t understand how this is 
used to generate the .sql files for Postgres. I’m also confused as to why the 
.sql files are checked into the repository if they’re generated?  Henning, can 
you point me in the right direction?

That being said, this is what’s changed in the 
branch:

kamdbctl.pgsql

- I’ve updated the psql command for my preferences regarding output
- I’ve made the function checking more verbose
- I’ve added the gen_random_uuid() function (by adding pgcrypto to Postgres, 
it’s native in CockroachDB), this isn’t required, but we are using UUID for 
usrloc in production
- I’ve updated the GRANT commands so they’re compatible with both Postgres and 
CockroachDB

Some things to note:

- concat() is native to CockroachDB, so the CREATE 

[SR-Users] Problem with kamalio.

2021-02-22 Thread Silvère Dekpon
Hi, how are you. I got this mail on github kamalio page.  Here is my problem 
detail :
Everytime when my vps reboot, i got a problem with my kamalio. It seems like 
service can't start. So i have to restart it myself by using "kamctl restart". 
When i enter this command, i got an error on screen. Here is error detail : 
ERROR: PID file /var/run/kamailio/kamailio.pid does not exist -- Kamailio start 
failed

How can i solve it ?___
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.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Daniel-Constantin Mierla
Hello,

did you change the database structure? Because the crash seems to be
because attrs field is NULL, but database schema should prevent it. Or,
maybe you use a database backend that cannot enforce that, which one do
you use (db_myql, ...)?

Cheers,
Daniel

On 22.02.21 10:57, Daniel-Constantin Mierla wrote:
>
> Hello,
>
> ohhh, indeed -- I thought it was the corefile itself, which cannot be
> investigated on other system than the one generating it.
>
> Cheers,
> Daniel
>
> On 22.02.21 10:05, Julia Bo wrote:
>> Hello,
>>
>> The corefile has been already attached in previous mail.
>> Send it again.
>>
>> Thank you,
>> Julia.
>>
>> On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla
>> mailto:mico...@gmail.com>> wrote:
>>
>> Hello,
>>
>> are you able to get a core file for the crash? If yes, then send
>> here the output of gdb command "bt full" to see where the crash
>> happens and try to fix it.
>>
>> Cheers,
>> Daniel
>>
>> On 21.02.21 16:11, Julia Bo wrote:
>>> Hello,
>>> Kamailio version 5.4.4.
>>> Kamailio  segmentation fault after kamctl rpc dialplan.dump ,
>>> when dialplan includes variables in the replacement expression
>>> (repl_exp) field.
>>> Please see attached corefile.
>>>
>>> Thank you,
>>> Julia.
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org 
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users 
>>> 
>>
>> -- 
>> Daniel-Constantin Mierla -- www.asipto.com 
>> www.twitter.com/miconda  -- 
>> www.linkedin.com/in/miconda 
>> Funding: https://www.paypal.me/dcmierla 
>>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
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.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Daniel-Constantin Mierla
Hello,

ohhh, indeed -- I thought it was the corefile itself, which cannot be
investigated on other system than the one generating it.

Cheers,
Daniel

On 22.02.21 10:05, Julia Bo wrote:
> Hello,
>
> The corefile has been already attached in previous mail.
> Send it again.
>
> Thank you,
> Julia.
>
> On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla
> mailto:mico...@gmail.com>> wrote:
>
> Hello,
>
> are you able to get a core file for the crash? If yes, then send
> here the output of gdb command "bt full" to see where the crash
> happens and try to fix it.
>
> Cheers,
> Daniel
>
> On 21.02.21 16:11, Julia Bo wrote:
>> Hello,
>> Kamailio version 5.4.4.
>> Kamailio  segmentation fault after kamctl rpc dialplan.dump ,
>> when dialplan includes variables in the replacement expression
>> (repl_exp) field.
>> Please see attached corefile.
>>
>> Thank you,
>> Julia.
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org 
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users 
>> 
>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com 
> www.twitter.com/miconda  -- 
> www.linkedin.com/in/miconda 
> Funding: https://www.paypal.me/dcmierla 
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

___
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.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Julia Bo
Hello,

The corefile has been already attached in previous mail.
Send it again.

Thank you,
Julia.

On Mon, Feb 22, 2021 at 10:22 AM Daniel-Constantin Mierla 
wrote:

> Hello,
>
> are you able to get a core file for the crash? If yes, then send here the
> output of gdb command "bt full" to see where the crash happens and try to
> fix it.
>
> Cheers,
> Daniel
> On 21.02.21 16:11, Julia Bo wrote:
>
> Hello,
> Kamailio version 5.4.4.
> Kamailio  segmentation fault after kamctl rpc dialplan.dump ,
> when dialplan includes variables in the replacement expression (repl_exp)
> field.
> Please see attached corefile.
>
> Thank you,
> Julia.
>
> ___
> Kamailio (SER) - Users Mailing 
> Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- 
> www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>
(gdb) bt full
#0  0x7fd2b64c5641 in __strlen_sse2_pminub () from /lib64/libc.so.6
No symbol table info available.
#1  0x007a2c69 in srjson_strdup (doc=0x148d050, str=0x0) at 
core/utils/srjson.c:113
len = 21592384
copy = 0x1497300 "$dlg_var(default_cli)"
#2  0x007a511b in srjson_CreateString (doc=0x148d050, string=0x0) at 
core/utils/srjson.c:968
item = 0x1497940
#3  0x7fd2b3958d5b in jsonrpc_print_value (ctx=0x7fd2b3b83a60 
<_jsonrpc_ctx_global>, fmt=115 's', ap=0x7fff16a42ef8) at jsonrpcs_mod.c:500
nj = 0x0
buf = "\377\377\377\377\377\377\377\377", '\000' , 
"\377\377\377\377", '\000' , "@\244q\266\322\177", '\000' 
, 
"\341\324[\351\000\200\377\377h\260I\001\000\000\000\000\360+\244\026\377\177\000\000"...
dt = 21590848
t = {tm_sec = -72515583, tm_min = 0, tm_hour = 21590848, tm_mday = 0, 
tm_mon = 21590848, tm_year = 0, tm_wday = 21590848, tm_yday = 0, tm_isdst = 
21590848, 
  tm_gmtoff = 21590849, tm_zone = 0x }
sp = 0x148d050
__FUNCTION__ = "jsonrpc_print_value"
#4  0x7fd2b395d6b1 in jsonrpc_struct_add (jnode=0x14976c0, 
fmt=0x7fd2af9a3ecc "s") at jsonrpcs_mod.c:810
nj = 0x0
wj = 0x0
ctx = 0x7fd2b3b83a60 <_jsonrpc_ctx_global>
ap = {{gp_offset = 32, fp_offset = 48, overflow_arg_area = 
0x7fff16a43040, reg_save_area = 0x7fff16a42f50}}
void_ptr = 0x7fff16a430d8
mname = {s = 0x7fd2af9a3f8b "ATTRS", len = 5}
isobject = 1
__FUNCTION__ = "jsonrpc_struct_add"
#5  0x7fd2af984c48 in dialplan_rpc_dump (rpc=0x7fd2b3b83b40 , 
ctx=0x7fd2b3b83a60 <_jsonrpc_ctx_global>) at dialplan.c:797
idp = 0x7fd2ab62c370
indexp = 0x7fd2ab62c3f0
rulep = 0x7fd2ab6340d0
dpid = 2
th = 0x1497ec0
ih = 0x149a480
sh = 0x14976c0
__FUNCTION__ = "dialplan_rpc_dump"
#6  0x7fd2b396849e in jsonrpc_exec_ex (cmd=0x7fff16a43370, 
rpath=0x7fff16a43360) at jsonrpcs_mod.c:1415
rpce = 0x7fd2b58110c0
ctx = 0x7fd2b3b83a60 <_jsonrpc_ctx_global>
ret = -1
nj = 0x1496d10
val = {s = 0x1496dd0 "dialplan.dump", len = 13}
scmd = {s = 0x7fff16a43411 "{\"jsonrpc\": \"2.0\", \"method\": 
\"dialplan.dump\", \"params\": [2], \"reply_name\": 
\"kamailio_receiver_18865\", \"id\": 18865}", 
  len = 114}
__FUNCTION__ = "jsonrpc_exec_ex"
#7  0x7fd2b39529e6 in jsonrpc_fifo_server (fifo_stream=0x1399780) at 
jsonrpcs_fifo.c:460
reply_stream = 0x0
buf_in = "\n{\"jsonrpc\": \"2.0\", \"method\": \"dialplan.dump\", 
\"params\": [2], \"reply_name\": \"kamailio_receiver_18865\", \"id\": 
18865}\000\000\000\000\000\340\064\244\026\377\177\000\000 
B\a\265\322\177\000\000(hH\001\000\000\000\000\001\000\000\000\000\000\000\000\355\065\244\026\377\177\000\000\001\000\000\000\000\000\000\000\240ZH\001\000\000\000\000
 
}I\001\000\000\000\000\020\000\000\000\001\000\000\000\060\000\000\000\000\000\000\000"...
buf_rpath = 
"kamailio_receiver_18865\000X}I\001\000\000\000\000<\000\000\000\000\000\000\000?衰\001\000\000\000\000\360\063\244\026\377\177\000\000pI\245\264\322\177\000\000$\000\000\000\000\000\000\000X}I\001\000\000\000\000$\000\000\000\000\000\000\000P\352H\001\000\000\000\000P4\244\026\377\177\000\000Y?α264\322\177\000\000\000\000\000\000\000\000\000\000P\352H\001\000\000\000"
lread = 115
scmd = {s = 0x7fff16a43411 "{\"jsonrpc\": \"2.0\", \"method\": 
\"dialplan.dump\", \"params\": [2], \"reply_name\": 
\"kamailio_receiver_18865\", \"id\": 18865}", 
  len = 114}
srpath = {s = 0x7fff16a43390 "kamailio_receiver_18865", len = 23}
nw = 256
jr = 0x7fd2b3b83ba0 <_jsonrpc_plain_reply>
__FUNCTION__ = "jsonrpc_fifo_server"
#8  0x7fd2b3953ffd in jsonrpc_fifo_process (rank=1) at jsonrpcs_fifo.c:497
__FUNCTION__ = "jsonrpc_fifo_process"
#9  0x7fd2b3955581 in jsonrpc_fifo_child_init (rank=0) at 

Re: [SR-Users] Kamailio 5.4.4 segmentation fault after kamctl rpc dialplan.dump

2021-02-22 Thread Daniel-Constantin Mierla
Hello,

are you able to get a core file for the crash? If yes, then send here
the output of gdb command "bt full" to see where the crash happens and
try to fix it.

Cheers,
Daniel

On 21.02.21 16:11, Julia Bo wrote:
> Hello,
> Kamailio version 5.4.4.
> Kamailio  segmentation fault after kamctl rpc dialplan.dump ,
> when dialplan includes variables in the replacement expression
> (repl_exp) field.
> Please see attached corefile.
>
> Thank you,
> Julia.
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

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