Re: [OpenSIPS-Users] event routing and rtpengine

2018-04-19 Thread Tito Cumpen
Bogdan,


Once I declared the branch route it looks like it is going through the
branch route logic.  The issue I have is parsing the exported $avp(uri) for
transport=ws and then setting a branch flag that is kept from the event
route

route[fork_call]  {
xlog("user $avp(aor) registered the a new contact $avp(uri), "
"injecting it in transaction \n");

$var(uri) = $avp(uri);
   #if transport is ws then ;
setbflag(DST_WS); #this branch flag is not kept nor considered when
branch route is executed

t_inject_branches("event");

}

Thanks,
Tito

On Thu, Apr 19, 2018 at 3:23 AM, Bogdan-Andrei Iancu 
wrote:

> Tito,
>
> Arming the branch route once, in the request route, before the initial
> t_relay() should be fine. Now, if you use any xlog() to check , is the
> branch route triggered for the injected branch ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   http://www.opensips-solutions.com
> OpenSIPS Summit 2018
>   http://www.opensips.org/events/Summit-2018Amsterdam
>
> On 04/18/2018 08:35 PM, Tito Cumpen wrote:
>
> Bogdan,
>
> The branch route is defined in my my relay route. https://pastebin.com/
> MFcLxcDv Should it be defined in the event route I figured since the
> original transaction used the relay route it would use the route defined
> there ?
>
> Thanks,
> Tito
>
>
>
>
>
> On Wed, Apr 18, 2018 at 9:32 AM, Bogdan-Andrei Iancu 
> wrote:
>
>> Hi Tito,
>>
>> I see no branch route in your script sample.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>   http://www.opensips-solutions.com
>> OpenSIPS Summit 2018
>>   http://www.opensips.org/events/Summit-2018Amsterdam
>>
>> On 04/16/2018 09:37 PM, Tito Cumpen wrote:
>>
>> Group,
>>
>> I am having issues when injecting a new branch with rtpengine flags to a
>> call request using the event routing module. It seems like when the branch
>> is injected it either does not use any of the flags to aid with rtpengine
>> media translation or does not run through the branch route block defined in
>> my relay route at all.
>>
>> https://pastebin.com/u1EYzDe0
>>
>> above is the route that prepares injection and transport priorities along
>> with the route that gets called upon a new registration.
>>
>> Thanks,
>> Tito
>>
>>
>> ___
>> 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] Opensips 2.5 and fraud module

2018-04-19 Thread Liviu Chircu

Hi Denis!

Good catch! For the first time, I documented a parameter, but forgot to 
export it for the script writer as well! :)


It is now fixed. Thank you!

Cheers,

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

On 19.04.2018 17:28, Denis via Users wrote:

Hello, Liviu!
I had installed latest Opensips 2.2 (Opensips 2.2.6)
In a log file, during start of Opensips, i can see
ERROR:core:set_mod_param_regex: parameter  not found 
in module 

Where is mistake?
Thank you.
--
С уважением, Денис.
Best regards, Denis
13.04.2018, 09:49, "Denis via Users" :

Ok, thank you
--
С уважением, Денис.
Best regards, Denis
12.04.2018, 14:23, "Liviu Chircu" >:


Use $Ts [1] to get the current UNIX timestamp in seconds.

[1]: http://www.opensips.org/Documentation/Script-CoreVar-2-4#toc91

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com 
On 12.04.2018 14:08, Denis via Users wrote:
Liviu, is there any way to find out current time from Opensips 
during call processing (some functions, variables etc which i can 
use in opensips.cfg)?

Thank you
--
С уважением, Денис.
Best regards, Denis
12.04.2018, 13:50, "Liviu Chircu"  
:


Hi Denis,

The fraud detection module has no such mechanism, currently. We 
could invent some variables such as $frd_last_warn, 
$frd_last_crit, $frd_first_warn, $frd_first_crit. They would 
output a UNIX timestamp. If there were no warnings during the 
current interval, the timestamp value would be 0. Can't think of 
anything better now - you can polish this idea and open up a pull 
request if you want.


How many users do you have? The "cachedb_local" offers a fast and 
configurable hash implementation. Why wouldn't it be a good 
solution in order to store/fetch the above-mentioned timestamps 
for each of your users?


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com 
On 10.04.2018 13:11, Denis via Users wrote:

Hello, Liviu!
"So you want to check the time of the last fraud detection 
attempt for a user?"

Yes, but not for store this time to anywhere.
I want to detect the time of the first fraud call, and if this 
time, for example, between 19:00 and 09:00, make some actions.

Can i do it with Opensips?
Thank you.
--
С уважением, Денис.
Best regards, Denis
10.04.2018, 12:28, "Liviu Chircu"  
:


Hi Denis,

Yes, the "sequential calls" holds the size of the last batch of 
calls
sent to the same number. For example, if a user were to dial 44 
and 45

prefixes in a round-robin manner, his "sequential calls" value would
never exceed 1.

So you want to check the time of the last fraud detection 
attempt for a
user? You can use "cachedb_local", for example, and hold the 
last fraud
detection timestamp for each user. Also, note that check_fraud() 
[1] has
some useful return codes (-1 and -2), in case you don't want to 
use the

E_FRD_ events.

Cheers,

[1]:
http://www.opensips.org/html/docs/modules/2.4.x/fraud_detection.html#func_check_fraud

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



On 09.04.2018 09:12, Denis via Users wrote:

 Hello, Liviu!
 Thank you very much!
 I will try your fix.
 And, What does "Sequential calls" mean? These are calls to
one number?
 So, if we have situation dealing with reset counters, i
want to make
 one thing.
 I want to check the time when fraud has been detected and
if this
 time, say, after 19:00 make some actions. How can i check
time of the
 call processing?
 Thank you.



___
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


___
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




___
Users mailing list

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

2018-04-19 Thread Denis via Users
Hello, Liviu! I had installed latest Opensips 2.2 (Opensips 2.2.6) In a log file, during start of Opensips, i can seeERROR:core:set_mod_param_regex: parameter  not found in module  Where is mistake? Thank you. -- С уважением, Денис.Best regards, Denis 13.04.2018, 09:49, "Denis via Users" :Ok, thank you -- С уважением, Денис.Best regards, Denis 12.04.2018, 14:23, "Liviu Chircu" :Use $Ts [1] to get the current UNIX timestamp in seconds.[1]: http://www.opensips.org/Documentation/Script-CoreVar-2-4#toc91Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.comOn 12.04.2018 14:08, Denis via Users wrote:Liviu, is there any way to find out current time from Opensips during call processing (some functions, variables etc which i can use in opensips.cfg)? Thank you -- С уважением, Денис.Best regards, Denis 12.04.2018, 13:50, "Liviu Chircu" :Hi Denis,The fraud detection module has no such mechanism, currently. We could invent some variables such as $frd_last_warn, $frd_last_crit, $frd_first_warn, $frd_first_crit. They would output a UNIX timestamp. If there were no warnings during the current interval, the timestamp value would be 0. Can't think of anything better now - you can polish this idea and open up a pull request if you want.How many users do you have? The "cachedb_local" offers a fast and configurable hash implementation. Why wouldn't it be a good solution in order to store/fetch the above-mentioned timestamps for each of your users?Best regards,Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.comOn 10.04.2018 13:11, Denis via Users wrote:Hello, Liviu! "So you want to check the time of the last fraud detection attempt for a user?" Yes, but not for store this time to anywhere.I want to detect the time of the first fraud call, and if this time, for example, between 19:00 and 09:00, make some actions. Can i do it with Opensips? Thank you. -- С уважением, Денис.Best regards, Denis 10.04.2018, 12:28, "Liviu Chircu" :Hi Denis,Yes, the "sequential calls" holds the size of the last batch of callssent to the same number. For example, if a user were to dial 44 and 45prefixes in a round-robin manner, his "sequential calls" value wouldnever exceed 1.So you want to check the time of the last fraud detection attempt for auser? You can use "cachedb_local", for example, and hold the last frauddetection timestamp for each user. Also, note that check_fraud() [1] hassome useful return codes (-1 and -2), in case you don't want to use theE_FRD_ events.Cheers,[1]:http://www.opensips.org/html/docs/modules/2.4.x/fraud_detection.html#func_check_fraudLiviu ChircuOpenSIPS Developerhttp://www.opensips-solutions.comOn 09.04.2018 09:12, Denis via Users wrote: Hello, Liviu! Thank you very much! I will try your fix. And, What does "Sequential calls" mean? These are calls to one number? So, if we have situation dealing with reset counters, i want to make one thing. I want to check the time when fraud has been detected and if this time, say, after 19:00 make some actions. How can i check time of the call processing? Thank you.___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
,___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
,___Users mailing listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users,___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] xlog adding information to output

2018-04-19 Thread Ben Newlin
Bogdan,

We are using supervisord to start OpenSIPS and it is configured to redirect 
stdout/stderr to a log file. The vendor application is streaming that log file. 
Supervisord does not provide any log manipulation functionality. The only way I 
can see is that we would have to write another application to read the 
supervisord logs, parse them, and write them to yet another log file which the 
vendor application can read. This is a very undesirable solution as it only 
adds complexity and another failure point to the system. We were doing it this 
way specifically to avoid syslog and this extra data being printed.

I think it’s a useful functionality for any platform to provide logging 
features that log only what the user has requested without any additional 
output being unexpectedly added, or at least to make the logging of that extra 
data configurable. Not doing so is making the assumption that all users of the 
platform will want their logs to look the way the developers of the platform 
think they should. The formatted date/time string and process ID are already 
available from the script variables should users choose to add it to their logs.

Since we are compiling OpenSIPS, if there is no desire to address this 
officially then I will probably pursue a local patch that will remove the extra 
output rather than injecting another application into our log process.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu 
Date: Thursday, April 19, 2018 at 3:47 AM
To: Ben Newlin , OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

And there is no way to insert something between opensips and the collector in 
order to do some text processing. I mean, how does the vendor's collector 
attaches to the stderror ? You start opensips within other app ? or ?

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 04/18/2018 03:30 PM, Ben Newlin wrote:
Bogdan,

We collect the logs via stdout/stderr.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu 
Date: Wednesday, April 18, 2018 at 5:37 AM
To: Ben Newlin , 
OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

And how do you capture and deliver the logs to this vendor? still via syslog ? 
or via stderr?

Regards,



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  http://www.opensips-solutions.com

OpenSIPS Summit 2018

  
http://www.opensips.org/events/Summit-2018Amsterdam
On 04/13/2018 04:47 PM, Ben Newlin wrote:
Bogdan,

I can understand the desire for consistency.

Unfortunately in our case we are using an external log service vendor and the 
application that is collecting the logs is provided by them. It simply collects 
all logs and does not have any option to preprocess individual log entries. We 
don’t have the ability to pre-process the logs prior to ingestion. We can, I 
think, filter out the extra info while searching the logs, but it will make the 
searches more complex and slower.

It would be nice to be able to disable this so there is some option to only log 
what is provided without manipulation. It could be a flag that affects xlog, or 
a different log function that doesn’t use the prefix. If you think it is 
worthy, I’d be happy to open a feature request.

Thanks,
Ben Newlin

From: Bogdan-Andrei Iancu 
Date: Thursday, April 12, 2018 at 4:02 PM
To: OpenSIPS users mailling list 
, Ben Newlin 

Subject: Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

Yes, this change was done on purpose for logs consistency reasons. As when you 
log via syslog you will get *all* the time the process name, pid and data as 
suffix, we considered that printing to strerr should follow the same model and 
have *all* the time the same prefix for the messages.

Now, I guess you grep the logs by some sort of an application (before having 
them pushed as jsons for later processing) - maybe you can do some extra 
pre-processing the strip the prefix before parsing it as json.

Regards,




Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  http://www.opensips-solutions.com

OpenSIPS Summit 2018

  
http://www.opensips.org/events/Summit-2018Amsterdam
On 04/06/2018 10:58 

Re: [OpenSIPS-Users] add gateway a sip trunk

2018-04-19 Thread John Quick
Hello John,

You should take a look at the REGISTRANT module. This will allow your
OpenSIPS Proxy to register with the provider.
That should allow the provider to send calls to OpenSIPS.

For calls going in the other direction (OpenSIPS to provider) there could be
a problem. It depends if your provider will accept calls based solely on
their source IP address.
If your provider demands call-by-call authentication - username and password
- then OpenSIPS may not be the best choice.
FreeSwitch would be better able to deal with authentication challenges. It
could be used in conjunction with OpenSIPS, depending on overall
requirements.

OpenSIPS  -->  FreeSwitch  -->  Provider

OpenSIPS has a module for authentication - UAC_AUTH - but I have never been
able to make it work because it messes up the CSeq index sequence.

The Dynamic Routing module is great for distributing calls to various
providers based on number prefix, gateway availability, pre-defined rules
etc. However, it assumes the remote gateways will accept INVITE requests
without challenging for username/password authentication. Authentication is
normally based on IP address alone for this type of connection.

John Quick
Smartvox Limited
Web: www.smartvox.co.uk



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


Re: [OpenSIPS-Users] xlog adding information to output

2018-04-19 Thread Bogdan-Andrei Iancu

Hi Ben,

And there is no way to insert something between opensips and the 
collector in order todo some text processing. I mean, how does the 
vendor's collector attaches to the stderror ? You start opensips within 
other app ? or ?


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 04/18/2018 03:30 PM, Ben Newlin wrote:


Bogdan,

We collect the logs via stdout/stderr.

Thanks,

Ben Newlin

*From: *Bogdan-Andrei Iancu 
*Date: *Wednesday, April 18, 2018 at 5:37 AM
*To: *Ben Newlin , OpenSIPS users mailling 
list 

*Subject: *Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

And how do you capture and deliver the logs to this vendor? still via 
syslog ? or via stderr?


Regards,

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

On 04/13/2018 04:47 PM, Ben Newlin wrote:

Bogdan,

I can understand the desire for consistency.

Unfortunately in our case we are using an external log service
vendor and the application that is collecting the logs is provided
by them. It simply collects all logs and does not have any option
to preprocess individual log entries. We don’t have the ability to
pre-process the logs prior to ingestion. We can, I think, filter
out the extra info while searching the logs, but it will make the
searches more complex and slower.

It would be nice to be able to disable this so there is some
option to only log what is provided without manipulation. It could
be a flag that affects xlog, or a different log function that
doesn’t use the prefix. If you think it is worthy, I’d be happy to
open a feature request.

Thanks,

Ben Newlin

*From: *Bogdan-Andrei Iancu 

*Date: *Thursday, April 12, 2018 at 4:02 PM
*To: *OpenSIPS users mailling list 
, Ben Newlin
 
*Subject: *Re: [OpenSIPS-Users] xlog adding information to output

Hi Ben,

Yes, this change was done on purpose for logs consistency reasons.
As when you log via syslog you will get *all* the time the process
name, pid and data as suffix, we considered that printing to
strerr should follow the same model and have *all* the time the
same prefix for the messages.

Now, I guess you grep the logs by some sort of an application
(before having them pushed as jsons for later processing) - maybe
you can do some extra pre-processing the strip the prefix before
parsing it as json.

Regards,


Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com

OpenSIPS Summit 2018

http://www.opensips.org/events/Summit-2018Amsterdam

On 04/06/2018 10:58 PM, Ben Newlin wrote:

Hi,

Yet another question. ☺

We use the json module to structure our output to and then
print using xlog. Our log consumer processes the json format
and can process and index our logs.

It appears that in 2.x the xlog module now always prepends a
date string and the process number before every log. This is
causing the logs to not be valid json format and they are not
parsed properly by our consumer.

I know that OpenSIPS’ internal logs always print in this
format with the date and process number in front. Was this an
intentional change to make xlog print this way as well? Can it
be disabled in any way?

I’m pretty sure I remember someone else asking about this not
too long ago but I couldn’t find the thread in the archive.

Thanks,

Ben Newlin





___

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] event routing and rtpengine

2018-04-19 Thread Bogdan-Andrei Iancu

Tito,

Arming the branch route once, in the request route, before the initial 
t_relay() should be fine. Now, if you use any xlog() to check , is the 
branch route triggered for the injected branch ?


Regards,

Bogdan-Andrei Iancu

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

On 04/18/2018 08:35 PM, Tito Cumpen wrote:

Bogdan,

The branch route is defined in my my relay route. 
https://pastebin.com/MFcLxcDv Should it be defined in the event route 
I figured since the original transaction used the relay route it would 
use the route defined there ?


Thanks,
Tito





On Wed, Apr 18, 2018 at 9:32 AM, Bogdan-Andrei Iancu 
> wrote:


Hi Tito,

I see no branch route in your script sample.

Regards,

Bogdan-Andrei Iancu

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


On 04/16/2018 09:37 PM, Tito Cumpen wrote:

Group,

I am having issues when injecting a new branch with rtpengine
flags to a call request using the event routing module. It seems
like when the branch is injected it either does not use any of
the flags to aid with rtpengine media translation or does not run
through the branch route block defined in my relay route at all.

https://pastebin.com/u1EYzDe0

above is the route that prepares injection and transport
priorities along with the route that gets called upon a new
registration.

Thanks,
Tito


___
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