[OpenSIPS-Users] OpenSIPs crashed

2017-01-11 Thread Ahmed Munir
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 processes utilizing 100% of CPU and the system load average
reach around 'load average: 20.01, 18.03, 24.00' as normally it is below 1
(load  average).

After looking into logs, unable to find the info what might causing the CPU
to spike.

Please advise what useful steps to take for narrowing down this issue.


-- 
Regards,

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


Re: [OpenSIPS-Users] Load Balancer - Checking Node Health

2017-01-11 Thread Chandan PR
Thanks a lot Razvan. Will try them and keep the group posted about the
results.

On Wed, Jan 11, 2017 at 2:01 PM, Răzvan Crainea  wrote:

> Hi, Chandan!
>
> Is there any way you could monitor the endpoints? If so, you can use the
> load balancer pinging, that will automatically disable the end point when
> it is not responding, and monitor the state over MI.
>
> If there is no way you monitor the endoints, you could:
> 1. Check the tm transactions ended with 4xx status. If you see a spike,
> send an alert. The comand to do that is:
> opensipsctl fifo get_statistics 4xx_transactions
>
> 2. Create your own statistics in the script based on the endpoint. In the
> script, do something like this:
> if (t_check_status("486"))
> update_stat("$stat(tran_486_$si)", "+1");
>
> Again, monitor these statistics over MI and if you see spikes, send alerts.
>
> These are the solutions I am thinking of. Hope they are helpful.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 01/11/2017 08:51 AM, Chandan PR wrote:
>
> Hi,
>
> Recently one of our endpoints stopped responding and due to which nearly
> almost all of the calls ended up in 486.
>
> Is there any functions we can use to monitor the response codes per node
> over a duration so that we can raise an alert to take corrective actions in
> such cases.
>
> *The version of OpenSips we are using is 1.9.x*
>
> Regards,
> Chandan
>
>
> ___
> 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 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-11 Thread maatohewetbi
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


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

2017-01-11 Thread Răzvan Crainea
Yes, you can use the check_source() address function[1] just before the 
auth block.


[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/11/2017 12:44 PM, maatohewetbi wrote:

Is there any way to make an IP authorization with registrar module? First I
want to authenticate peer with IP, and then allow him to register with
correct login/pass. Or is there any way to select any variable from DB?



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Registrar-with-IP-authentication-selecting-variables-from-DB-tp7605514.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-11 Thread Bogdan-Andrei Iancu

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 : [version="1.0" encoding="UTF-8"?>#015#012

ns="urn:ietf:params:xml:ns:pidf" 
xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10" 
xmlns:gml="urn:opengis:specificat


ion:gml:schema-xsd:feature:v3.0" 
entity="pres:sip:+1234...@test.com">#015#012 #015#012  

tatus>#015#012 #015#012 #015#012 
#015#012  

id="point1" srsName="epsg:4346">#015#012 12.32 
34.24#015#012  

oint>#015#012 #015#012 #015#012 
#015#012 

smission-allowed>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.242017-01-05T13:23:23.112380+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
DBG:core:buf_init: initializing...


2017-01-05T13:23:23.112730+01:00 ivr01 /usr/local/sbin/opensips[2227]: 
Position is 

="UTF-8"?>#015#012xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10" xm


lns:gml="urn:opengis:specification:gml:schema-xsd:feature:v3.0" 
entity="pres:sip:+1234...@test.com">#015#0


12 #015#012  #015#012 #015#012 
#015#012 

n>#015#012 srsName="epsg:4346">#015#012   <12.32 34.24>#015#012  

nt>#015#012 #015#012   #015#012 
#015#012 

ission-allowed>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 >; xaled >

*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] How to store variables into file

2017-01-11 Thread maatohewetbi
Ok, I managed to get variables in log. I used *xlog* instead of *log*. It
looks like variables can't be written by log function.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/How-to-store-variables-into-file-tp7605497p7605504.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