Re: [OpenSIPS-Users] $rl_count in 2.2.2

2017-01-13 Thread Răzvan Crainea

Hi, Pat!

The way you are using $rl_count is wrong, because the $rl_count pseudo 
variable only accepts strings or other pvars, not formatted strings 
(such as "cps_$avp(trunk_group)").
To achieve what you are trying to do is to assign the name to a pvar and 
feed it in the $rl_count's name:


$var(rl_name) = "cps_" + $avp(trunk_group);
$json(call_details/tg_cps) = $rl_count($var(rl_name));

Let me know how this goes.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/13/2017 12:48 AM, Pat Burke wrote:

Hello,

I am trying to get the current rate limit value using $rl_count, but 
it is giving the following error.

   ERROR:ratelimit:pv_get_rl_count: invalid name
   WARNING:core:do_assign: no value in right expression at 
/etc/opensips/opensips_proxy.cfg:598

   4024438929 SCRIPT:CCLIMIT:INFO: rl_limit for cps_90761 = 0

Here is the code

$json(call_details/tg_cps) = 0; # Default to 0

...

if ($avp(maxcps) != NULL && $avp(maxcps) > 0) {
if (!rl_check("cps_$avp(trunk_group)", "$avp(maxcps)")) {
xlog("L_NOTICE", "$rU SCRIPT:CPSLIMIT:DBG: Max 
$avp(maxcps) cps reached for trunk group $avp(trunk_group) \n");
$avp(error_reason) = $avp(error_reason) + 
$avp(trunk_group) + " CPS limit reached.";

send_reply("403", "Max CPS limit reached");
exit;
}
}
$json(call_details/tg_cps) = $rl_count("cps_$avp(trunk_group)");
xlog("L_INFO", "$rU SCRIPT:CCLIMIT:INFO: rl_limit for 
cps_$avp(trunk_group) = $json(call_details/tg_cps) \n");



From the command  opensipsctl fifo rl_list | grep cps_90761, I get
   PIPE::  id=cps_90761 algorithm=TAILDROP limit=2 counter=0

What am I missing?

Regards,
*Pat Burke*



___
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 crashed

2017-01-13 Thread Răzvan Crainea

Hi, Ahmed!

OpenSIPS 1.6.3 is no longer supported (since 2013), so there's not much 
we can do right now. Try upgrading your install to the latest 1.6.4 
version and see if your problem is solved. Otherwise, upgrade to a 
newer, supported version, preferably the latest stable release, 2.2.2.


Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/12/2017 11:55 PM, Ahmed Munir wrote:
Found coredump on one of the server, see some partial message below 
while taking the back trace;




Core was generated by `/usr/sbin/opensips -P /var/run/opensips.pid -m 
64 -u opensips -g opensips'.


Program terminated with signal 11, Segmentation fault.

#0  0x7f650687a069 in sip_msg_cloner () from 
/usr/lib64/opensips/modules/tm.so


Missing separate debuginfos, use: debuginfo-install 
opensips-1.6.3-notls.x86_64




Please advise what might be the reason causing opensips to crash.

On Thu, Jan 12, 2017 at 1:28 PM, Ahmed Munir > wrote:



The version currently running is 1.6.3.  Today again we got the
opensips crashed issues i.e. 5 out of 8 were crashed due to below
message (common on all 5);

Jan 12 10:07:36 QORCLPSIPROXY02 kernel: opensips[2820]: segfault
at 0 ip 004a2936 sp 7fff5cfaa430 error 6 in
opensips[40+13a000]

Jan 12 10:07:36 QORCLPSIPROXY02 abrt[39302]: Can't open
'core.2820': Permission denied

Jan 12 10:07:36 QORCLPSIPROXY02 abrt[39302]: Saved core dump of
pid 2820 (/usr/sbin/opensips) to
/var/spool/abrt/ccpp-2017-01-12-10:07:36-2820 (70246400 bytes)

Jan 12 10:07:36 QORCLPSIPROXY02 abrtd: Directory
'ccpp-2017-01-12-10:07:36-2820' creation detected

Jan 12 10:07:38 QORCLPSIPROXY02 kernel: Bridge firewalling registered

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: Sending an email...

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: /usr/sbin/sendmail: No such
file or directory

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: . . . message not sent.

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: Error running '/bin/mailx'

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: 'post-create' on
'/var/spool/abrt/ccpp-2017-01-12-10:07:36-2820' exited with 1

Jan 12 10:08:46 QORCLPSIPROXY02 abrtd: Deleting problem directory
'/var/spool/abrt/ccpp-2017-01-12-10:07:36-2820'



We would like to know why we are getting this segmentation fault?
Is there a way to backtrace the issue as don't have the core dump?
Further added, did someone faced this similar issue(s) in past and
got this fixed without upgrade?

Note: we are running opensips for quite a while didn't faced this
kind of issue and there is no changes made on opensips routing script.


From: Răzvan Crainea mailto:raz...@opensips.org>>
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] OpenSIPs crashed
Message-ID:
<2b35e2dc-6e11-1787-b87e-33bd29a32...@opensips.org
>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi, Ahmed!

Make sure OpenSIPS is run as root and it is allowed to
write in the
/var/spool/abrt/ directory, otherwise it is unable to
write the core
dump, therefore we can't inspect it to say what is
happening. If this
does not work, make OpenSIPS write the core dump in a
writeble directory
by changing the /proc/sys/kernel/core_pattern settings.
Also, please let us know the version of OpenSIPS you are
running.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com



On 01/11/2017 11:10 PM, Ahmed Munir wrote:
> Hi,
>
> Our OpenSIPs service crashed with below error;
>
> Jan 11 12:16:19 QORBLPSIPROXY05 abrtd: Directory
> 'ccpp-2017-01-11-12 :16:19-2807'
creation detected
> Jan 11 12:16:19 QORBLPSIPROXY05 abrt[65402]: Saved core
dump of pid
> 2807 (/usr/sbin/opensips) to
> /var/spool/abrt/ccpp-2017-01-11-12:16:19-2807 (70225920
bytes)
> Jan 11 12:16:19 QORBLPSIPROXY05 abrt[65402]: Can't open
'core.2807':
> Permission denied
> Jan 11 12:16:19 QORBLPSIPROXY05 kernel: opensips[2807]:
segfault at 29
> ip 004bae7a sp 7fffdb7734d0 error 4 in
opensips[40+13a000]
>
>
> We would like to know, what might be the reason for the
crash.
>
> Further added, there is another server we are running
OpenSIPs, the
> opensips child proc

Re: [OpenSIPS-Users] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread Răzvan Crainea
Then simply reverse the IP check logic and do it after the user is 
authenticated.


Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/11/2017 01:15 PM, maatohewetbi wrote:

Yes, but I want to check sip login first, not an IP. Here is ny plan, what I
want to do:

- store IP, login in one table (a new  on or existing one) - there will be
IP and SIP logins.

When a client make a registration, my script should check if this login is
in table, if yes - then check IP, if it matches - allow a registration, if
not - send 403 and exit. There will be another case, when a SIP login is not
in this table - just allow registration without checking an IP.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605516.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.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] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread maatohewetbi
Yes, but every IP and login should be in table. How can I read variables from
DB? Is it possible to do it?



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605547.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] force one AOR

2017-01-13 Thread Răzvan Crainea

Hi, Soren!

What version of OpenSIPS are you running?
Also, can you send over the debug logs for this scenario?

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/12/2017 01:13 PM, Søren Andersen wrote:


Hello,

I’ve some trouble with forceing 1 AOR per contact.

I’m using the config:

if (!save("location", "fc1")) {

sl_reply_error();

}

But then I reboot my SIP client opensips allows 2 AOR for the 
phonenumber? – But if I reboot the sip client again it’ll delete all 
the AORs and insert the new one?


opensipsctl fifo ul_show_contact location 88XX

AOR:: 88175263

Contact:: sip: 88XX@10.112.130.202 Q=

Expires:: 897

Callid:: 25180a4e14bcef242fc01d1d1f5da9af@10.112.130.202

Cseq:: 103

User-agent:: ICOTERA IGW3000 (2.5.1)

State:: CS_SYNC

Flags:: 0

Cflags::

Socket:: udp:85.XXX.XXX.120:5060

Methods:: 4294967295

Contact:: sip: 88XX@10.112.130.202 Q=

Expires:: 9

Callid:: 447b19de71f7ae6e305211c97f4574a9@10.112.130.202

Cseq:: 107

User-agent:: ICOTERA IGW3000 (2.5.1)

State:: CS_SYNC

Flags:: 0

Cflags::

Socket:: udp:85.XXX.XXX.120:5060

Methods:: 4294967295

/Søren



___
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] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread Răzvan Crainea
Yes, it is. Provision the address table in the database and use the 
check_source_address() functionin the script.


[1] http://www.opensips.org/html/docs/modules/2.2.x/permissions#id295007

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/13/2017 11:03 AM, maatohewetbi wrote:

Yes, but every IP and login should be in table. How can I read variables from
DB? Is it possible to do it?



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605547.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.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] change T_fr_in_timeout

2017-01-13 Thread Răzvan Crainea

Hello!
The problem is that you are doing your logic in the onreply_route, which 
is not transaction aware. You should move the logic in a name onreply 
route that you engage in your main route. Something like:


route {
...
if (is_method("INVITE"))
t_on_reply(handle_timer);
...
}

onreply_route[handle_timer] {
if (t_check_status("(180)|(183)"))
 $T_fr_inv_timeout = 60;
}

Hope this is a right pointer to solve your problem.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/12/2017 04:40 PM, bluerain via Users wrote:

Ok, so hopefully I get some help in this forum, I'm trying to get a faster
PDD by going down the LCR list faster.  I'm trying to use the fr_inv_timeout
to skip the carrier that has slow PDD.  So I did the code below so that if I
don't get a 180/183 after invite within 5 second, I will terminate the call
and go to the next carrier.  But if they do give 180/183 after invite within
5 second, I want to change T_fr_inv to 60 seconds so have enough time for
far end user to pick up the call.  But I ran into 2 problem:

1. 180/183 seems is NOT picking up inthe onreply_route.  I did a log and it
seems on 180/183 it never went into the code where I wanted to, so is this
is WRONG place to detect 180/183?

2. I also try to display the value of $T_fr_inv_timeout in onreply_route
section of the code, but it always show "ZERO"?

Anyway, any  pointer will be greatly appreciated.  Thank you!

loadmodule "tm.so"
modparam("tm", "fr_timeout", 5)
modparam("tm", "fr_inv_timeout", 5)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)

onreply_route {
 if (t_check_status("(180)|(183)")) {
 $T_fr_inv_timeout = 60;
 }
}



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/change-T-fr-in-timeout-tp7605536.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.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] How to parse XML Body?

2017-01-13 Thread xaled
Hi Bogdan,

 

thank you for looking at this issue. This regex does not work. I tried 
different combinations of the idea but it just not getting there. 

 

2017-01-13T11:02:42.287766+01:00 ivr01 /usr/local/sbin/opensips[24845]: 
DBG:core:tr_eval_re: we must compile the regexp

2017-01-13T11:02:42.288116+01:00 ivr01 /usr/local/sbin/opensips[24845]: 
WARNING:core:parse_repl: \/ unknown escape in (.*)<\/gml:Coordinates(.*)/\2/s

2017-01-13T11:02:42.288464+01:00 ivr01 /usr/local/sbin/opensips[24845]: 
ERROR:core:subst_parser: unknown flag . in 
(.*)/gml:Coordinates>(.*)<\/gml:Coordin

ates(.*)/\2/s

2017-01-13T11:02:42.288787+01:00 ivr01 /usr/local/sbin/opensips[24845]: 
ERROR:core:tr_eval_re: Can't compile regexp

 

I managed to get it running with perl:

 

use OpenSIPS qw ( log );

use OpenSIPS::Constants;

use OpenSIPS::Message;

 

 

sub parsePIDFLO {

my $m = shift;

my $body = $m->getBody();

($coord) = $body =~ /Coordinates>(.*)mailto:bog...@opensips.org] 
Sent: Mittwoch, 11. Januar 2017 11:05
To: OpenSIPS users mailling list ; asd asd 

Subject: Re: [OpenSIPS-Users] How to parse XML Body?

 

Hi,

Please try

$var(reg) = "(.*)/gml:Coordinates>(.*)<\/gml:Coordinates(.*)/\2/s";
xlog("Position is $(rb[1]{re.subst,$var(reg)})\n");

Regards,



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

On 01/06/2017 05:44 PM, xaled wrote:

Hi Bogdan,

 

can you give any hints on how to get the Coordinates values and not the whole 
xml body from the regex subst?

Sorry for being not clever enough to figure it out myself.

 

Thanks 

 

 

Hi Bogdan, 

 

$var(reg) = "/gml:Coordinates>(.*)<\/gml:Coordinates/\1/";

xlog("Position is $(rb[1]{re.subst,$var(reg)})\n");

 

DBG:core:subst_run:matched shows the needed XML element with value, but not the 
value alone. The xlog output shows the whole XML body without gml:Coordinates. 

 

2017-01-05T13:23:23.104982+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:tr_eval_re: Trying to apply reg

exp [/gml:Coordinates>(.*)<\/gml:Coordinates/\1/] on : [#015#012mailto:pres:sip:+1234...@test.com> 
"pres:sip:+1234...@test.com">#015#012 #015#012  #015#012   #015#012#015#012 
#015#012  #015#012   12.32 
34.24#015#012  #015#012 #015#012#015#012
#015#012 no#015#012 
#015#012#01

5#012   #015#012  #015#012  
2016-8-02T04:13:23Z#015#012 #015#0

12#015#012#015#012]

2017-01-05T13:23:23.107376+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:tr_eval_re: we must compile the

regexp

2017-01-05T13:23:23.107903+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:subst_parser: ok, se is 0x7f39a

5d0a1f0

2017-01-05T13:23:23.108241+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:subst_run: running. r=0

2017-01-05T13:23:23.111918+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:subst_run: matched (404, 45): [

gml:Coordinates>12.32 34.24#015#012mailto:pres:sip:+1234...@test.com> "pres:sip:+1234...@test.com">#015#0

12 #015#012  #015#012   #015#012
#015#012 #015#012  #015#012   
<12.32 34.24>#015#012  #015#012 #015#012#015#012
#015#012 no#015#012 #015#012#015#

012   #015#012  #015#012  
2016-8-02T04:13:23Z#015#012 #015#012



 

Thanks

 

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] 
Sent: Donnerstag, 5. Januar 2017 13:12
To: OpenSIPS users mailling list mailto:users@lists.opensips.org> >; xaled mailto:xa...@web.de> >
Subject: Re: [OpenSIPS-Users] How to parse XML Body?

 

Try  $var(reg) = "/gml:Coordinates>(.*)<\/gml:Coordinates/\1/";




 






___
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] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread maatohewetbi
I think You don't understand. My Opensips should work in this scenario:

1. When user wants to register, I have to check whether his sip login is in
address table (which can be stored in context_info for example). If it is
there then check IP, which is in this record, for this sip login. If this IP
is the same as real IP of this user (from $si value), the user can be
registered. If this IP is not the same - user can't be registered.
2. When user wants to register, but his sip login doesn't exist in address
table - this user can be registered without IP checking.

So I have to check IP, only for users, whom login is in address table.
Others, can registered without checking. If I use one of function in
permission module I always have to check IP. I have to check login first,
then IP. I hope that now everything is clear.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605552.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread Stefano Pisani

Use 0.0.0.0/0 for those without IP filter.

s

Il 13/01/2017 12:09, maatohewetbi ha scritto:

I think You don't understand. My Opensips should work in this scenario:

1. When user wants to register, I have to check whether his sip login is in
address table (which can be stored in context_info for example). If it is
there then check IP, which is in this record, for this sip login. If this IP
is the same as real IP of this user (from $si value), the user can be
registered. If this IP is not the same - user can't be registered.
2. When user wants to register, but his sip login doesn't exist in address
table - this user can be registered without IP checking.

So I have to check IP, only for users, whom login is in address table.
Others, can registered without checking. If I use one of function in
permission module I always have to check IP. I have to check login first,
then IP. I hope that now everything is clear.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605552.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.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] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread maatohewetbi
Still I have to check login whether it exist in table. Then I have to compare
it to IP address.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605554.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread Răzvan Crainea

You can do something like this:

avp_db_query("select ip from address where context_info='$fU'", "$avp(ip)");
if ($rc == -2) {
# not found in db
} else if ($avp(ip) != $si) {
# reject the call
}

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 01/13/2017 01:51 PM, maatohewetbi wrote:

Still I have to check login whether it exist in table. Then I have to compare
it to IP address.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605554.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.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] Registrar with IP authentication - selecting variables from DB

2017-01-13 Thread maatohewetbi
Razvan, that's what I was looking for. I haven't tested it yet but it looks
like You made my day! Thanks



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514p7605556.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] $rl_count in 2.2.2

2017-01-13 Thread Pat Burke
Hi Răzvan,


Thanks.  That worked correctly.  I figured it was simple.


Thanks again,
Pat


Hi, Pat! The way you are using $rl_count is wrong, because the $rl_count pseudo 
variable only accepts strings or other pvars, not formatted strings (such as 
"cps_$avp(trunk_group)"). To achieve what you are trying to do is to assign the 
name to a pvar and feed it in the $rl_count's name: $var(rl_name) = "cps_" + 
$avp(trunk_group); $json(call_details/tg_cps) = $rl_count($var(rl_name)); Let 
me know how this goes. Best regards, Răzvan Crainea OpenSIPS Solutions 
www.opensips-solutions.com On 01/13/2017 12:48 AM, Pat Burke wrote: > Hello, >> 
I am trying to get the current rate limit value using $rl_count, but > it is 
giving the following error. >ERROR:ratelimit:pv_get_rl_count: invalid 
name >WARNING:core:do_assign: no value in right expression at > 
/etc/opensips/opensips_proxy.cfg:598 >4024438929 SCRIPT:CCLIMIT:INFO: 
rl_limit for cps_90761 = 0 >> Here is the code >>  
  $json(call_details/tg_cps) = 0; # Default to 0 >> ... >> if ($avp(maxcps) 
!= NULL && $avp(maxcps) > 0) { > if (!rl_check("cps_$avp(trunk_group)", 
"$avp(maxcps)")) { > xlog("L_NOTICE", "$rU SCRIPT:CPSLIMIT:DBG: Max 
> $avp(maxcps) cps reached for trunk group $avp(trunk_group) \n"); >
 $avp(error_reason) = $avp(error_reason) + > $avp(trunk_group) + " CPS limit 
reached."; > send_reply("403", "Max CPS limit reached"); >  
   exit; > } > } > $json(call_details/tg_cps) = 
$rl_count("cps_$avp(trunk_group)"); > xlog("L_INFO", "$rU 
SCRIPT:CCLIMIT:INFO: rl_limit for > cps_$avp(trunk_group) = 
$json(call_details/tg_cps) \n"); >>> From the command  opensipsctl fifo rl_list 
| grep cps_90761, I get >PIPE::  id=cps_90761 algorithm=TAILDROP 
limit=2 counter=0 >> What am I missing? >> Regards, > *Pat Burke* 
___ > Users mailing list > Users at 
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 crashed

2017-01-13 Thread Ahmed Munir
Hi,

I've just installed new version of opensips 2.2.2 on the test box and
updated by routing script, the issue currently I'm seeing alot warning
messages while starting opensips service below;

/usr/sbin/opensips[6902]: WARNING:core:handle_timer_job: utimer job
 has a 283 us delay in execution

Number of children running on that server is 8 as it is 8 core processor.

I would like to know what steps do I need to take to fix this issue. Btw,
warnings only occurred during the time of starting opensips service but not
during calls.


Further added, a issue I face using avp_db_query () function i.e. when
using it as

$var(res) = avp_db_query("SELECT Outpulse_number,setid FROM Prefix_data
where Program_prefix = $var(pg_prefix)", "$avp(outpluse), $avp(trunkid)");

failed to start opensips service due to errors below;

ERROR:avpops:__fixup_db_query_avp: no db url defined to be used by this
function
ERROR:core:fix_actions: fixing failed (code=-6) at
//etc/opensips/opensips.cfg:207
CRITICAL:core:fix_expr: fix_actions error
ERROR:core:main: failed to fix configuration with err code -6


If I add this line: avp_db_query("SELECT 1"); above to my $var(res) db
query, opensips service starts successfully.

Please advise the steps do I need to take to fix above issues.



> From: Răzvan Crainea 
> To: users@lists.opensips.org
> Subject: Re: [OpenSIPS-Users] OpenSIPs crashed
> Message-ID: <40f6dada-e121-a2da-b283-69dff891c...@opensips.org>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Hi, Ahmed!
>
> OpenSIPS 1.6.3 is no longer supported (since 2013), so there's not much
> we can do right now. Try upgrading your install to the latest 1.6.4
> version and see if your problem is solved. Otherwise, upgrade to a
> newer, supported version, preferably the latest stable release, 2.2.2.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutions
> www.opensips-solutions.com
>
> On 01/12/2017 11:55 PM, Ahmed Munir wrote:
> > Found coredump on one of the server, see some partial message below
> > while taking the back trace;
> >
> >
> >
> > Core was generated by `/usr/sbin/opensips -P /var/run/opensips.pid -m
> > 64 -u opensips -g opensips'.
> >
> > Program terminated with signal 11, Segmentation fault.
> >
> > #0  0x7f650687a069 in sip_msg_cloner () from
> > /usr/lib64/opensips/modules/tm.so
> >
> > Missing separate debuginfos, use: debuginfo-install
> > opensips-1.6.3-notls.x86_64
> >
> >
> >
> > Please advise what might be the reason causing opensips to crash.
> >
> >  --
> > Regards,
> >
> > Ahmed Munir Chohan
> >
> >
> >
> >
> > --
> > Regards,
> >
> > Ahmed Munir Chohan
> >
>



-- 
Regards,

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