Re: [OpenSIPS-Users] Opensips 1.6 as a Proxy and Presence Server

2017-01-19 Thread maatohewetbi
I think I found the reason BLF doesn't work. I made a test. I've erased
presenity table. Then:
1. I called other user, led is blinking, and presentity table shows record
with xml bodies with early state.
2. Then I pickup a call, the same record changes with confirmed state.
3. Then I end this call, the same record changes to terminated state.

So first call was ok. But after it I made second call, but it turned out
that presentity table wasn't erased, and previous records exist. So when I
make this second call, xml body contains previous xml, and this right one! I
think presentity table should be erased after a call. Do You know the
reason?




--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Opensips-1-6-as-a-Proxy-and-Presence-Server-tp7605411p7605672.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


[OpenSIPS-Users] Async DB statement

2017-01-19 Thread Ahmed Munir
Hi,

Currently I'm trying to use async fucntion for avp_db_query. The issue I'm
facing while using it as not retrieving or returning correct return code
and not execute later part of the routing script. See old & new DB queries;

Without Async:
--
route[1]{
...

 if($var(Outpluseflag) == 0) {
  avp_db_query("SELECT Outpulse_number,setid FROM Prefix_data
where Program_prefix = '$var(pg_prefix)'", "$avp(outpluse), $avp(trunkid)");
$var(res) = $retcode; # or you can just use $retcode!
xlog("- OB Route 1-1 DB fetched value outpluse ->
$avp(outpluse) | trunkid -> $avp(trunkid) | Return Code: $rc | Var Res:
$var(res)---");
if ($var(res) > 0) {
   cache_store("local", "DID_$tU",
"$avp(outpluse)", 60);
   cache_store("local", "Trunk_$tU",
"$avp(trunkid)", 60);
}
#xlog("DB fetched value outpluse -> $avp(outpluse) |
trunkid -> $avp(trunkid) | Return Code -> $var(res)");
xlog("- OB Route 1-2 DB fetched value outpluse ->
$avp(outpluse) | trunkid -> $avp(trunkid) | Return Code: $rc | Var Res:
$var(res)---");
}
}

With Async:
---
route[1]{

...

if($var(Outpluseflag) == 0) {
 async(avp_db_query("SELECT Outpulse_number,setid FROM Prefix_data
where Program_prefix = '$var(pg_prefix)'", "$avp(outpluse),
$avp(trunkid)"),ob_route_1);
}
}

route[ob_route_1]{
xlog("- OB Route 1-1 DB fetched value outpluse ->
$avp(outpluse) | trunkid -> $avp(trunkid) | Return Code: $rc---");

if ($rc > 0) {
   cache_store("local", "DID_$tU", "$avp(outpluse)", 60);
   cache_store("local", "Trunk_$tU", "$avp(trunkid)", 60);
}
   xlog("- OB Route 1-2 DB fetched value outpluse ->
$avp(outpluse) | trunkid -> $avp(trunkid) | Return Code: $rc---");

}


The records in xlog I'm getting without using async;

Jan 19 18:05:39 qorblpsisprxyd1 /usr/sbin/opensips[14040]: - OB
Route 1-1 DB fetched value outpluse -> 609902 | trunkid -> 117 | Return
Code: 1 | Var Res: 1---
Jan 19 18:05:39 qorblpsisprxyd1 /usr/sbin/opensips[14040]: - OB
Route 1-2 DB fetched value outpluse -> 609902 | trunkid -> 117 | Return
Code: 1 | Var Res: 1---

Whereas, records in xlog I'm getting using async;

Jan 19 18:10:07 qorblpsisprxyd1 /usr/sbin/opensips[14109]: - OB
Route 1-1 DB fetched value outpluse -> 609902 | trunkid -> 117 | Return
Code: 1---
Jan 19 18:10:07 qorblpsisprxyd1 /usr/sbin/opensips[14109]: - OB
Route 1-2 DB fetched value outpluse -> 609902 | trunkid -> 117 | Return
Code: 0---

Is there is way to properly retain the $retcode/$rc in version 2.2.2? Seems
like using async return code(s) are not properly set or the avp variables
are not setting up correct using async statement.

Please advise, if the above async db statement is correct as shared in
sample above.


-- 
Regards,

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


[OpenSIPS-Users] Call per second limit

2017-01-19 Thread Dragomir Haralambiev
Hello,

How to made Call Per Second limitation using Opensips 2.2.2 ?

Regards,
Dragomir
___
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-19 Thread xaled
Hi Bogdan,

 

I know, that script level is better and I use the script regex now it is 
working. Perl was used out of frustration of not being able to get the right 
regex with script. I’m neither good at perl, but the first regex example I 
found on the web worked right away with minor changes.

 

Honestly I do not quite understand why the workable script regex should be the 
way it is. Especially compared with the regex I used in perl. But I’m not a 
regex expert either. Anyway I’m happy as long as it does what I need.

 

The patch looks good. I will try it and let you know how it will work out.

 

Thanks a lot for your support!  

 

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] 
Sent: Donnerstag, 19. Januar 2017 11:54
To: xaled ; 'OpenSIPS users mailling list' 

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

 

Hi,

To be honest I'm not good on perl, but if you can do it directly at script 
level, it it cleaner and more efficient.

Also, check this 
https://github.com/OpenSIPS/opensips/commit/d509aa63698bc26fde390a4b707dbf2be31f5de5

Thanks and Regards,



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

On 01/18/2017 04:09 PM, xaled wrote:

Hi Bogdan,

 

works like a charm, thanks!

As an additional bonus now I know how to work with the perl module ;)

 

$rb(mime)[idx] is even more flexible.

 

 

 

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] 
Sent: Dienstag, 17. Januar 2017 15:12
To: xaled   ; 'OpenSIPS users mailling list' 
  
Subject: Re: [OpenSIPS-Users] How to parse XML Body?

 

Hi,

There was a small typo in my regexp. The correct one is:

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

I tried it and it does the job. 

Regarding the usability of the $rb variable, yes you have a point. I was 
thinking of something like $rb(mime)[idx] to access also per mime.

Best regards,





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

On 01/13/2017 12:04 PM, xaled wrote:

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


Re: [OpenSIPS-Users] Users Digest, Vol 102, Issue 62

2017-01-19 Thread Ahmed Munir
These warnings appears during opensips startup service.


Date: Thu, 19 Jan 2017 14:55:01 +
> From: "Ramachandran, Agalya (Contractor)"
> 
> To: OpenSIPS users mailling list 
> Subject: Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start
> service
> Message-ID:
> <21840442533f445397309d17eec6b...@copdcex28.cable.comcast.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Razvan,
>
> I didn’t see any process that is using more than 80% of a core. OpenSIPS
> is simply being idle and these warnings come periodically.
>
> Like once in couple of hours. I didn’t track the exact time line, how
> frequent am getting this warnings.
>
> Ahmed,
> Do you notice these warnings only when you start OpenSIPS or could see it
> in regular intervals?
>
> Regards,
> Agalya
>
> From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan
> Crainea
> Sent: Thursday, January 19, 2017 3:33 AM
> To: users@lists.opensips.org
> Subject: Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service
>
> When starting opensips, is there any opensips process that is using more
> than 80% of a core? If so, can you pinpoint the PID in the opensipsctl ps
> command?
>
> Best regards,
>
>
> Răzvan Crainea
>
> OpenSIPS Solutions
>
> www.opensips-solutions.com
> On 01/18/2017 11:55 PM, Ramachandran, Agalya (Contractor) wrote:
> Same with my case too.
>
> Regards,
> Agalya
>
> From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Ahmed
> Munir
> Sent: Wednesday, January 18, 2017 1:31 PM
> To: OpenSIPs Users  org>
> Subject: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service
>
> Hi,
> I'm currently seeing the warnings when I start opensips service;
>
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> WARNING:core:handle_timer_job: timer job  has a 150 us
> delay in execution
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> WARNING:core:handle_timer_job: timer job  has a 150 us delay
> in execution
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> WARNING:core:handle_timer_job: timer job  has a 150 us delay
> in execution
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> WARNING:core:handle_timer_job: utimer job  has a 229 us
> delay in execution
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> INFO:core:do_action: max while loops are encountered
> Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3088]:
> WARNING:core:utimer_ticker: utimer task  already scheduled for
> 190 ms (now 2470 ms), it may over
> lap..
>
>
> I've tried to update the source code for timer.c (line#: 190) ref:
> https://github.com/OpenSIPS/opensips/commit/fd8f6ec442b4365da9d274af693995
> 4246ece865?diff=split, but didn't work at all.
> Currently running 8 child processors, see below;
>
> [root@qorblpsisprxyd1 ]# opensips  -V
> version: opensips 2.2.2 (x86_64/linux)
> flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
> F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> main.c compiled on 12:39:45 Jan 18 2017 with gcc 4.4.7
>
>
> [root@qorblpsisprxyd1 ]# opensipsctl fifo ps
> Process::  ID=0 PID=3083 Type=attendant
> Process::  ID=1 PID=3085 Type=MI FIFO
> Process::  ID=2 PID=3086 Type=time_keeper
> Process::  ID=3 PID=3088 Type=timer
> Process::  ID=4 PID=3089 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=5 PID=3091 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=6 PID=3092 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=7 PID=3094 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=8 PID=3096 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=9 PID=3098 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=10 PID=3100 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=11 PID=3102 Type=SIP receiver udp:10.3.120.94:5060 10.3.120.94:5060>
> Process::  ID=12 PID=3104 Type=Timer handler
> I would like to know what changes required to fix this change? Please
> advise.
>
> --
> Regards,
>
> Ahmed Munir Chohan
>
>


-- 
Regards,

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


Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

2017-01-19 Thread Ahmed Munir
ge-ID: <2d785128-affa-c955-e779-1d4305ec1...@opensips.org>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> When starting opensips, is there any opensips process that is using more
> than 80% of a core? If so, can you pinpoint the PID in the opensipsctl
> ps command?
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutions
> www.opensips-solutions.com
>
> On 01/18/2017 11:55 PM, Ramachandran, Agalya (Contractor) wrote:
> >
> > Same with my case too.
> >
> > Regards,
> > Agalya
> >
> > *From:*Users [mailto:users-boun...@lists.opensips.org] *On Behalf Of
> > *Ahmed Munir
> > *Sent:* Wednesday, January 18, 2017 1:31 PM
> > *To:* OpenSIPs Users <users@lists.opensips.org>
> > *Subject:* [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service
> >
> > Hi,
> >
> > I'm currently seeing the warnings when I start opensips service;
> >
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> > WARNING:core:handle_timer_job: timer job  has a 150
> > us delay in execution
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> > WARNING:core:handle_timer_job: timer job  has a 150 us
> > delay in execution
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> > WARNING:core:handle_timer_job: timer job  has a 150 us
> > delay in execution
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> > WARNING:core:handle_timer_job: utimer job  has a 229 us
> > delay in execution
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]:
> > INFO:core:do_action: max while loops are encountered
> > Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3088]:
> > WARNING:core:utimer_ticker: utimer task  already scheduled
> > for 190 ms (now 2470 ms), it may over
> > lap..
> >
> > I've tried to update the source code for timer.c (line#: 190) ref:
> > https://github.com/OpenSIPS/opensips/commit/
> fd8f6ec442b4365da9d274af6939954246ece865?diff=split,
> > but didn't work at all.
> >
> > Currently running 8 child processors, see below;
> >
> > [root@qorblpsisprxyd1 ]# opensips  -V
> > version: opensips 2.2.2 (x86_64/linux)
> > flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
> > F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
> > ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> > MAX_URI_SIZE 1024, BUF_SIZE 65535
> > poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> > main.c compiled on 12:39:45 Jan 18 2017 with gcc 4.4.7
> >
> >
> > [root@qorblpsisprxyd1 ]# opensipsctl fifo ps
> > Process::  ID=0 PID=3083 Type=attendant
> > Process::  ID=1 PID=3085 Type=MI FIFO
> > Process::  ID=2 PID=3086 Type=time_keeper
> > Process::  ID=3 PID=3088 Type=timer
> > Process::  ID=4 PID=3089 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=5 PID=3091 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=6 PID=3092 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=7 PID=3094 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=8 PID=3096 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=9 PID=3098 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=10 PID=3100 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=11 PID=3102 Type=SIP receiver udp:10.3.120.94:5060
> > <http://10.3.120.94:5060>
> > Process::  ID=12 PID=3104 Type=Timer handler
> >
> > I would like to know what changes required to fix this change? Please
> > advise.
> >
> >
> > --
> >
> > Regards,
> >
> > Ahmed Munir Chohan
> >
> >
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> -- next part --
> An HTML attachment was scrubbed...
> URL: <http://lists.opensips.org/pipermail/users/attachments/
> 20170119/81b8d547/attachment-0001.html>
>
>
>


-- 
Regards,

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


Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

2017-01-19 Thread Ramachandran, Agalya (Contractor)
Hi Razvan,

I didn’t see any process that is using more than 80% of a core. OpenSIPS is 
simply being idle and these warnings come periodically.

Like once in couple of hours. I didn’t track the exact time line, how frequent 
am getting this warnings.

Ahmed,
Do you notice these warnings only when you start OpenSIPS or could see it in 
regular intervals?

Regards,
Agalya

From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan 
Crainea
Sent: Thursday, January 19, 2017 3:33 AM
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

When starting opensips, is there any opensips process that is using more than 
80% of a core? If so, can you pinpoint the PID in the opensipsctl ps command?

Best regards,


Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com
On 01/18/2017 11:55 PM, Ramachandran, Agalya (Contractor) wrote:
Same with my case too.

Regards,
Agalya

From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Ahmed Munir
Sent: Wednesday, January 18, 2017 1:31 PM
To: OpenSIPs Users 
Subject: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

Hi,
I'm currently seeing the warnings when I start opensips service;

Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 us delay 
in execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 us delay in 
execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 us delay in 
execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: utimer job  has a 229 us delay in 
execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: INFO:core:do_action: 
max while loops are encountered
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3088]: 
WARNING:core:utimer_ticker: utimer task  already scheduled for 190 
ms (now 2470 ms), it may over
lap..


I've tried to update the source code for timer.c (line#: 190) ref: 
https://github.com/OpenSIPS/opensips/commit/fd8f6ec442b4365da9d274af6939954246ece865?diff=split,
 but didn't work at all.
Currently running 8 child processors, see below;

[root@qorblpsisprxyd1 ]# opensips  -V
version: opensips 2.2.2 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
main.c compiled on 12:39:45 Jan 18 2017 with gcc 4.4.7


[root@qorblpsisprxyd1 ]# opensipsctl fifo ps
Process::  ID=0 PID=3083 Type=attendant
Process::  ID=1 PID=3085 Type=MI FIFO
Process::  ID=2 PID=3086 Type=time_keeper
Process::  ID=3 PID=3088 Type=timer
Process::  ID=4 PID=3089 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=5 PID=3091 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=6 PID=3092 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=7 PID=3094 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=8 PID=3096 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=9 PID=3098 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=10 PID=3100 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=11 PID=3102 Type=SIP receiver 
udp:10.3.120.94:5060
Process::  ID=12 PID=3104 Type=Timer handler
I would like to know what changes required to fix this change? Please advise.

--
Regards,

Ahmed Munir Chohan




___

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] async- issues- 2.2.2

2017-01-19 Thread Ramachandran, Agalya (Contractor)
Got it. Thank you.

From: Users [mailto:users-boun...@lists.opensips.org] On Behalf Of Razvan 
Crainea
Sent: Thursday, January 19, 2017 3:30 AM
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] async- issues- 2.2.2

You have my answer inline.



Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com
On 01/18/2017 08:17 PM, Ramachandran, Agalya (Contractor) wrote:
Hi Razvan,

Got your point. I tried to increase the MAX_CONTENT_TYPE_LEN  and tested async 
call and it is working fine without crash.

But one more question.
The same piece of code am using for sync REST_API query too in rest_put() 
method. There also print_buff is only being used.
It is working absolutely fine in the case of sync  call even  if the 
MAX_CONTENT_TYPE_LEN – is 64.

Wondering what would be the reason in sync call, it is working and in async it 
is not?
Pure luck. You are doing a buffer overflow, overwriting the data section. 
Probably when doing sync calls, nobody is using the data you are overwriting. 
But if it doesn't crash it doesn't mean it is ok :).


Regards,
Agalya

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


Re: [OpenSIPS-Users] Opensips 1.6 as a Proxy and Presence Server

2017-01-19 Thread maatohewetbi
I think I found the reason BLF doesn't work. I made a test. I've erased
presenity table. Then:
1. I called other user, led is blinking, and presentity table shows record
with xml bodies with *early* state. 
2. Then I pickup a call, the same record changes with *confirmed* state. 
3. Then I end this call, the same record changes to *terminated* state.

So first call was ok. But after it I made second call, but it turned out
that presentity table wasn't erased, and previous records exist. So when I
make this second call, xml body contains previous xml, and this right one! I
think presentity table should be erased after a call. Do You know the
reason?





--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Opensips-1-6-as-a-Proxy-and-Presence-Server-tp7605411p7605664.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] Opensips 1.6 as a Proxy and Presence Server

2017-01-19 Thread maatohewetbi
I want to ask what bolded values mean:

# -- core presence params --
modparam("presence","server_address","sip:*sa*@10.10.10.10:5060")


# -- pua and pua_dialoginfo parameters --
modparam("pua_dialoginfo", "presence_server", "sip:*sa*@10.10.10.10:5060")

I don't really know what to write there.



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Opensips-1-6-as-a-Proxy-and-Presence-Server-tp7605411p7605662.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] How to parse XML Body?

2017-01-19 Thread Bogdan-Andrei Iancu

Hi,

To be honest I'm not good on perl, but if you can do it directly at 
script level, it it cleaner and more efficient.


Also, check this 
https://github.com/OpenSIPS/opensips/commit/d509aa63698bc26fde390a4b707dbf2be31f5de5


Thanks and Regards,

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

On 01/18/2017 04:09 PM, xaled wrote:


Hi Bogdan,

works like a charm, thanks!

As an additional bonus now I know how to work with the perl module ;)

$rb(mime)[idx] is even more flexible.

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Dienstag, 17. Januar 2017 15:12
*To:* xaled ; 'OpenSIPS users mailling list' 


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

Hi,

There was a small typo in my regexp. The correct one is:

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

I tried it and it does the job.

Regarding the usability of the $rb variable, yes you have a point. I 
was thinking of something like $rb(mime)[idx] to access also per mime.


Best regards,


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

On 01/13/2017 12:04 PM, xaled wrote:

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>>#015#012 #015#012  #015#012 #015#012 #015#012
#015#012  #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.24#015#012mailto:pres:sip:+1234...@test.com>>#015#0

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

n>#015#012  #015#012 <12.32 34.24>#015#012  #015#012 #015#012
  #015#012 #015#012


ission-allowed>no#015#012
#015#012 #015#

012   #015#012 #015#012

Re: [OpenSIPS-Users] async radius problem

2017-01-19 Thread Dragomir Haralambiev
Thanks 

2017-01-19 11:03 GMT+02:00 Răzvan Crainea :

> Actually this is a characteristic of the async engine, not only the
> AAA_Radius module. I check to see where is the best place to specify this
> info.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 01/19/2017 10:40 AM, Dragomir Haralambiev wrote:
>
> Hi,
>
> Thanks for your quick replay.
>
> Please add this information in AAA_Radius module.
>
> Best regards,
>  Dragomir
>
> 2017-01-19 10:25 GMT+02:00 Răzvan Crainea :
>
>> Hi, Dragomir!
>>
>> Currently async operations are only available for requests, not for
>> replies. In the onreply_route you can only use synchronous operations for
>> now.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 01/18/2017 03:45 PM, Dragomir Haralambiev wrote:
>>
>> Hello,
>>
>> I have problem with async radius implementation.
>> OS - CEntOs 7
>> Opensips 2.2.2 - git hub from 15.01.2017
>>
>> Here pasrt of srcipt:
>>
>> onreply_route[outgoing] {
>> .
>> if (t_check_status("200")) {
>> async( radius_send_auth("prepayout","prepayin"), return_prepay );
>> }
>> }
>>
>>
>> route[return_prepay] {
>> xlog("L_ERR", "Radius return $rc");
>> } # end route return_prepay
>>
>> Here is part of Opensips log level 6:
>>
>>  /usr/sbin/opensips[21026]: DBG:tm:update_totag_set: new totag
>>  /usr/sbin/opensips[21026]: DBG:tm:insert_timer_unsafe: [2]:
>> 0x7fee75f19bd0 (36)
>>  /usr/sbin/opensips[21026]: DBG:tm:run_trans_callbacks:
>> trans=0x7fee75f19b50, callback type 64, id 0 entered
>>  /usr/sbin/opensips[21005]: DBG:core:handle_sigs: status = 11
>>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: child process 21026
>> exited by a signal 11
>>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: core was not generated
>>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: terminating due to
>> SIGCHLD
>>  /usr/sbin/opensips[21024]: INFO:core:sig_usr: signal 15 received
>>  /usr/sbin/opensips[21011]: INFO:core:sig_usr: signal 15 received
>>  /usr/sbin/opensips[21018]: INFO:core:sig_usr: signal 15 received
>>
>>
>> Where is problem?
>>
>> Best regards,
>> Dragomir
>>
>>
>> ___
>> 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 list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] async radius problem

2017-01-19 Thread Răzvan Crainea
Actually this is a characteristic of the async engine, not only the 
AAA_Radius module. I check to see where is the best place to specify 
this info.


Best regards,

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

On 01/19/2017 10:40 AM, Dragomir Haralambiev wrote:

Hi,

Thanks for your quick replay.

Please add this information in AAA_Radius module.

Best regards,
 Dragomir

2017-01-19 10:25 GMT+02:00 Răzvan Crainea >:


Hi, Dragomir!

Currently async operations are only available for requests, not
for replies. In the onreply_route you can only use synchronous
operations for now.

Best regards,

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

On 01/18/2017 03:45 PM, Dragomir Haralambiev wrote:

Hello,

I have problem with async radius implementation.
OS - CEntOs 7
Opensips 2.2.2 - git hub from 15.01.2017

Here pasrt of srcipt:

onreply_route[outgoing] {
.
if (t_check_status("200")) {
async( radius_send_auth("prepayout","prepayin"), return_prepay );
}
}


route[return_prepay] {
xlog("L_ERR", "Radius return $rc");
} # end route return_prepay

Here is part of Opensips log level 6:

 /usr/sbin/opensips[21026]: DBG:tm:update_totag_set: new totag
 /usr/sbin/opensips[21026]: DBG:tm:insert_timer_unsafe: [2]:
0x7fee75f19bd0 (36)
 /usr/sbin/opensips[21026]: DBG:tm:run_trans_callbacks:
trans=0x7fee75f19b50, callback type 64, id 0 entered
 /usr/sbin/opensips[21005]: DBG:core:handle_sigs: status = 11
 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: child process
21026 exited by a signal 11
 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: core was not
generated
 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: terminating
due to SIGCHLD
 /usr/sbin/opensips[21024]: INFO:core:sig_usr: signal 15 received
 /usr/sbin/opensips[21011]: INFO:core:sig_usr: signal 15 received
 /usr/sbin/opensips[21018]: INFO:core:sig_usr: signal 15 received


Where is problem?

Best regards,
Dragomir


___
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


Re: [OpenSIPS-Users] async radius problem

2017-01-19 Thread Dragomir Haralambiev
Hi,

Thanks for your quick replay.

Please add this information in AAA_Radius module.

Best regards,
 Dragomir

2017-01-19 10:25 GMT+02:00 Răzvan Crainea :

> Hi, Dragomir!
>
> Currently async operations are only available for requests, not for
> replies. In the onreply_route you can only use synchronous operations for
> now.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 01/18/2017 03:45 PM, Dragomir Haralambiev wrote:
>
> Hello,
>
> I have problem with async radius implementation.
> OS - CEntOs 7
> Opensips 2.2.2 - git hub from 15.01.2017
>
> Here pasrt of srcipt:
>
> onreply_route[outgoing] {
> .
> if (t_check_status("200")) {
> async( radius_send_auth("prepayout","prepayin"), return_prepay );
> }
> }
>
>
> route[return_prepay] {
> xlog("L_ERR", "Radius return $rc");
> } # end route return_prepay
>
> Here is part of Opensips log level 6:
>
>  /usr/sbin/opensips[21026]: DBG:tm:update_totag_set: new totag
>  /usr/sbin/opensips[21026]: DBG:tm:insert_timer_unsafe: [2]:
> 0x7fee75f19bd0 (36)
>  /usr/sbin/opensips[21026]: DBG:tm:run_trans_callbacks:
> trans=0x7fee75f19b50, callback type 64, id 0 entered
>  /usr/sbin/opensips[21005]: DBG:core:handle_sigs: status = 11
>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: child process 21026
> exited by a signal 11
>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: core was not generated
>  /usr/sbin/opensips[21005]: INFO:core:handle_sigs: terminating due to
> SIGCHLD
>  /usr/sbin/opensips[21024]: INFO:core:sig_usr: signal 15 received
>  /usr/sbin/opensips[21011]: INFO:core:sig_usr: signal 15 received
>  /usr/sbin/opensips[21018]: INFO:core:sig_usr: signal 15 received
>
>
> Where is problem?
>
> Best regards,
> Dragomir
>
>
> ___
> 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] OpenSIPs 2.2.2 warnings during start service

2017-01-19 Thread Răzvan Crainea
When starting opensips, is there any opensips process that is using more 
than 80% of a core? If so, can you pinpoint the PID in the opensipsctl 
ps command?


Best regards,

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

On 01/18/2017 11:55 PM, Ramachandran, Agalya (Contractor) wrote:


Same with my case too.

Regards,
Agalya

*From:*Users [mailto:users-boun...@lists.opensips.org] *On Behalf Of 
*Ahmed Munir

*Sent:* Wednesday, January 18, 2017 1:31 PM
*To:* OpenSIPs Users 
*Subject:* [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

Hi,

I'm currently seeing the warnings when I start opensips service;

Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 
us delay in execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 us 
delay in execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: timer job  has a 150 us 
delay in execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
WARNING:core:handle_timer_job: utimer job  has a 229 us 
delay in execution
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
INFO:core:do_action: max while loops are encountered
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3088]: 
WARNING:core:utimer_ticker: utimer task  already scheduled 
for 190 ms (now 2470 ms), it may over

lap..

I've tried to update the source code for timer.c (line#: 190) ref: 
https://github.com/OpenSIPS/opensips/commit/fd8f6ec442b4365da9d274af6939954246ece865?diff=split, 
but didn't work at all.


Currently running 8 child processors, see below;

[root@qorblpsisprxyd1 ]# opensips  -V
version: opensips 2.2.2 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, 
F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535

poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
main.c compiled on 12:39:45 Jan 18 2017 with gcc 4.4.7


[root@qorblpsisprxyd1 ]# opensipsctl fifo ps
Process::  ID=0 PID=3083 Type=attendant
Process::  ID=1 PID=3085 Type=MI FIFO
Process::  ID=2 PID=3086 Type=time_keeper
Process::  ID=3 PID=3088 Type=timer
Process::  ID=4 PID=3089 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=5 PID=3091 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=6 PID=3092 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=7 PID=3094 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=8 PID=3096 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=9 PID=3098 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=10 PID=3100 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=11 PID=3102 Type=SIP receiver udp:10.3.120.94:5060 


Process::  ID=12 PID=3104 Type=Timer handler

I would like to know what changes required to fix this change? Please 
advise.



--

Regards,

Ahmed Munir Chohan



___
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] async- issues- 2.2.2

2017-01-19 Thread Răzvan Crainea

You have my answer inline.

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

On 01/18/2017 08:17 PM, Ramachandran, Agalya (Contractor) wrote:


Hi Razvan,

Got your point.I tried to increase the MAX_CONTENT_TYPE_LEN  and 
tested async call and it is working fine without crash.


But one more question.

The same piece of code am using for *sync REST_API* query too in 
rest_put() method. There also print_buff is only being used.


It is working absolutely fine in the case of sync  call even  if the 
MAX_CONTENT_TYPE_LEN – is 64.


Wondering what would be the reason in sync call, it is working and in 
async it is not?


Pure luck. You are doing a buffer overflow, overwriting the data 
section. Probably when doing sync calls, nobody is using the data you 
are overwriting. But if it doesn't crash it doesn't mean it is ok :).


Regards,

Agalya

*From:*Users [mailto:users-boun...@lists.opensips.org] *On Behalf Of 
*Razvan Crainea

*Sent:* Wednesday, January 18, 2017 4:29 AM
*To:* users@lists.opensips.org
*Subject:* Re: [OpenSIPS-Users] async- issues- 2.2.2

Hi, Ramachandran!

The print_buff buffer is declared with length MAX_CONTENT_TYPE_LEN -> 
64. Writing more than 64 bytes will lead to a buffer overflow, 
probably followed by a crash.
If you want to suppor longer CallIDs, just increase the size of the 
buffer, or allocate the buffer with a size large enought to fit your 
callid length.


Best regards,

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

On 01/17/2017 11:13 PM, Ramachandran, Agalya (Contractor) wrote:

Hi Liviu,

Found the exact issue what causes the crash.

In start_async_http_req, under case PUT/POST, we have the
following code blue color by default.

But for my project scenario, I need to add call-id header too
here, including that code in red color for your reference.

if (req_ctype) {

sprintf(print_buff, "Content-Type: %s", req_ctype);

header_list = curl_slist_append(header_list, print_buff);

sprintf(print_buff, "Call-Id: %s", instanceId);

header_list = curl_slist_append(header_list, print_buff);

w_curl_easy_setopt(handle, CURLOPT_HTTPHEADER, header_list);

   }

If I try by removing the Call-Id header in the curl-slist, then it
works perfectly fine in case of POST as well as PUT.

How can I overcome this situation? Your guidance would help me a lot.

Regards,
Agalya

*From:* Users [mailto:users-boun...@lists.opensips.org] *On Behalf
Of *Ramachandran, Agalya (Contractor)
*Sent:* Tuesday, January 17, 2017 3:58 PM
*To:* OpenSIPS users mailling list 
; Liviu Chircu
 
*Subject:* Re: [OpenSIPS-Users] async- issues- 2.2.2

Hi,

Another information may help you to find this issue.

Am changing the “req_body” in the rest_methods.c, as per the REST
API server is expecting the payload value.

If I change this “req_body” in *REST_POST* as well, and if the
*Call-Id length is > 56*, it crashes in *the POST call too*.

Regards,
Agalya

*From:* Users [mailto:users-boun...@lists.opensips.org] *On Behalf
Of *Ramachandran, Agalya (Contractor)
*Sent:* Tuesday, January 17, 2017 3:03 PM
*To:* OpenSIPS users mailling list >; Liviu Chircu
>
*Subject:* [OpenSIPS-Users] async- issues- 2.2.2

Hi Liviu/team,

When I try to do an asynchronous REST_PUT call in OpenSIPS 2.2.2,
I see the below observance and issues.

All the calls are made from sipp client.

*No*



*Test Scenario *



*Result/observation*

1.



Call-Id length < 50



Works perfectly fine

2



Call-Id length  >54 and < 56



No crash observed. But error in curl_multiperform

3.



Call-Id length  > 56



Opensips crashes at liburl.

Please find the details for test 2 and test 3.

I have tested with REST_POST with case 3, I didn’t observe any
crashes.

Please let me know what could cause this issue and how can I fix this?

*Test2:*

**

Jan 17 18:23:13 /usr/local/sbin/opensips[18554]:
ERROR:rest_client:start_async_http_req: curl_multi_perform:
Invalid multi handle

Jan 17 18:23:13  /usr/local/sbin/opensips[18554]:
ERROR:rest_client:start_async_http_req: curl_multi_remove_handle:
Invalid multi handle

*Test 3:*

(gdb) bt

#0 0x7f370bccb9bb in curl_multi_add_handle () from
/lib64/libcurl.so.4

#1 0x7f370bf05521 in start_async_http_req
(msg=msg@entry=0x7f374db14270, method=method@entry=REST_CLIENT_PUT,

url=0x7f374dad8178 "http://url;, req_body=,

req_ctype=,
out_handle=out_handle@entry=0x7f374db204e0,

Re: [OpenSIPS-Users] async radius problem

2017-01-19 Thread Răzvan Crainea

Hi, Dragomir!

Currently async operations are only available for requests, not for 
replies. In the onreply_route you can only use synchronous operations 
for now.


Best regards,

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

On 01/18/2017 03:45 PM, Dragomir Haralambiev wrote:

Hello,

I have problem with async radius implementation.
OS - CEntOs 7
Opensips 2.2.2 - git hub from 15.01.2017

Here pasrt of srcipt:

onreply_route[outgoing] {
.
if (t_check_status("200")) {
async( radius_send_auth("prepayout","prepayin"), return_prepay );
}
}


route[return_prepay] {
xlog("L_ERR", "Radius return $rc");
} # end route return_prepay

Here is part of Opensips log level 6:

 /usr/sbin/opensips[21026]: DBG:tm:update_totag_set: new totag
 /usr/sbin/opensips[21026]: DBG:tm:insert_timer_unsafe: [2]: 
0x7fee75f19bd0 (36)
 /usr/sbin/opensips[21026]: DBG:tm:run_trans_callbacks: 
trans=0x7fee75f19b50, callback type 64, id 0 entered

 /usr/sbin/opensips[21005]: DBG:core:handle_sigs: status = 11
 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: child process 21026 
exited by a signal 11

 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: core was not generated
 /usr/sbin/opensips[21005]: INFO:core:handle_sigs: terminating due to 
SIGCHLD

 /usr/sbin/opensips[21024]: INFO:core:sig_usr: signal 15 received
 /usr/sbin/opensips[21011]: INFO:core:sig_usr: signal 15 received
 /usr/sbin/opensips[21018]: INFO:core:sig_usr: signal 15 received


Where is problem?

Best regards,
Dragomir


___
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