[OpenSIPS-Users] opensips will not start while loading huge blacklist

2018-09-27 Thread Abdul Basit
Hi team,

I have a opensips 2.4 deployed having 4 children and with mysql configured
for loading user blacklist to opensips local cache on opensips startup.
Opensips work fine on filtering the call based on user blacklist records
loaded into local cache.

While blacklist was growing upto 1.3m records, opensips startup was taking
~60 sec on VM of 16GB RAM and 6 CPU.
I increased shared memory to *6144* and package memory to *256.*
Filter works fine here yet. Call load is not that much only blacklist
entries are growing.

But now blacklist has grown to very huge number, up to 10m records in
mysql. Opensips is not starting successfully and service startup requests
timeout after huge CPU spikes while trying to populate local cache from
mysql.
I increased shared memory to *12288* and package memory to *1024* but no
success yet.

I indexed mysql blacklist table but no luck.

Please advise what settings I should add to opensips for successful
startup.

--
regards,

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


[OpenSIPS-Users] FW: problem with hep tracing.

2018-09-27 Thread johan de clercq
 

 

Hi, 

Using opensips 2.4, 

 

I try to send all the sip messages to a homer server (5.0.5).  I made the
opensips config like this:

 HEP

loadmodule "proto_hep.so"

modparam("proto_hep", "hep_id","[hep_dst]192.168.0.3:9060; version=2")

### activate homer5 CSV like format for the payload

modparam("proto_hep", "homer5_on", 1)

### set the delimiter for the payload 

modparam("proto_hep", "homer5_delim", "##")

 SIPtrace

loadmodule "siptrace.so"

modparam("siptrace", "trace_id", "[hep_id]uri=hep:hep_dst")

 

. 

Route 

{

.

if (is_method("REGISTER"))

{

sip_trace("hep_id","t","sip");

if (!www_authorize("", "subscriber"))

{

www_challenge("", "0");

exit;

}



if (!save("location")){

sl_reply_error();

exit;

}

exit;

}

.

##initial INVITE

if (is_method("INVITE") && !has_totag())

{

xlog("callid=$ci: Route[0]: initial INVITE is coming in from A: $fU
to B: $rU");

xlog("callid=$ci: Route[0]: let's do accounting first");

do_accounting("db","cdr");

sip_trace("hep_id","d","sip");

. 

}

 

Opensips sends the packets correctly, see attached file. 

Unfortunately, homer keeps complaining .. 

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR:  [core/lvalue.c:346]:
lval_pvar_assign(): non existing right pvar

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR:  [core/lvalue.c:404]:
lval_assign(): assignment failed at pos: (1049,30-1049,40)

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR: 

Re: [OpenSIPS-Users] problem with hep tracing.

2018-09-27 Thread johan de clercq
Oh I forgot to say : opensips version used is 2.4 

 

Best regards, 

 

From: johan de clercq  
Sent: Thursday, September 27, 2018 8:54 PM
To: 'OpenSIPS users mailling list' 
Subject: FW: problem with hep tracing. 

 

 

Hi, 

I try to send all the sip messages to a homer server (5.0.5).  I made the
opensips config like this:

 HEP

loadmodule "proto_hep.so"

modparam("proto_hep", "hep_id","[hep_dst]192.168.0.3:9060; version=2")

### activate homer5 CSV like format for the payload

modparam("proto_hep", "homer5_on", 1)

### set the delimiter for the payload 

modparam("proto_hep", "homer5_delim", "##")

 SIPtrace

loadmodule "siptrace.so"

modparam("siptrace", "trace_id", "[hep_id]uri=hep:hep_dst")

 

. 

Route 

{

.

if (is_method("REGISTER"))

{

sip_trace("hep_id","t","sip");

if (!www_authorize("", "subscriber"))

{

www_challenge("", "0");

exit;

}



if (!save("location")){

sl_reply_error();

exit;

}

exit;

}

.

##initial INVITE

if (is_method("INVITE") && !has_totag())

{

xlog("callid=$ci: Route[0]: initial INVITE is coming in from A: $fU
to B: $rU");

xlog("callid=$ci: Route[0]: let's do accounting first");

do_accounting("db","cdr");

sip_trace("hep_id","d","sip");

. 

}

 

Opensips sends the packets correctly, see attached file. 

Unfortunately, homer keeps complaining .. 

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR:  [core/lvalue.c:346]:
lval_pvar_assign(): non existing right pvar

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR:  [core/lvalue.c:404]:
lval_assign(): assignment failed at pos: (1049,30-1049,40)

Sep 27 18:29:49 ns3019374 homer[22750]: ERROR: 

Re: [OpenSIPS-Users] rabbitmq module

2018-09-27 Thread Tito Cumpen
Razvan,

I don't mind accessing every value indivually if there is no other way. The
issue I have with event rabbitmq is that it does not support vhost and I'd
like to use cloudamqp which can only be used with vhost. Can you provide
insight as to how I can access the extra fields ? There is a wild card
evi_extra* in acc exported attributes which can offer the values but I'm
not sure how it's used.

Thanks,
Tito


On Thu, Sep 27, 2018, 1:12 AM Răzvan Crainea  wrote:

> Hi, Tito!
>
> No, unfortunately there's no way to get all the values of the fields.
> What you could do though is to use event_rabbitmq and have OpenSIPS
> publishing the event directly, without passing it through the script.
> This way you will get automatically all events.
>
> Best regards,
> Răzvan
>
> On 9/26/18 11:50 PM, Tito Cumpen wrote:
> > Hello,
> >
> >
> > I am trying to use the rabbitmq module to circumvent the limitations of
> > the event_rabbit module which lacks vhost support.
> > Currently I am having an issue grabbing the extra params defined in acc
> > as such
> >
> > modparam("acc", "extra_fields", "evi:from_user -> from_user;from_uri ->
> > from_uri;to_user -> to_user; to_uri -> to_uri; session ->session;
> > environment -> environment")
> >
> >
> >
> > event_route[E_ACC_EVENT] {
> >  fetch_event_params("extra*=$avp(extra)");
> > $avp(param) =  $avp(extra);
> >
> > rabbitmq_publish("ID1", "cdr", "$avp(param)");
> > }
> >
> >
> > Ideally I would like to take all the data within the event as it is done
> > when subscribing via the
> > subscribe_event("E_ACC_EVENT", "rabbitmq) method. Is there variable that
> > I can use to get the entire body of the even't?
> >
> > Thanks,
> > Tito
> >
> >
> >
> >
> > ___
> > 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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RTPPROXY not starting on correct user account

2018-09-27 Thread Steven Platt
Greetings,

I am having trouble with RTPProxy bridging media in Opensips 2.3.5

Currently, it seems that RTPProxy is starting as user "root" and not user
"rtpproxy" as it should.
In etc/init.d/rtpproxy I have added the additional daemon options to load
the service as user "rtpproxy", but these seem to be ignored. Running
RTPProxy as root, gives me log errors and does not function.

DAEMON_OPTS="-l [server public ip] -s udp:127.0.0.1:7890 -u rtpproxy
rtpproxy -d DBUG:LOG_LOCAL0"

I can manually kill the existing rtpproxy process and start it again with
the switches to run in the correctly user. If I do this I get working media
on my LAN, but still nothing when connecting with a phone on cellular NAT -
even thought opensips sees RTP proxy sock available.

So I have 2 problems:
- RTPPROXY not starting as "rtpproxy" user
- RTPPROXY when working as normal, does not bridge media for cellular
device NAT.

# I later kill the PID for the RTPproxy instance running as root
root@opensips-server:~# ps aux | grep rtpproxy
rtpproxy  4458  0.0  0.0  93232  1596 ?Ssl  09:09   0:00
/usr/bin/rtpproxy -l [ server public ip] -s udp:127.0.0.1 7890 -u rtpproxy
rtpproxy -d DBUG LOG_LOCAL0
root  4784  0.0  0.0   4336  1624 ?Ss   09:12   0:00 /bin/sh
/etc/init.d/rtpproxy start
root  4787  0.0  0.0  19476  2196 ?S09:12   0:00
/usr/bin/rtpproxy -l [ server public ip] -s udp:127.0.0.1:7890 -u rtpproxy
rtpproxy -d DBUG LOG_LOCAL0
root  4831  0.0  0.0  12732  2136 pts/0S+   09:13   0:00 grep
rtpproxy

### RTP Proxy Config
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=rtpproxy
DESC="RTP relay"
DAEMON=/usr/bin/$NAME
USER=$NAME
GROUP=$USER
PIDFILE="/var/run/$NAME/$NAME.pid"
PIDFILE_DIR=`dirname $PIDFILE`
CONTROL_SOCK="unix:$PIDFILE_DIR/$NAME.sock"

test -x $DAEMON || exit 0
umask 002

. /lib/lsb/init-functions

# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi

DAEMON_OPTS="-l [server public ip] -s udp:127.0.0.1:7890 -u rtpproxy
rtpproxy -d DBUG:LOG_LOCAL0"



 OpenSIPS Config
  NAT modules
loadmodule "nathelper.so"
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", "SIP_PING_FLAG")
modparam("nathelper", "sipping_from", "sip:pinger@127.0.0.1") #CUSTOMIZE ME
modparam("nathelper", "received_avp", "$avp(received_nh)")

loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:7890") # CUSTOMIZE ME


###Log from opensips look normal to me
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4443_3 VF 20081102"
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4452]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4451]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4442]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4461]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4463]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4464]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4454]:
INFO:rtpproxy:rtpp_test: rtp proxy  found, support for
it enabled
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4443_3 1#012"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4433_3 VF 20081102"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4433_3 1#012"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4434_1 VF 20050322"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4434_1 1#012"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4437_1 VF 20050322"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4437_1 1#012"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4442_0 V"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4442_0 20040107#012"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4452_0 V"
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:doreply: sending reply
"4452_0 20040107#012"
Sep 27 14:25:42 opensips-server /usr/sbin/opensips[4437]:
WARNING:dialplan:dp_load_db: no data in the db
Sep 27 14:25:42 opensips-server rtpproxy[4424]: DBUG:handle_command:
received command "4451_0 V"
Sep 27 14:25:42 opensips-server opensips: 

Re: [OpenSIPS-Users] rewite contact

2018-09-27 Thread Bogdan-Andrei Iancu

Hi Salva,

The CT "*" will be forwarded to the main-registrar and all the local 
contacts (on mid-registrar) discarded.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 09/27/2018 01:19 AM, Slava Bendersky wrote:

Hello Bogdan,
How mid_registrar will handle * on Contact header

2018/09/26 16:23:21.555947 10.30.100.41:5060 -> 10.30.100.48:5160
REGISTER sip:domain.com:5160 SIP/2.0
Via: SIP/2.0/UDP 
10.30.100.41:5060;branch=z9hG4bKabc6.46892d12.0;i=00250de2
Via: SIP/2.0/TLS 
192.168.1.65:5060;received=190.240.46.242;branch=z9hG4bK834060502;rport=61454;alias

From: ;tag=1400521034
To: 
Call-ID: 1371876924-506...@bjc.bgi.b.gf
CSeq: 2000 REGISTER
Contact: *
X-Grandstream-PBX: true
Max-Forwards: 69
User-Agent: Grandstream GXP1760W 1.0.1.74
Expires: 0
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, 
REFER, UPDATE, MESSAGE

Content-Length: 0
Path: 

On Sep 26 2018, at 9:23 am, Slava Bendersky  
wrote:



Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact
will not contain ;transport=tls.

volga629


*From: *"volga629" 
*To: *"Bogdan-Andrei Iancu" 
*Cc: *"OpenSIPS users mailling list" 
*Sent: *Wednesday, September 26, 2018 9:22:09 AM
*Subject: *Re: [OpenSIPS-Users] rewite contact

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact
will not contain ;transport=tls.

volga629

*From: *"Bogdan-Andrei Iancu" 
*To: *"OpenSIPS users mailling list" ,
"Slava Bendersky" 
*Sent: *Wednesday, September 26, 2018 6:45:09 AM
*Subject: *Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the
user and domain part of the URI contact. The URI parameters are
preserved. The transport too, unless you change the outbound
socket (to a different protocol).

Regards,
|

|Bogdan-Andrei Iancu|

|OpenSIPS Founder and Developer|
|||http://www.opensips-solutions.com|
|OpenSIPS Bootcamp 2018|
|||http://opensips.org/training/OpenSIPS_Bootcamp_2018/|

|
On 09/26/2018 05:19 AM, Slava Bendersky wrote:

Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

 REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: 
\r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~>
[$ct]\n");
}


Freeswitch contact

Call-ID: 1293754241-506...@bjc.bgi.b.gf

User: 1...@domain.com 
Contact: ""




Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59)
EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: 1...@domain.com 
volga629




|

|___|
|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] rewite contact

2018-09-27 Thread Bogdan-Andrei Iancu

Hi Slava,

Could you provide a small pcap showing the incoming and outgoing 
REGISTER requests (with the network info too) ?


Re-iterating on how the CT parameters are working with mid_registrar - 
all incoming CT URI parameters are removed (as locally stored), so by 
default there is no parameter in the outbound REGISTER, unless you use 
"extra_contact_params_avp" module parameter.


Thanks,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 09/26/2018 03:22 PM, Slava Bendersky wrote:

Hello Bogdan,
Yes, the issue that outbound socket is UDP I expected that contact 
will not contain ;transport=tls.


volga629


*From: *"Bogdan-Andrei Iancu" 
*To: *"OpenSIPS users mailling list" , 
"Slava Bendersky" 

*Sent: *Wednesday, September 26, 2018 6:45:09 AM
*Subject: *Re: [OpenSIPS-Users] rewite contact

Hi Slava,

By definition mid_registrar *will* change the contact, mainly the user 
and domain part of the URI contact. The URI parameters are preserved. 
The transport too, unless you change the outbound socket (to a 
different protocol).


Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 09/26/2018 05:19 AM, Slava Bendersky wrote:

Hello Everyone,
In which case mid_registrar will not rewrite contact ?
I see when present param ;transport=tls contact is not rewritten.
config

 REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2)
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)")
modparam("mid_registrar", "max_contacts", 10)
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")
modparam("mid_registrar", "outgoing_expires", 7200)

code

if($proto=="TCP|tcp|TLS|tls") {
setflag(TCP_PERSIST_REGISTRATIONS);
}
mid_registrar_save("location","p1");
# Work arround for github issue #1109
append_hf("Path: \r\n");
xlog("L_INFO", "Forwarding REGISTER to main registrar ~> [$ct]\n");
}


Freeswitch contact

Call-ID: 1293754241-506...@bjc.bgi.b.gf
User: 1...@domain.com
Contact: ""


Agent: Grandstream GXP1760W 1.0.1.74
Status: Registered(TLS)(unknown) EXP(2018-09-30 19:37:59)
EXPSECS(429254)
Ping-Status: Reachable
Ping-Time: 0.00
Host: pbx04.domain.lan
IP: 10.30.100.41
Port: 5060
Auth-User: 101
Auth-Realm: domain.com
MWI-Account: 1...@domain.com 
volga629




___
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] rabbitmq module

2018-09-27 Thread Răzvan Crainea

Hi, Tito!

No, unfortunately there's no way to get all the values of the fields. 
What you could do though is to use event_rabbitmq and have OpenSIPS 
publishing the event directly, without passing it through the script. 
This way you will get automatically all events.


Best regards,
Răzvan

On 9/26/18 11:50 PM, Tito Cumpen wrote:

Hello,


I am trying to use the rabbitmq module to circumvent the limitations of  
the event_rabbit module which lacks vhost support.
Currently I am having an issue grabbing the extra params defined in acc 
as such


modparam("acc", "extra_fields", "evi:from_user -> from_user;from_uri -> 
from_uri;to_user -> to_user; to_uri -> to_uri; session ->session; 
environment -> environment")




event_route[E_ACC_EVENT] {
     fetch_event_params("extra*=$avp(extra)");
    $avp(param) =  $avp(extra);

    rabbitmq_publish("ID1", "cdr", "$avp(param)");
}


Ideally I would like to take all the data within the event as it is done 
when subscribing via the
subscribe_event("E_ACC_EVENT", "rabbitmq) method. Is there variable that 
I can use to get the entire body of the even't?


Thanks,
Tito




___
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