Re: [OpenSIPS-Users] opensips crash when doing load test

2016-10-04 Thread Ramachandran, Agalya (Contractor)
Hi Bogdan,

Please find the values. Any common folder you have access for the outside world 
to put files?
If yes, share me the details. I can upload the core file there.

(gdb) print r_buf
$1 = (struct retr_buf *) 0x7fded2484098
(gdb) print *r_buf
$2 = {activ_type = 0, buffer = {
s = 0x7fded0ca79f0 "INVITE sip:++1200104@10.0.0.1:5060 
SIP/2.0\r\nRecord-Route: \r\nTo: sut 
\r\nFrom: sipp 
; 
OpenSIPS users mailling list 
Subject: Re: opensips crash when doing load test

Could you also print r_buf and *r_buf  ?

Regards,


Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com
On 04.10.2016 16:08, Ramachandran, Agalya (Contractor) wrote:
Hi Bogdan,

I have printed the "t" variable value. It says "$1 = (struct cell *) 0x0".
Is there any link available to upload/share the core files? Because size of the 
core file 45KB and couldn't attach in e-mail.

(gdb) frame 0
#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
(gdb) list +
378 current_processing_ctx = my_ctx;
379 /* set the T context too */
380 set_t( t );
381
382 /* out-of-lock do the cancel I/O */
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
384 set_cancel_extra_hdrs( CANCEL_REASON_SIP_480, 
sizeof(CANCEL_REASON_SIP_480)-1);
385 cancel_branch(t, r_buf->branch );
386 set_cancel_extra_hdrs( NULL, 0);
387 }
(gdb) p t
$1 = (struct cell *) 0x0

Regards,
Agalya

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
Sent: Tuesday, October 04, 2016 6:44 AM
To: Ramachandran, Agalya (Contractor) 
; 
OpenSIPS users mailling list 

Subject: Re: opensips crash when doing load test

Hello Agalya,

In frame 0, could you print the "t" variable ? BTW, is there any way to get 
access to the core file ?

Best regards,



Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com
On 30.09.2016 16:48, Ramachandran, Agalya (Contractor) wrote:
Hi Bogdan,

One more dump

#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
Missing separate debuginfos, use: debuginfo-install 
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 glibc-2.17-106.el7_2.4.x86_64 
keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-12.el7_2.x86_64 
libcom_err-1.42.9-7.el7.x86_64 libcurl-7.29.0-25.el7.centos.x86_64 
libidn-1.28-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 
libssh2-1.4.3-10.el7_2.1.x86_64 nspr-4.10.8-2.el7_1.x86_64 
nss-3.19.1-19.el7_2.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 
nss-util-3.19.1-9.el7_2.x86_64 openldap-2.4.40-9.el7_2.x86_64 
openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64 
xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) bt
#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
#1  timer_routine (ticks=, set=) at timer.c:1066
#2  0x0049d3cd in handle_timer_job () at timer.c:597
#3  0x0059223e in handle_io (fm=, fm=, 
fm=, idx=, event_type=2)
at net/net_udp.c:265
#4  io_wait_loop_epoll (h=, t=, repeat=) at net/../io_wait_loop.h:225
#5  udp_rcv_loop (si=si@entry=0x7fded841dcb0) at net/net_udp.c:308
#6  0x00593e05 in udp_start_processes (chd_rank=chd_rank@entry=0x84c570 
, startup_done=startup_done@entry=0x0)
at net/net_udp.c:448
#7  0x00419b73 in main_loop () at main.c:736
#8  main (argc=, argv=) at main.c:1282

From: Ramachandran, Agalya (Contractor)
Sent: Friday, September 30, 2016 9:44 AM
To: 

Re: [OpenSIPS-Users] opensips crash when doing load test

2016-10-04 Thread Bogdan-Andrei Iancu

Could you also print r_buf and*r_buf  ?

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 04.10.2016 16:08, Ramachandran, Agalya (Contractor) wrote:


Hi Bogdan,

I have printed the “t” variable value. It says “$1 = (struct cell *) 
0x0”.


Is there any link available to upload/share the core files? Because 
size of the core file 45KB and couldn’t attach in e-mail.


(gdb) frame 0

#0 final_response_handler (fr_tl=0x7fded2484110) at timer.c:383

383 if (is_invite(t) && should_cancel_branch(t, 
r_buf->branch) ) {


(gdb) list +

378 current_processing_ctx = my_ctx;

379 /* set the T context too */

380 set_t( t );

381

382 /* out-of-lock do the cancel I/O */

383 if (is_invite(t) && should_cancel_branch(t, 
r_buf->branch) ) {


384 set_cancel_extra_hdrs( CANCEL_REASON_SIP_480, 
sizeof(CANCEL_REASON_SIP_480)-1);


385 cancel_branch(t, r_buf->branch );

386 set_cancel_extra_hdrs( NULL, 0);

387 }

(gdb) p t

$1 = (struct cell *) 0x0

Regards,

Agalya

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Tuesday, October 04, 2016 6:44 AM
*To:* Ramachandran, Agalya (Contractor) 
; OpenSIPS users mailling list 


*Subject:* Re: opensips crash when doing load test

Hello Agalya,

In frame 0, could you print the "t" variable ? BTW, is there any way 
to get access to the core file ?


Best regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 30.09.2016 16:48, Ramachandran, Agalya (Contractor) wrote:

Hi Bogdan,

One more dump

#0 final_response_handler (fr_tl=0x7fded2484110) at timer.c:383

383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {

Missing separate debuginfos, use: debuginfo-install
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64
glibc-2.17-106.el7_2.4.x86_64 keyutils-libs-1.5.8-3.el7.x86_64
krb5-libs-1.13.2-12.el7_2.x86_64 libcom_err-1.42.9-7.el7.x86_64
libcurl-7.29.0-25.el7.centos.x86_64 libidn-1.28-4.el7.x86_64
libselinux-2.2.2-6.el7.x86_64 libssh2-1.4.3-10.el7_2.1.x86_64
nspr-4.10.8-2.el7_1.x86_64 nss-3.19.1-19.el7_2.x86_64
nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64
nss-util-3.19.1-9.el7_2.x86_64 openldap-2.4.40-9.el7_2.x86_64
openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64
xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64

(gdb) bt

#0 final_response_handler (fr_tl=0x7fded2484110) at timer.c:383

#1 timer_routine (ticks=, set=) at
timer.c:1066

#2 0x0049d3cd in handle_timer_job () at timer.c:597

#3 0x0059223e in handle_io (fm=,
fm=, fm=, idx=,
event_type=2)

at net/net_udp.c:265

#4 io_wait_loop_epoll (h=, t=,
repeat=) at net/../io_wait_loop.h:225

#5  udp_rcv_loop (si=si@entry=0x7fded841dcb0) at net/net_udp.c:308

#6 0x00593e05 in udp_start_processes
(chd_rank=chd_rank@entry=0x84c570 ,
startup_done=startup_done@entry=0x0)

at net/net_udp.c:448

#7 0x00419b73 in main_loop () at main.c:736

#8  main (argc=, argv=) at main.c:1282

*From:* Ramachandran, Agalya (Contractor)
*Sent:* Friday, September 30, 2016 9:44 AM
*To:* 'Bogdan-Andrei Iancu' 
; OpenSIPS users mailling list
 
*Subject:* opensips crash when doing load test

Hi Bogdan,

I have taken 2.1.4 code base, added the below fixes on top of it

1.Fix potential starvation for the timer tasks.
66c337cc89a2b5c3e1bbd78c289371efcda21886

2.rest_client: Improve polling logic during TCP connect -
c40f2b057209b8078520abc95e5d1bf5e5a28db6

3.rest_client: Add "connect_poll_interval" module parameter -
f5abfb3dee649a14ae39ad74d7f04454f815748f

4.rest_client: Fix bogus condition
-3ba7be6692c6987faecb9c4c904035d5e7c0f916

When I try to perform load test on that code base, randomly am
seeing OpenSIPS is crashing.

Here is the full trace of the core file. Let me know if you need
any additional information or logs.

Am seeing crash is occurring at start_timer_extra_processes().

[root@poc-siplb-cmc-e-004 corefiles]# gdb /usr/local/sbin/opensips
core.opensips.sig11.3977

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7

Copyright (C) 2013 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later


This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"

and "show warranty" for details.

This GDB was configured as "x86_64-redhat-linux-gnu".

For bug reporting instructions, please see:

...

Reading symbols from 

[OpenSIPS-Users] What does happen when location table has records for peer that is offline?

2016-10-04 Thread Rodrigo Pimenta Carvalho
Hi.

In my table location (in OpenSIPS) I found some records for a peer that was not 
online. That is, some peer offline let some registers in the location table.

For example: the peer A registered itself using several different devices, then 
turned off all of such devices.


Such records would expires sometime in the future.


Then, peer B called A, and in this moment I saw a log with several erros, from 
OpenSIPs.

Does such logs relates to these invalid records in table location?


After removing these records (opensipsctl ul rm ) those messages stopped 
appearing in the log. See the log below.


Any hint will be very helpful!

Best regards.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979






Jan 01 01:19:16 colibri-imx6 opensips[609]: new branch at 
sip:g1r2u3p4o5@127.0.0.1:47340;transport=TCP;ob
Jan 01 01:19:16 colibri-imx6 opensips[609]: new branch at 
sip:g1r2u3p4o5@127.0.0.1:54112;transport=TCP;ob
Jan 01 01:19:16 colibri-imx6 opensips[609]: new branch at 
sip:g1r2u3p4o5@127.0.0.1:38220;transport=TCP;ob
Jan 01 01:19:16 colibri-imx6 opensips[609]: new branch at 
sip:g1r2u3p4o5@127.0.0.1:54112;transport=TCP;ob
Jan 01 01:19:16 colibri-imx6 opensips[609]: new branch at 
sip:g1r2u3p4o5@127.0.0.1:38220;transport=TCP;ob
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:probe_max_sock_buff: using snd buffer of 320 kb
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:init_sock_keepalive: TCP keepalive enabled on socket 21
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: poll error: flags 1c
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: failed to retrieve SO_ERROR 
[server=127.0.0.1:47340] (111) Connection refused
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:proto_tcp_send: async TCP connect failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:msg_send: send() for proto 2 failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:t_forward_nonack: sending request failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:probe_max_sock_buff: using snd buffer of 320 kb
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:init_sock_keepalive: TCP keepalive enabled on socket 21
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: poll error: flags 1c
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: failed to retrieve SO_ERROR 
[server=127.0.0.1:54112] (111) Connection refused
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:proto_tcp_send: async TCP connect failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:msg_send: send() for proto 2 failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:t_forward_nonack: sending request failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:probe_max_sock_buff: using snd buffer of 320 kb
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
INFO:core:init_sock_keepalive: TCP keepalive enabled on socket 21
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: poll error: flags 1c
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:tcpconn_async_connect: failed to retrieve SO_ERROR 
[server=127.0.0.1:54112] (111) Connection refused
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:core:proto_tcp_send: async TCP connect failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:msg_send: send() for proto 2 failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [616] 
ERROR:tm:t_forward_nonack: sending request failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
INFO:core:probe_max_sock_buff: using snd buffer of 320 kb
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
INFO:core:init_sock_keepalive: TCP keepalive enabled on socket 23
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
ERROR:core:tcpconn_async_connect: poll error: flags 1c
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
ERROR:core:tcpconn_async_connect: failed to retrieve SO_ERROR 
[server=127.0.0.1:47340] (111) Connection refused
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
ERROR:core:proto_tcp_send: async TCP connect failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
ERROR:tm:msg_send: send() for proto 2 failed
Jan 01 01:19:17 colibri-imx6 opensips[609]: Jan  1 01:19:16 [617] 
ERROR:tm:t_forward_nonack: sending request failed
Jan 01 01:19:17 colibri-imx6 

Re: [OpenSIPS-Users] opensips crash when doing load test

2016-10-04 Thread Ramachandran, Agalya (Contractor)
Hi Bogdan,

I have printed the "t" variable value. It says "$1 = (struct cell *) 0x0".
Is there any link available to upload/share the core files? Because size of the 
core file 45KB and couldn't attach in e-mail.

(gdb) frame 0
#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
(gdb) list +
378 current_processing_ctx = my_ctx;
379 /* set the T context too */
380 set_t( t );
381
382 /* out-of-lock do the cancel I/O */
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
384 set_cancel_extra_hdrs( CANCEL_REASON_SIP_480, 
sizeof(CANCEL_REASON_SIP_480)-1);
385 cancel_branch(t, r_buf->branch );
386 set_cancel_extra_hdrs( NULL, 0);
387 }
(gdb) p t
$1 = (struct cell *) 0x0

Regards,
Agalya

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
Sent: Tuesday, October 04, 2016 6:44 AM
To: Ramachandran, Agalya (Contractor) ; 
OpenSIPS users mailling list 
Subject: Re: opensips crash when doing load test

Hello Agalya,

In frame 0, could you print the "t" variable ? BTW, is there any way to get 
access to the core file ?

Best regards,


Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com
On 30.09.2016 16:48, Ramachandran, Agalya (Contractor) wrote:
Hi Bogdan,

One more dump

#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
383 if (is_invite(t) && should_cancel_branch(t, r_buf->branch) ) {
Missing separate debuginfos, use: debuginfo-install 
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 glibc-2.17-106.el7_2.4.x86_64 
keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-12.el7_2.x86_64 
libcom_err-1.42.9-7.el7.x86_64 libcurl-7.29.0-25.el7.centos.x86_64 
libidn-1.28-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 
libssh2-1.4.3-10.el7_2.1.x86_64 nspr-4.10.8-2.el7_1.x86_64 
nss-3.19.1-19.el7_2.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 
nss-util-3.19.1-9.el7_2.x86_64 openldap-2.4.40-9.el7_2.x86_64 
openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64 
xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) bt
#0  final_response_handler (fr_tl=0x7fded2484110) at timer.c:383
#1  timer_routine (ticks=, set=) at timer.c:1066
#2  0x0049d3cd in handle_timer_job () at timer.c:597
#3  0x0059223e in handle_io (fm=, fm=, 
fm=, idx=, event_type=2)
at net/net_udp.c:265
#4  io_wait_loop_epoll (h=, t=, repeat=) at net/../io_wait_loop.h:225
#5  udp_rcv_loop (si=si@entry=0x7fded841dcb0) at net/net_udp.c:308
#6  0x00593e05 in udp_start_processes (chd_rank=chd_rank@entry=0x84c570 
, startup_done=startup_done@entry=0x0)
at net/net_udp.c:448
#7  0x00419b73 in main_loop () at main.c:736
#8  main (argc=, argv=) at main.c:1282

From: Ramachandran, Agalya (Contractor)
Sent: Friday, September 30, 2016 9:44 AM
To: 'Bogdan-Andrei Iancu' ; 
OpenSIPS users mailling list 

Subject: opensips crash when doing load test

Hi Bogdan,

I have taken 2.1.4 code base, added the below fixes on top of it


1.   Fix potential starvation for the timer tasks. 
66c337cc89a2b5c3e1bbd78c289371efcda21886

2.   rest_client: Improve polling logic during TCP connect - 
c40f2b057209b8078520abc95e5d1bf5e5a28db6

3.   rest_client: Add "connect_poll_interval" module parameter - 
f5abfb3dee649a14ae39ad74d7f04454f815748f

4.   rest_client: Fix bogus condition 
-3ba7be6692c6987faecb9c4c904035d5e7c0f916


When I try to perform load test on that code base, randomly am seeing OpenSIPS 
is crashing.
Here is the full trace of the core file. Let me know if you need any additional 
information or logs.
Am seeing crash is occurring at start_timer_extra_processes().

[root@poc-siplb-cmc-e-004 corefiles]# gdb /usr/local/sbin/opensips 
core.opensips.sig11.3977
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/local/sbin/opensips...done.
[New LWP 3977]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/local/sbin/opensips -P /var/run/opensips.pid'.
Program terminated with signal 11, Segmentation fault.
#0  final_response_handler (fr_tl=0x7f55fcd82948) at timer.c:383
383 if (is_invite(t) && 

Re: [OpenSIPS-Users] string modification

2016-10-04 Thread Bogdan-Andrei Iancu

Hi Denis,

Unfortunately the dialplan does not support empty string substitution :(

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 04.10.2016 15:19, Denis wrote:

Re: [OpenSIPS-Users] string modification Hello!

Bogdan, i am sorry for my importunity, but can you give me some 
example with dialplan module?


To speak the truth, not want to restart Opensips once again for using 
transformation, but dialplan is already implemented in configuration 
file and can me used for the task.


Thank you.


mailto:denis7...@mail.ru


Please, Bogdan, can you give me some example?

Thank you.

mailto:denis7...@mail.ru


YEs, sure it can.
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:58, Denis wrote:

Re: [OpenSIPS-Users] string modification Sorry, Bogdan
But one more, dialplan can do it?

mailto:denis7...@mail.ru


Yes, it is.

Or you can do it shorter:
 $rU = $(rU{re.subst,"/-//g"});

Regards
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:46, Denis wrote:

Re: [OpenSIPS-Users] string modification Thank you, Bogdan

Just in case, is this correctly?

$var(input) = $rU;
$var(output)=$(var(input){re.subst,"/-//g"});
$rU=$var(output);

mailto:denis7...@mail.ru


Hi,

The easiest way is by using a regexp substitution (see 
http://www.opensips.org/Documentation/Script-Tran-2-2#toc81) :


$var(input)="123-45-67";
$var(output) = $(var(input){re.subst,"/-//g"});

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:00, Denis wrote:

string modification Hello!

I am sorry that it was early, but my question is, how can i delete 
some character from some string if i do not know where this character 
will be inside the string?


For example, input string 123-45-67, or 12-345-67, but output string 
should be 1234567.


Thank you.


mailto:denis7...@mail.ru

___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] string modification

2016-10-04 Thread Denis
Hello!

Bogdan, i am sorry for my importunity, but can you give me some example with 
dialplan module?

To speak the truth, not want to restart Opensips once again for using 
transformation, but dialplan is already implemented in configuration file and 
can me used for the task.

Thank you.


mailto:denis7...@mail.ru


Please, Bogdan, can you give me some example?

Thank you.

mailto:denis7...@mail.ru


YEs, sure it can.
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:58, Denis wrote:

Re: [OpenSIPS-Users] string modification Sorry, Bogdan
But one more, dialplan can do it?

mailto:denis7...@mail.ru


Yes, it is.

Or you can do it shorter:
  $rU = $(rU{re.subst,"/-//g"});

Regards
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:46, Denis wrote:

Re: [OpenSIPS-Users] string modification Thank you, Bogdan

Just in case, is this correctly?

$var(input) = $rU;
$var(output)=$(var(input){re.subst,"/-//g"});
$rU=$var(output);

mailto:denis7...@mail.ru


Hi,

The easiest way is by using a regexp substitution (see 
http://www.opensips.org/Documentation/Script-Tran-2-2#toc81) :
 
$var(input)="123-45-67";
$var(output) = $(var(input){re.subst,"/-//g"});

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 13:00, Denis wrote:

string modification Hello!

I am sorry that it was early, but my question is, how can i delete some 
character from some string if i do not know where this character will be inside 
the string?

For example, input string 123-45-67, or 12-345-67, but output string should be 
1234567.

Thank you.


mailto:denis7...@mail.ru 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] FW: Asynchronous operation for REST queries

2016-10-04 Thread Bogdan-Andrei Iancu

Hi Agalya,

I'm not fully aware of your script, but you can definitely do more than 
that - without any sync queries, you can easily get 20K cps on such a 
machine.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 03.10.2016 22:06, Ramachandran, Agalya (Contractor) wrote:

Hi Liviu/Bogdan,
Please let me know how is my OpenSIPS performance? Is it under 
performed ?

Waiting for the feedback to hear from you.
Am running OpenSIPS in a VM with 8 core CPU and 20GB RAM.
Regards,
Agalya
_
*From:* Ramachandran, Agalya (Contractor)
*Sent:* Monday, September 19, 2016 12:56 PM
*To:* 'Liviu Chircu' ; OpenSIPS users mailling 
list 

*Subject:* RE: FW:[OpenSIPS-Users] Asynchronous operation for REST queries
Hi Liviu,
Thank you for the response.
2) Regarding the feedback, this is what I observed till now.

 1. Without HTTP –150 calls per sec for almost 100K calls => Looks good.
 2. With HTTP being sync –

 1. Children parameter =1 , only 4 cps, since depending on the query
and the response, it takes time to respond.
 2. Children parameter = 50, 100K calls sent at 100 cps => OpenSIPS
handles  95cps - 3000+ active calls
 3. Children parameter = 20, 100K calls sent at 35 cps => OpenSIPS
handles  35cps

 3. With HTTP being async tested with the latest fix included on main
branch

=>   Children parameter =8, 10K calls sent at 25cps => OpenSIPS 
handles  23 cps, with 1200+ active calls.
The result with async may improve in a release version from the 
development branch I hope.

Regards,
Agalya
*From:* Liviu Chircu [_mailto:liviu@opensips.org_]
*Sent:* Monday, September 19, 2016 11:18 AM
*To:* Ramachandran, Agalya (Contractor) 
<_Agalya_Ramachandran@comcast.com_ 
>; OpenSIPS users mailling 
list <_users@lists.opensips.org_ >

*Subject:* Re: FW:[OpenSIPS-Users] Asynchronous operation for REST queries
Hi, Agalya!
1) Regarding connection reuse optimization, I haven't done any 
research on this topic. In other words, libcurl will be managing its 
connections through its default settings / parameters, whichever they 
are. The module is mature enough, maybe now is a good time to look 
into this feature.
2) Since you're doing lots of obviously blocking operations (HTTP 
transfers), then you will definitely need more processes. However, I 
noticed lots of transfers are quickly completed, without requiring 
async, so you don't want too many processes if all requests work like 
that. Just tune according to your needs until you find a sweet spot. 
You could even share the performance results, I'd love to hear some 
feedback.

Liviu Chircu
OpenSIPS Developer
_http://www.opensips-solutions.com_
On 19.09.2016 17:57, Ramachandran, Agalya (Contractor) wrote:
Hi team/Liviu,
Couple of  questions for clarification.

 1. I see for every HTTP request(for both sync and async), TCP ports
are being opened and closed.

 Are we not using same port and pooling the request in 
a particular port if we are hitting simultaneous requests?


 2. Children parameter in the config file - I understand the use case
of this is to spawn multiple threads.

If we want to handle more load in OpenSIPS, we should increase this 
number correct?
So when increasing this number of children process we should take care 
of CPU utilization and according to the no of CPU and RAM we used in 
our Linux system.

Correct me if am wrong in my understanding of the above questions.
Regards,
Agalya
*From:* Liviu Chircu [_mailto:liviu@opensips.org_]
*Sent:* Thursday, September 15, 2016 3:53 AM
*To:* Ramachandran, Agalya (Contractor) 
__ 
; OpenSIPS users mailling list 
__ 

*Subject:* Re: FW:[OpenSIPS-Users] Asynchronous operation for REST queries
On 14.09.2016 21:33, Ramachandran, Agalya (Contractor) wrote:
Are you going to add one more parameter “connect_polling_interval” and 
what will be use case of it?

Is it replacement for 10% wait time logic?
Yes.

Also, I observed in the case of async call, it takes ~90 to 100ms to 
open the port itself. Is this expected behavior?

Yes.


Liviu Chircu
OpenSIPS Developer
_http://www.opensips-solutions.com_


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Query- to read a text file content by openSIPS

2016-10-04 Thread Bogdan-Andrei Iancu

Yes, that is the best approach.

When comes to actual reading of the text file, you can do it via an 
exec() call - run a command and output the file content and catch the 
output of the exec into a variable.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 03.10.2016 18:53, Brett Nemeroff wrote:
Best way to do something like this IMO would be to use a caching 
backend like memcache. You could either use a timer route or an 
external script to periodically repopulate the tuple.


-Brett

On Oct 3, 2016, at 10:21 AM, Ramachandran, Agalya (Contractor) 
> wrote:



Hi team,

I have a question and it follows:

If we need to add a header for Authorization purpose, before making a 
REST call, we need to use rest_append_hf_method()


E.X: rest_append_hf("Authorization: Bearer mF_9.B5f-4.1JqM");

My question is, If I want to read a text file, is there any function 
exposed so that I can read the text file and place the content of the 
text file for Authorization header?


Also, Is there a way that I need to read the text file for every hour 
and read the file?


Please guide me how this can be achieved?

Regards,

Agalya

___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] opensips crash when doing load test

2016-10-04 Thread Bogdan-Andrei Iancu

Hello Agalya,

In frame 0, could you print the "t" variable ? BTW, is there any way to 
get access to the core file ?


Best regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 30.09.2016 16:48, Ramachandran, Agalya (Contractor) wrote:


Hi Bogdan,

One more dump

#0 final_response_handler (fr_tl=0x7fded2484110) at timer.c:383

383 if (is_invite(t) && should_cancel_branch(t, 
r_buf->branch) ) {


Missing separate debuginfos, use: debuginfo-install 
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 glibc-2.17-106.el7_2.4.x86_64 
keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-12.el7_2.x86_64 
libcom_err-1.42.9-7.el7.x86_64 libcurl-7.29.0-25.el7.centos.x86_64 
libidn-1.28-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 
libssh2-1.4.3-10.el7_2.1.x86_64 nspr-4.10.8-2.el7_1.x86_64 
nss-3.19.1-19.el7_2.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 
nss-util-3.19.1-9.el7_2.x86_64 openldap-2.4.40-9.el7_2.x86_64 
openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64 
xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64


(gdb) bt

#0 final_response_handler (fr_tl=0x7fded2484110) at timer.c:383

#1  timer_routine (ticks=, set=) at 
timer.c:1066


#2 0x0049d3cd in handle_timer_job () at timer.c:597

#3 0x0059223e in handle_io (fm=, fm=out>, fm=, idx=, event_type=2)


at net/net_udp.c:265

#4 io_wait_loop_epoll (h=, t=, 
repeat=) at net/../io_wait_loop.h:225


#5  udp_rcv_loop (si=si@entry=0x7fded841dcb0) at net/net_udp.c:308

#6 0x00593e05 in udp_start_processes 
(chd_rank=chd_rank@entry=0x84c570 , 
startup_done=startup_done@entry=0x0)


at net/net_udp.c:448

#7 0x00419b73 in main_loop () at main.c:736

#8  main (argc=, argv=) at main.c:1282

*From:* Ramachandran, Agalya (Contractor)
*Sent:* Friday, September 30, 2016 9:44 AM
*To:* 'Bogdan-Andrei Iancu' ; OpenSIPS users 
mailling list 

*Subject:* opensips crash when doing load test

Hi Bogdan,

I have taken 2.1.4 code base, added the below fixes on top of it

1.Fix potential starvation for the timer tasks. 
66c337cc89a2b5c3e1bbd78c289371efcda21886


2.rest_client: Improve polling logic during TCP connect - 
c40f2b057209b8078520abc95e5d1bf5e5a28db6


3.rest_client: Add "connect_poll_interval" module parameter - 
f5abfb3dee649a14ae39ad74d7f04454f815748f


4.rest_client: Fix bogus condition 
-3ba7be6692c6987faecb9c4c904035d5e7c0f916


When I try to perform load test on that code base, randomly am seeing 
OpenSIPS is crashing.


Here is the full trace of the core file. Let me know if you need any 
additional information or logs.


Am seeing crash is occurring at start_timer_extra_processes().

[root@poc-siplb-cmc-e-004 corefiles]# gdb /usr/local/sbin/opensips 
core.opensips.sig11.3977


GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7

Copyright (C) 2013 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later 



This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-redhat-linux-gnu".

For bug reporting instructions, please see:

...

Reading symbols from /usr/local/sbin/opensips...done.

[New LWP 3977]

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib64/libthread_db.so.1".

Core was generated by `/usr/local/sbin/opensips -P /var/run/opensips.pid'.

Program terminated with signal 11, Segmentation fault.

#0 final_response_handler (fr_tl=0x7f55fcd82948) at timer.c:383

383 if (is_invite(t) && should_cancel_branch(t, 
r_buf->branch) ) {


Missing separate debuginfos, use: debuginfo-install 
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 glibc-2.17-106.el7_2.4.x86_64 
keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-12.el7_2.x86_64 
libcom_err-1.42.9-7.el7.x86_64 libcurl-7.29.0-25.el7.centos.x86_64 
libidn-1.28-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 
libssh2-1.4.3-10.el7_2.1.x86_64 nspr-4.10.8-2.el7_1.x86_64 
nss-3.19.1-19.el7_2.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 
nss-util-3.19.1-9.el7_2.x86_64 openldap-2.4.40-9.el7_2.x86_64 
openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64 
xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64


(gdb) bt

#0 final_response_handler (fr_tl=0x7f55fcd82948) at timer.c:383

#1  timer_routine (ticks=, set=) at 
timer.c:1066


#2 0x0049d03a in handle_timer_job () at timer.c:597

#3 start_timer_extra_processes (chd_rank=chd_rank@entry=0x84c570 
) at timer.c:557


#4 0x00419b9a in main_loop () at main.c:748

#5  main (argc=, argv=) at main.c:1282

Regards,

Agalya



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] YUM and APT repositories downtime

2016-10-04 Thread Bogdan-Andrei Iancu

Many thanks Nick !!!

You do a great work in providing these repositories for OpenSIPS project !

Best regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 03.10.2016 16:46, Nick Altmann wrote:

Hello everyone!

Both yum and apt repositories were successfully moved to new server.
Enjoy faster network connection and more powerful server.

--
Nick

2016-09-30 13:49 GMT+03:00 Nick Altmann >:


Hello everyone!

Sep 30-Oct 01, YUM (yum.opensips.org )
and APT (apt.opensips.org )
repositories will be down few times up to an hour because of
infrastructure upgrade.

Sorry for the inconvenience.

--
Nick




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty

2016-10-04 Thread Bogdan-Andrei Iancu

Hi Denis,

For each dr_reload triggering, the logs report 198 GWs loaded - so it 
seems to be successful every time.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 30.09.2016 14:13, Denis wrote:

Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty Bogdan, log is here
https://cloud.mail.ru/public/HRtb/zn9igdL7C

mailto:denis7...@mail.ru 


yes
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 12:29, Denis wrote:

	Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty Bogdan, you 
need all log between two dr_reload?


mailto:denis7...@mail.ru


Hi Denis.

The log you posted covers only 16:21, so I cannot see the 16:29 reload.

Please pot the whole log on a pastebin or dropbox.

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 11:57, Denis wrote:

	Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty Ok, but exactly 
in 16:21 (time you can see in the log) we got the main problem, i.e. 
after dr_reload.


Everything became fine after next dr_reload command has been received
Sep 26 16:29:41 opensips-main 
/usr/local/opensips2.2/sbin/opensips[30942]: 
INFO:drouting:dr_reload_cmd: dr_reload MI command received!
Sep 26 16:29:41 opensips-main 
/usr/local/opensips2.2/sbin/opensips[30942]: INFO:drouting:add_dst: 
pgw tree 0x7fd11c20a480




mailto:denis7...@mail.ru


Hi Denis,

yes, but the errors on failed attempted connections are not related to 
drouting (they are linked to the acc module).


In DR, even before attempting to perform any DB query, there is a log 
about receiving the MI "dr_reload" command - which is only one. Some 
how, I am not convinced that a second dr_reload is actually reaching 
OpenSIPS.


Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 30.09.2016 08:46, Denis wrote:

Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty Hello, Bogdan!

Yes, in the log i noticed only one dr_reload when the problem appears.
I wanted to show that opensips tries to make many attempts to connect 
to mysql but dr_rules becomes empty.


Next dr_reload had been applied over 9 minutes about.

mailto:denis7...@mail.ru


Hi Denis,

The log you attached shows one single dr_reload command received, 
leading to the load of 198 GWs. After that there are no logs related 
to DR at all.


Regards,
Bogdan
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 27.09.2016 09:47, Denis wrote:

Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty Hello, Liviu!

The problem is still active.
In attachment you can see the latest log of the problem.

After the last string mysql connection became correct.

I want to ask, does it make any sense to increase timer parameters for 
mysql connection.
Ok, suppose we have some problem with the server and increasing of 
 timer parameters will help for it, but why does dr_rules becomes 
empty if it has mysql connection problem?



mailto:denis7...@mail.ru


	Correct, Denis - they have nothing to do with each other. I am just 
trying to isolate our problem (by excluding "too many reconnects"), so 
we can better understand what's happening.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 12.09.2016 15:45, Denis wrote:





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users