Re: [OpenSIPS-Users] Opensips 2.5 and fraud module

2018-06-13 Thread Liviu Chircu
I agree - it seems like a "good in theory, bad in practice" kind of 
feature.  So let's see how we can make it better: would it make more 
sense to add a forced dialog lifetime equal to the critical threshold of 
the "call duration" setting upon calling check_fraud() (which, by the 
way, will also create the dialog if it's not there), while keeping the 
event alerts just like they are now?


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 12.06.2018 13:12, Денис Путято via Users wrote:

Hmm.
And what is the purpose of control "per call"?
As i understand it triggers AFTER calls finishing. What can we do in 
such situation?
Just send email to, for example, support, that "potential fraud" call 
has been finished?



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


Re: [OpenSIPS-Users] OpenSIPs 2.3.3 - cachedb_mongodb - problems with connecting to secure Mongo with the latest mongoc driver

2018-06-13 Thread Liviu Chircu

Update: issue found and fixed on master branch [1], as well as 2.4 and 2.3.

[1]: https://github.com/OpenSIPS/opensips/commit/e4f98a6d4c830ee1f

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 13.06.2018 17:18, Liviu Chircu wrote:

Hi, Vladimir!

Definitely looks like a code issue, and shouldn't be too hard to fix.  
Thanks for the report! I should be able to look into it during these 
days.


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 09.06.2018 02:49, vladimirk wrote:

Hello,

I am trying to use db_cachedb in conjunction with cachedb_mongodb.
Everything was working fine until we switched to the secured Mongo 
DB. Now

we switched to use secure mongo instance.

When we use a connection string like below

Config:
loadmodule "cachedb_mongodb.so"
modparam("cachedb_mongodb", "compat_mode_3.0", 1)
loadmodule "db_cachedb.so"
modparam("cachedb_mongodb|db_cachedb", "cachedb_url",
"mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col")
modparam("db_cachedb", "cachedb_url",
"mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col")

  server fails with the following error:

Log:
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_bind_api: BINDING 
API for

: cachedb://mongodb:instance1
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_init: Found 
matching URL :

[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:cachedb_bind_mod: Binded to mod mongodb
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: parsing
[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: in host - :
Jun  8 19:39:02 [30738] DBG:core:cachedb_do_init: opening new connection
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: 
MongoDB

conn for [opensips-30738]: mongodb:instance1 myUser:SuperSecret
|mongolocal|:27017
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col
2018/06/08 19:39:02.0865: [30738]:  WARNING:   mongoc: Error parsing
URI: 'Invalid database name in URI'
Jun  8 19:39:02 [30738] ERROR:cachedb_mongodb:mongo_new_connection: 
failed

to connect to Mongo
(mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col)
Jun  8 19:39:02 [30738] ERROR:core:cachedb_do_init: failed to open
connection
Jun  8 19:39:02 [30738] ERROR:db_cachedb:db_cachedb_init: Failed to 
connect

to the cachedb back-end


I have also noticed, that when we have user/password in the URL,
mongo_new_connection receives connection string with the collection 
name at

the end

Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col

This is not happening if I use connection string with authentication.

Can you help to resolve this issue? Can this be resolved with the
configuration only or this looks more like a code issue?

Thanks,
Vladimir





--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html


___
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 2.3.3 - cachedb_mongodb - problems with connecting to secure Mongo with the latest mongoc driver

2018-06-13 Thread Liviu Chircu

Hi, Vladimir!

Definitely looks like a code issue, and shouldn't be too hard to fix.  
Thanks for the report! I should be able to look into it during these days.


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 09.06.2018 02:49, vladimirk wrote:

Hello,

I am trying to use db_cachedb in conjunction with cachedb_mongodb.
Everything was working fine until we switched to the secured Mongo DB. Now
we switched to use secure mongo instance.

When we use a connection string like below

Config:
loadmodule "cachedb_mongodb.so"
modparam("cachedb_mongodb", "compat_mode_3.0", 1)
loadmodule "db_cachedb.so"
modparam("cachedb_mongodb|db_cachedb", "cachedb_url",
"mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col")
modparam("db_cachedb", "cachedb_url",
"mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col")

  server fails with the following error:

Log:
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_bind_api: BINDING API for
: cachedb://mongodb:instance1
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_init: Found matching URL :
[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:cachedb_bind_mod: Binded to mod mongodb
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: parsing
[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: in host - :
Jun  8 19:39:02 [30738] DBG:core:cachedb_do_init: opening new connection
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: MongoDB
conn for [opensips-30738]: mongodb:instance1 myUser:SuperSecret
|mongolocal|:27017
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col
2018/06/08 19:39:02.0865: [30738]:  WARNING:   mongoc: Error parsing
URI: 'Invalid database name in URI'
Jun  8 19:39:02 [30738] ERROR:cachedb_mongodb:mongo_new_connection: failed
to connect to Mongo
(mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col)
Jun  8 19:39:02 [30738] ERROR:core:cachedb_do_init: failed to open
connection
Jun  8 19:39:02 [30738] ERROR:db_cachedb:db_cachedb_init: Failed to connect
to the cachedb back-end


I have also noticed, that when we have user/password in the URL,
mongo_new_connection receives connection string with the collection name at
the end

Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col

This is not happening if I use connection string with authentication.

Can you help to resolve this issue? Can this be resolved with the
configuration only or this looks more like a code issue?

Thanks,
Vladimir





--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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] mid registrar

2018-06-13 Thread Liviu Chircu

Hi Alexei,

Indeed, it seems the mid-registrar data ("kv_store" column) only gets 
sync'ed to DB starting with the 2nd REGISTER, despite the 
"write-through" mode.  I'll take a closer look and will update you on 
the progress in this thread.  Thank you for the report!


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 12.06.2018 10:47, vasilevalex wrote:

I have issue with very simple setup.

Two OpenSIPS servers (first is Active, second starts with keepalived only on
Active server failure, so not a cluster at all) connected to MariaDB with
same configs. Asterisk farm is registrar.

# USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")
modparam("usrloc", "db_url", "DB_URL")

 Mid Registrar module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 1800)
modparam("mid_registrar", "received_avp", "$avp(received_uri)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

This setup works somehow. Failover server starts with all locations
consistent and continues working. But when there are several switching
between Active/Failover in relatively short time, like 5-10 minutes then
most of the phones can't update their registrations because of the errors:

ERROR:mid_registrar:process_contacts_by_aor: 'last_reg_ts' key not found!

Only cleaning user location helps, like "opensipsctl ul rm " After that
phone can register again.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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] siptrace trace_dialog() not capturing ACKs or other replies 1.11.11

2018-06-13 Thread Kneeoh via Users
I've followed the documentation for using the siptrace module to capture 
packets and transmit them to a sipcapture node. Things are kind of working, 
however, I'm not getting ACKs or other replies in the capture node. I'm using 
the following in my script. Any ideas or pointers on what I might be doing 
wrong?
 SIP Trace moduleloadmodule "siptrace.so"modparam("siptrace", "db_url", 
"mysql://user:passwd@host/dbname")modparam("siptrace", "duplicate_uri", 
"sip:10.10.61.191:9060")modparam("siptrace", "duplicate_with_hep", 
1)modparam("siptrace", "trace_to_database", 0)modparam("siptrace", 
"enable_ack_trace", 1)modparam("siptrace", "trace_on", 1)modparam("siptrace", 
"trace_flag", "TRACE_FLAG")modparam("siptrace", "hep_version", 2)

# create dialog with timeout and hide topology if ( !create_dialog("B") ) { 
xlog("L_INFO", "Unable to create dialog \n"); send_reply("500","Internal Server 
Error"); exit;
 } else {
 # We have a dialog, Lets hide the topology from where the call originated 
topology_hiding(); $T_fr_timeout = 5; }


# Trace this dialog setflag(TRACE_FLAG); #sip_trace(); trace_dialog();___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Fraud module strange behavior

2018-06-13 Thread Liviu Chircu
On a side note, the good news is that you can easily bypass this bug 
within the event_route: simply ignore any negative "concurrent calls" 
reports! Hopefully, it won't take long until we get to the bottom of it, 
and provide the official fix.



Cheers,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 13.06.2018 14:04, Liviu Chircu wrote:


Hi, Guillaume!


That definitely looks like a bug. Most likely, we are either talking 
about a locking issue, causing too few increments, or a dialog 
callback issue, causing too many decrements. Marking this as a bug -- 
I will try to find some time and review the concerned code asap.



Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 13.06.2018 12:24, Guillaume Montassier wrote:


Hi list,


I have a strange behavior possibly a bug with opensips fraud module.


Sometime an call is block because of a critical threshold on 
concurrent calls. The vast majority of the time it work really well. 
But sometime, when I raise E_FRD_CRITICAL and check 
$var(val);$var(thr) I got something like this -1;31. Meaning that on 
a maximum of 31 calls the user is on -1.



I don't get where that -1 came from and why it raise a critical 
alert. Also, that -1 appears uniquely on that concurrent calls 
parameters, all the others parameters work fine.



Any idea? or tips for debugging?



Thanks,


Guillaume MONTASSIER



___
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] Fraud module strange behavior

2018-06-13 Thread Liviu Chircu

Hi, Guillaume!


That definitely looks like a bug. Most likely, we are either talking 
about a locking issue, causing too few increments, or a dialog callback 
issue, causing too many decrements. Marking this as a bug -- I will try 
to find some time and review the concerned code asap.



Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 13.06.2018 12:24, Guillaume Montassier wrote:


Hi list,


I have a strange behavior possibly a bug with opensips fraud module.


Sometime an call is block because of a critical threshold on 
concurrent calls. The vast majority of the time it work really well. 
But sometime, when I raise E_FRD_CRITICAL and check 
$var(val);$var(thr) I got something like this -1;31. Meaning that on a 
maximum of 31 calls the user is on -1.



I don't get where that -1 came from and why it raise a critical alert. 
Also, that -1 appears uniquely on that concurrent calls parameters, 
all the others parameters work fine.



Any idea? or tips for debugging?



Thanks,


Guillaume MONTASSIER



___
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] Fraud module strange behavior

2018-06-13 Thread Guillaume Montassier
Hi list,


I have a strange behavior possibly a bug with opensips fraud module.


Sometime an call is block because of a critical threshold on concurrent calls. 
The vast majority of the time it work really well. But sometime, when I raise 
E_FRD_CRITICAL and check $var(val);$var(thr) I got something like this  -1;31. 
Meaning that on a maximum of 31 calls the user is on -1.


I don't get where that -1 came from and why it raise a critical alert. Also, 
that -1 appears uniquely on that concurrent calls parameters, all the others 
parameters work fine.


Any idea? or tips for debugging?



Thanks,


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


Re: [OpenSIPS-Users] MID_REGISTRAR insertion_mode

2018-06-13 Thread Alexey Kazantsev via Users
Shame on me:)

configured 2.4 while reading docs for 2.3.

---
BR, Alexey
http://alexeyka.zantsev.com/___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] MID_REGISTRAR insertion_mode

2018-06-13 Thread Alexey Kazantsev via Users
Hi list.

I faced a problem, configuring 'insertion_mode' parameter in 'mid_registrar' 
module.
http://www.opensips.org/html/docs/modules/2.3.x/mid_registrar.html#modparam-insertion-mode

By default, its value is '0', and only this saves me.

When I try to set it explicitly, no matter '0' or '1', a get an error:


dpz2-pbx opensips # opensips -C -f opensips-path.cfg 
Jun 13 12:41:23 [6058] ERROR:core:set_mod_param_regex: parameter 
 not found in module 
Jun 13 12:41:23 [6058] CRITICAL:core:yyerror: parse error in config file 
opensips-path.cfg, line 54, column 19-20: Parameter  not found 
in module  - can't set
Jun 13 12:41:23 [6058] ERROR:core:main: bad config file (1 errors)
Jun 13 12:41:23 [6058] NOTICE:core:main: Exiting


This is both on:

OpenSIPS (2.4.1 (x86_64/linux)) from yum.opensips.org
CentOS Linux release 7.4.1708 (Core) 

and

Server:: OpenSIPS (2.4.1 (x86_64/linux)) from apt.opensips.org
Debian 9.4 (Stretch)



---
BR, Alexey
http://alexeyka.zantsev.com/  
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users