Re: [OpenSIPS-Users] Returning 180

2018-06-05 Thread Răzvan Crainea

Hi, Alexander!

Yes, you can use the sl_send_reply() function[1]. I don't really 
understand why you need the usleep() though.


[1] 
http://www.opensips.org/html/docs/modules/3.0.x/sl.html#func_sl_send_reply


Best regards,
Răzvan

On 06/04/2018 09:32 PM, Alexander Perkins wrote:
Hi All.  In OpenSIPs, is it possible to reply with a 180 for four 
seconds (that is usually how long it takes us to find the cell user).  I 
was thinking it would look something like this-


sl_send_reply("180");
usleep("24000");

Any help is greatly appreciated!

Thanks,
Alex


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



--
Răzvan Crainea
OpenSIPS Core Developer
  http://www.opensips-solutions.com

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


Re: [OpenSIPS-Users] How to change From user before do_routing?

2018-06-05 Thread Bogdan-Andrei Iancu

Hello Kirill,

The drouting module is fetching the original FROM header, as received 
from the network. So your changes from the script will be ignored.


An alternative is to determine the routing group by yourself, at script 
level (like doing a DB query, even to the same dr_groups table, but 
using whatever value you want for the user) and push the group as 
parameter to the do_routing() function.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 06/01/2018 05:05 PM, Kirill Galinurov wrote:
Hi all. I use drouting module for LCR. No i use do_routing function in 
request_route() But i want normalize username in From before do_routing.

How I can do it. Now do_routing() use old username for discover group.
Also I want to change username in contact field before topology hiding.


___
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.4 AAA_radius

2018-06-05 Thread Bogdan-Andrei Iancu

Hi Vishal,

If you do not need the radius async support, just install the 
radiusclient lib + dev packages on your system. To compile the module 
with RADIUSCLIENT support do:


> RADIUSCLIENT=RADIUSCLIENT make modules modules=moudles/aaa_radius

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 06/03/2018 06:00 PM, Vishal Pai wrote:

Hi All

I want to compile aaa_radius on opensips 2.4. I am using External 
Libraries RADIUSCLIENT. My question is how i can compile the opensips 
2.4 source.


As i read the document

http://www.opensips.org/html/docs/modules/2.4.x/aaa_radius.html#idp4684960

There are 3 options RADCLI, FREERADIUS, RADIUSCLIENT. need to compile 
only RADIUSCLIENT .



Thanks
Vishal Pai


___
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] sipcapture segfaults when capturing on raw interface in all 2.x versions of opensips

2018-06-05 Thread Bogdan-Andrei Iancu

Hi Michael,

This crash seems to be triggered mainly by the "hep_capture_on" set to 0 .

Just to check couple of things, using gdb, in frame 0, could you print 
msg->rcv ? it is interesting why those IPs are not valid (see the 
critical logs before the crash). Afterwards, the crash itself happened 
because of 'h' being null (hep_capture_on set to 0 ).


Thanks,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 05/30/2018 10:55 PM, Michael Ulitskiy wrote:

Hello,

I apologize for so delayed response.

Here's opensips revision:

root@clog1:/usr/local/opensips/etc/opensips# /usr/local/opensips/sbin/opensips 
-V
version: opensips 2.2.6 (i386/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
git revision: 24507b1ce
main.c compiled on 17:18:03 May  2 2018 with gcc 4.7.1

debug log:

May 30 15:29:28 [436] CRITICAL:sipcapture:ip_addr2a: unknown address family 
841889588
May 30 15:29:28 [436] CRITICAL:sipcapture:ip_addr2a: unknown address family 
825112118
May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: src_ip: [47.2]
May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: dst_ip: [66.1]
May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: dst_port: [5060]
May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: src_port: [4940]
May 30 15:29:28 [435] DBG:core:handle_sigs: status = 139
May 30 15:29:28 [435] INFO:core:handle_sigs: child process 436 exited by a 
signal 11
May 30 15:29:28 [435] INFO:core:handle_sigs: core was generated
May 30 15:29:28 [435] INFO:core:handle_sigs: terminating due to SIGCHLD
May 30 15:29:28 [437] INFO:core:sig_usr: signal 15 received

backtrace:
(gdb) bt
#0  0xb50bfb61 in w_sip_capture (msg=0xb738a810, table_name=, 
resume_f=0x0, resume_param=0x0) at sipcapture.c:3433
#1  0x0806f227 in do_action (a=a@entry=0xb738968c, msg=msg@entry=0xb738a810) at 
action.c:1844
#2  0x08075c4f in run_action_list (a=0xb738968c, msg=0xb738a810) at action.c:172
#3  0x08073063 in do_action (a=a@entry=0xb7389700, msg=msg@entry=0xb738a810) at 
action.c:1108
#4  0x0807563d in run_action_list (msg=0xb738a810, a=) at 
action.c:172
#5  run_actions (a=a@entry=0xb7389700, msg=msg@entry=0xb738a810) at action.c:137
#6  0x0807622c in run_actions (msg=0xb738a810, a=0xb7389700) at action.c:130
#7  run_top_route (a=0xb7389700, msg=msg@entry=0xb738a810) at action.c:204
#8  0x0807e710 in receive_msg (
 buf=buf@entry=0xb50de70a  "INVITE sip:2...@csp1.acepbx.com:5060;user=phone 
SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.22.172:5060;branch=z9hG4bKf34dc6c0CA495609\r\nFrom: \"Angel\" 
;tag=FD8AA3F2-CD873993\r\nTo"..., len=, 
rcv_info=rcv_info@entry=0xbfc03f50, existing_context=existing_context@entry=0x0) at receive.c:208
#9  0xb50cf9c6 in raw_capture_rcv_loop (rsock=8, port1=5060, 
port2=port2@entry=5160, ipip=0) at sipcapture.c:5247
#10 0xb50cfaf0 in raw_socket_process (rank=0) at sipcapture.c:2185
#11 0x080d0c59 in start_module_procs () at sr_module.c:763
#12 0x0805ee5c in main_loop () at main.c:654
#13 main (argc=3, argv=0xbfc04174) at main.c:1265

full backtrace can be found here: https://www.aceinnovative.com/t/backtrace.txt

Thank you,

Michael

On Thursday, May 10, 2018 08:24:51 PM Bogdan-Andrei Iancu wrote:

Hi Michael,

What is the exact OpenSIPs revision you have (do 'opensips -V') ?

Also, could you extract the backtrace from the corefile ?

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
http://www.opensips-solutions.com
OpenSIPS Summit 2018
http://www.opensips.org/events/Summit-2018Amsterdam

On 05/08/2018 01:22 AM, Michael Ulitskiy wrote:

Hello,

I'm trying to use opensips with sipcature module to collect sip messaging on a
mirror port and feed it to homer database. Unfortunately it segfaults. I've
tried to use all latest 2.x versions with the same result. 1.11.11 seems to
work fine, but is missing necessary features. Since homer provides sample
configs for opensips 2.2.x all below is for opensips-2.2.6.

Here's excerpt from the log right before the crash:

May  7 18:05:43 [10752] DBG:core:_parse_to: display={},
ruri={sip:19179620875@66.114.x.y}
May  7 18:05:43 [10752] CRITICAL:sipcapture:ip_addr2a: unknown address family
841889590
May  7 18:05:43 [10752] CRITICAL:sipcapture:ip_addr2a: unknown address family
825112118
May  7 18:05:43 [10752] DBG:sipcapture:w_sip_capture: src_ip: [67.2]
May  7 18:05:43 [10752] DBG:sipcapture:w_sip_capture: dst_ip: [66.1]
May  7 18:05:43 [10752] DBG:sipcapture:w_sip_capture: dst_port: [5060]
May  7 18:05:43 [10752] DBG:sipcapture:w_sip_capture: src_port: [5060]
May  7 18:05:43 [10750] DBG:core:handle_sigs: status = 139
May  7 18:05:43 [10750] INFO:core:handle_sigs: child process 10752 exited by a
signal 11
May  7 18:05:43 [1

Re: [OpenSIPS-Users] How to change From user before do_routing?

2018-06-05 Thread Kirill Galinurov
Hello Вogdan. Thanks for answer. I thought so. I want to use db, and
cache_db to store groups. But our new system is very highload. About 6M
rules over 120 groups and 300 cps. So what about perfomance ? Internal
drouting groups is in memory and it very good.

2018-06-05 11:39 GMT+03:00 Bogdan-Andrei Iancu :

> Hello Kirill,
>
> The drouting module is fetching the original FROM header, as received from
> the network. So your changes from the script will be ignored.
>
> An alternative is to determine the routing group by yourself, at script
> level (like doing a DB query, even to the same dr_groups table, but using
> whatever value you want for the user) and push the group as parameter to
> the do_routing() function.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
> OpenSIPS Summit 2018
>   http://www.opensips.org/events/Summit-2018Amsterdam
>
> On 06/01/2018 05:05 PM, Kirill Galinurov wrote:
>
> Hi all. I use drouting module for LCR. No i use do_routing function in
> request_route() But i want normalize username in From before do_routing.
> How I can do it. Now do_routing() use old username for discover group.
> Also I want to change username in contact field before topology hiding.
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://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] How to change From user before do_routing?

2018-06-05 Thread Bogdan-Andrei Iancu

Hi Kirill,

Well, internally, the drouting module is also doing a query to DB , to 
the dr_group table (there is no cache here) -> so, it is the same, when 
comes to performance. Or you can keep the per-user routing group in the 
subscriber table and have it loaded during authentication (see the 
load_credential parameter).


And again, the dr_groups is not cached, it is a real time query to DB 
;). Only the rules/carriers/gateways are cached, but not the groups.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Summit 2018
  http://www.opensips.org/events/Summit-2018Amsterdam

On 06/05/2018 01:58 PM, Kirill Galinurov wrote:
Hello Вogdan. Thanks for answer. I thought so. I want to use db, and 
cache_db to store groups. But our new system is very highload. About 
6M rules over 120 groups and 300 cps. So what about perfomance ? 
Internal drouting groups is in memory and it very good.


2018-06-05 11:39 GMT+03:00 Bogdan-Andrei Iancu >:


Hello Kirill,

The drouting module is fetching the original FROM header, as
received from the network. So your changes from the script will be
ignored.

An alternative is to determine the routing group by yourself, at
script level (like doing a DB query, even to the same dr_groups
table, but using whatever value you want for the user) and push
the group as parameter to the do_routing() function.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com 
OpenSIPS Summit 2018
   http://www.opensips.org/events/Summit-2018Amsterdam


On 06/01/2018 05:05 PM, Kirill Galinurov wrote:

Hi all. I use drouting module for LCR. No i use do_routing
function in request_route() But i want normalize username in From
before do_routing.
How I can do it. Now do_routing() use old username for discover
group.
Also I want to change username in contact field before topology
hiding.


___
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


[OpenSIPS-Users] Round Robin alg and drouting

2018-06-05 Thread Abdoul Osséni
Hello list,

Since a few days, I am looking for a solution to my problem without success.

Any help will be appreciated.

My question is how implemented round robin algo with drouting?

For each prefix in dr_rule table, I try to make:

   1. first call -> gw1
   2. next call -> gw2
   3. after call  -> gw1
   4. next call -> gw2

Regards

Abdoul OSSENI
Ingénieur DevOps chez Néo-Soft
Co-Fondateur de ON SERVICES
Tél : +33 601 135 167
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] sipcapture segfaults when capturing on raw interface in all 2.x versions of opensips

2018-06-05 Thread Michael Ulitskiy
Hello,

Here's msg->rcv:

(gdb) frame 0
#0  0xb50bfb61 in w_sip_capture (msg=0xb738a810, table_name=, 
resume_f=0x0, resume_param=0x0)
at sipcapture.c:3433
3433sco.msg.s = h->u.hepv12.payload;
(gdb) p msg->rcv
$2 = {src_ip = {af = 2, len = 4, u = {addrl = {2389972783, 3040358736, 
3037670688, 3037552928}, addr32 = {
2389972783, 3040358736, 3037670688, 3037552928}, addr16 = {5935, 36468, 
12624, 46392, 11552, 46351, 
24864, 46349}, addr = "/\027t\216P18µ -\017µ a\rµ"}}, dst_ip = {af = 2, 
len = 4, u = {addrl = {
1246982722, 3037552928, 31, 3077604236}, addr32 = {1246982722, 
3037552928, 31, 3077604236}, addr16 = {
29250, 19027, 24864, 46349, 31, 0, 33676, 46960}, addr = "BrSJ 
a\rµ\037\000\000\000\214\203p·"}}, 
  src_port = 4940, dst_port = 5060, proto = 1, proto_reserved1 = -1257415776, 
proto_reserved2 = -1257467391, 
  src_su = {s = {sa_family = 2, sa_data = 
"\023L/\027t\216\000\000\000\000\000\000\000"}, sin = {sin_family = 2, 
  sin_port = 19475, sin_addr = {s_addr = 2389972783}, sin_zero = 
"\000\000\000\000\000\000\000"}, sin6 = {
  sin6_family = 2, sin6_port = 19475, sin6_flowinfo = 2389972783, sin6_addr 
= {__in6_u = {
  __u6_addr8 = '\000' , __u6_addr16 = {0, 0, 0, 0, 0, 
0, 0, 0}, __u6_addr32 = {0, 0, 
0, 0}}}, sin6_scope_id = 0}}, bind_address = 0x807b872 
}

If I set "hep_capture_on" set to 1 then it doesn't crash, but it doesn't store 
anything into db either.
Here's what it says:

Jun  5 10:54:57 [3231] DBG:core:receive_msg: After parse_msg...
Jun  5 10:54:57 [3231] DBG:core:receive_msg: preparing to run routing scripts...
Jun  5 10:54:57 [3231] WARNING:sipcapture:w_sip_capture: not a hep message!
Jun  5 10:54:57 [3231] DBG:core:destroy_avp_list: destroying list (nil)
Jun  5 10:54:57 [3231] DBG:core:receive_msg: cleaning up

Am I doing something wrong?
Thanks,

Michael

On Tuesday, June 05, 2018 01:39:03 PM Bogdan-Andrei Iancu wrote:
> Hi Michael,
> 
> This crash seems to be triggered mainly by the "hep_capture_on" set to 0 .
> 
> Just to check couple of things, using gdb, in frame 0, could you print 
> msg->rcv ? it is interesting why those IPs are not valid (see the 
> critical logs before the crash). Afterwards, the crash itself happened 
> because of 'h' being null (hep_capture_on set to 0 ).
> 
> Thanks,
> 
> Bogdan-Andrei Iancu
> 
> OpenSIPS Founder and Developer
>http://www.opensips-solutions.com
> OpenSIPS Summit 2018
>http://www.opensips.org/events/Summit-2018Amsterdam
> 
> On 05/30/2018 10:55 PM, Michael Ulitskiy wrote:
> > Hello,
> >
> > I apologize for so delayed response.
> >
> > Here's opensips revision:
> >
> > root@clog1:/usr/local/opensips/etc/opensips# 
> > /usr/local/opensips/sbin/opensips -V
> > version: opensips 2.2.6 (i386/linux)
> > flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
> > FAST_LOCK-ADAPTIVE_WAIT
> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
> > MAX_URI_SIZE 1024, BUF_SIZE 65535
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> > git revision: 24507b1ce
> > main.c compiled on 17:18:03 May  2 2018 with gcc 4.7.1
> >
> > debug log:
> >
> > May 30 15:29:28 [436] CRITICAL:sipcapture:ip_addr2a: unknown address family 
> > 841889588
> > May 30 15:29:28 [436] CRITICAL:sipcapture:ip_addr2a: unknown address family 
> > 825112118
> > May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: src_ip: [47.2]
> > May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: dst_ip: [66.1]
> > May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: dst_port: [5060]
> > May 30 15:29:28 [436] DBG:sipcapture:w_sip_capture: src_port: [4940]
> > May 30 15:29:28 [435] DBG:core:handle_sigs: status = 139
> > May 30 15:29:28 [435] INFO:core:handle_sigs: child process 436 exited by a 
> > signal 11
> > May 30 15:29:28 [435] INFO:core:handle_sigs: core was generated
> > May 30 15:29:28 [435] INFO:core:handle_sigs: terminating due to SIGCHLD
> > May 30 15:29:28 [437] INFO:core:sig_usr: signal 15 received
> >
> > backtrace:
> > (gdb) bt
> > #0  0xb50bfb61 in w_sip_capture (msg=0xb738a810, table_name= > out>, resume_f=0x0, resume_param=0x0) at sipcapture.c:3433
> > #1  0x0806f227 in do_action (a=a@entry=0xb738968c, 
> > msg=msg@entry=0xb738a810) at action.c:1844
> > #2  0x08075c4f in run_action_list (a=0xb738968c, msg=0xb738a810) at 
> > action.c:172
> > #3  0x08073063 in do_action (a=a@entry=0xb7389700, 
> > msg=msg@entry=0xb738a810) at action.c:1108
> > #4  0x0807563d in run_action_list (msg=0xb738a810, a=) at 
> > action.c:172
> > #5  run_actions (a=a@entry=0xb7389700, msg=msg@entry=0xb738a810) at 
> > action.c:137
> > #6  0x0807622c in run_actions (msg=0xb738a810, a=0xb7389700) at action.c:130
> > #7  run_top_route (a=0xb7389700, msg=msg@entry=0xb738a810) at action.c:204
> > #8  0x0807e710 in receive_msg (
> >  buf=buf@entry=0xb50de70a  "INVITE 
> > sip:2...@csp1.acepbx.com:5060;user=phone SIP/2.0\r\nVia: SIP/2.0/UDP 
> > 192.168