Re: [OpenSIPS-Users] Load-Balancer Module - status destinations in database?

2017-01-24 Thread Johan De Clercq
as far as I know, you can only do this with mi. As the status depends on
probing, in my opinion, it doesn't make sense to store this in a db.

BR, Johan.

2017-01-25 1:16 GMT+01:00 Mundkowsky, Robert :

> Is there a way to get the status (enabled or disabled) of load balancer
> destinations in database?
>
> Or is lb_list MI only way?
>
>
>
> 
>
> This e-mail and any files transmitted with it may contain privileged or
> confidential information. It is solely for use by the individual for whom
> it is intended, even if addressed incorrectly. If you received this e-mail
> in error, please notify the sender; do not disclose, copy, distribute, or
> take any action in reliance on the contents of this information; and delete
> it from your system. Any other use of this e-mail is prohibited.
>
>
> Thank you for your compliance.
>
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Load-Balancer Module - status destinations in database?

2017-01-24 Thread Mundkowsky, Robert
Is there a way to get the status (enabled or disabled) of load balancer 
destinations in database?

Or is lb_list MI only way?





This e-mail and any files transmitted with it may contain privileged or 
confidential information. It is solely for use by the individual for whom it is 
intended, even if addressed incorrectly. If you received this e-mail in error, 
please notify the sender; do not disclose, copy, distribute, or take any action 
in reliance on the contents of this information; and delete it from your 
system. Any other use of this e-mail is prohibited.


Thank you for your compliance.



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


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

2017-01-24 Thread Ramachandran, Agalya (Contractor)


From: Ramachandran, Agalya (Contractor)
Sent: Tuesday, January 24, 2017 11:42 AM
To: 'Bogdan-Andrei Iancu' 
Subject: RE: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

Hi Bogdan,


1)  do you get warning only for the tm-utimer job ? or do you see other too 
?
I rarely see from blcore-expire job too.
  2)do you have some load on the server (in terms of traffic) ? or is 
it idle/almost-idle ?
Mostly its idle, May be it will process 5 to 10 calls in an hour. That is the 
load it is been handling right now.

Giving the Process id and its same logs.

Process::  ID=0 PID=11744 Type=attendant
Process::  ID=1 PID=11745 Type=MI FIFO
Process::  ID=2 PID=11746 Type=time_keeper
Process::  ID=3 PID=11747 Type=timer
Process::  ID=4 PID=11748 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=5 PID=11749 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=6 PID=11750 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=7 PID=11751 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=8 PID=11752 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=9 PID=11753 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=10 PID=11754 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=11 PID=11755 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=12 PID=11756 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=13 PID=11757 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=14 PID=11758 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=15 PID=11759 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=16 PID=11760 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=17 PID=11761 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=18 PID=11762 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=19 PID=11763 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=20 PID=11764 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=21 PID=11765 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=22 PID=11766 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=23 PID=11767 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=24 PID=11768 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=25 PID=11769 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=26 PID=11770 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=27 PID=11771 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=28 PID=11772 Type=Timer handler

Jan 23 22:36:29 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 22:49:42 /usr/local/sbin/opensips[11767]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 22:53:15 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
timer job  has a 8 us delay in execution
Jan 23 22:53:15 /usr/local/sbin/opensips[11753]: WARNING:core:handle_timer_job: 
timer job  has a 8 us delay in execution
Jan 23 22:55:06 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 22:59:37 /usr/local/sbin/opensips[11767]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 23:07:20 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 23:29:51 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 23:30:11 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 23:30:26 /usr/local/sbin/opensips[11772]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 23 23:35:55 /usr/local/sbin/opensips[11758]: WARNING:core:handle_timer_job: 
utimer job  has a 3 us delay in execution
Jan 23 23:35:55 /usr/local/sbin/opensips[11771]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution

Regards,
Agalya

From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
Sent: Tuesday, January 24, 2017 11:09 AM
To: Ramachandran, Agalya (Contractor) 
>; 
OpenSIPS users mailling list 
>
Subject: Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

Hi Agalya,

1) do you get warning only for the tm-utimer job ? or do you see other too ?

2) do you have some load on the server (in terms of traffic) ? or is it 
idle/almost-idle ?

3) the "ps" and the logs are not from the same run (the pid's do not match) - 
can you get the data from same run please ?

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com
___
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-24 Thread Bogdan-Andrei Iancu

Hi Agalya,

1)do you get warning only for the tm-utimer job ? or do you see other too ?

2) do you have some load on the server (in terms of traffic) ? or is it 
idle/almost-idle ?


3) the "ps" and the logs are not from the same run (the pid's do not 
match) - can you get thedata from same run please ?


Best regards,

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

On 01/24/2017 06:00 PM, Ramachandran, Agalya (Contractor) wrote:


Hi Bogdan,

Please find the result of “opensipsctl fifo ps” and the warnings am 
seeing in logs.


Process:: ID=0 PID=3497 Type=attendant

Process:: ID=1 PID=3498 Type=MI FIFO

Process:: ID=2 PID=3499 Type=time_keeper

Process:: ID=3 PID=3500 Type=timer

Process:: ID=4 PID=3501 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=5 PID=3502 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=6 PID=3503 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=7 PID=3504 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=8 PID=3505 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=9 PID=3506 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=10 PID=3507 Type=SIP receiver udp:10.0.0.1:5060

Process:: ID=11 PID=3508 Type=SIP receiver udp:10.0.0.1:5060

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

Warnings:

Jan 24 15:03:00 /usr/local/sbin/opensips[27867]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Jan 24 15:04:15 /usr/local/sbin/opensips[27866]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Jan 24 15:10:02 /usr/local/sbin/opensips[27866]: 
WARNING:core:handle_timer_job: utimer job  has a 8 us 
delay in execution


Jan 24 15:19:35 /usr/local/sbin/opensips[27866]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Jan 24 15:23:42 /usr/local/sbin/opensips[27866]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Jan 24 15:25:55 /usr/local/sbin/opensips[27872]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Jan 24 15:42:04 /usr/local/sbin/opensips[27860]: 
WARNING:core:handle_timer_job: utimer job  has a 2 us 
delay in execution


Regards,
Agalya

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Tuesday, January 24, 2017 6:34 AM
*To:* OpenSIPS users mailling list ; 
Ramachandran, Agalya (Contractor) 
*Subject:* Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start 
service


Hi Agalya,

Please provide the output of "opensipsctl fifo ps"

Best regards.


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

On 01/19/2017 04:55 PM, Ramachandran, Agalya (Contractor) wrote:

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 

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

2017-01-24 Thread Ramachandran, Agalya (Contractor)
Hi Bogdan,

Please find the result of “opensipsctl fifo ps” and the warnings am seeing in 
logs.

Process::  ID=0 PID=3497 Type=attendant
Process::  ID=1 PID=3498 Type=MI FIFO
Process::  ID=2 PID=3499 Type=time_keeper
Process::  ID=3 PID=3500 Type=timer
Process::  ID=4 PID=3501 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=5 PID=3502 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=6 PID=3503 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=7 PID=3504 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=8 PID=3505 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=9 PID=3506 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=10 PID=3507 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=11 PID=3508 Type=SIP receiver udp:10.0.0.1:5060
Process::  ID=12 PID=3509 Type=Timer handler


Warnings:
Jan 24 15:03:00 /usr/local/sbin/opensips[27867]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 24 15:04:15 /usr/local/sbin/opensips[27866]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 24 15:10:02 /usr/local/sbin/opensips[27866]: WARNING:core:handle_timer_job: 
utimer job  has a 8 us delay in execution
Jan 24 15:19:35 /usr/local/sbin/opensips[27866]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 24 15:23:42 /usr/local/sbin/opensips[27866]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 24 15:25:55 /usr/local/sbin/opensips[27872]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution
Jan 24 15:42:04 /usr/local/sbin/opensips[27860]: WARNING:core:handle_timer_job: 
utimer job  has a 2 us delay in execution

Regards,
Agalya
From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
Sent: Tuesday, January 24, 2017 6:34 AM
To: OpenSIPS users mailling list ; Ramachandran, 
Agalya (Contractor) 
Subject: Re: [OpenSIPS-Users] OpenSIPs 2.2.2 warnings during start service

Hi Agalya,

Please provide the output of "opensipsctl fifo ps"

Best regards.



Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com
On 01/19/2017 04:55 PM, Ramachandran, Agalya (Contractor) wrote:
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, 

Re: [OpenSIPS-Users] Async DB statement

2017-01-24 Thread Bogdan-Andrei Iancu

Ahmed,

after an async() call, the execution never returns, but it continues 
exclusively via the resume route.


Regards,

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

On 01/24/2017 05:06 PM, Ahmed Munir wrote:
I mean to say, after calling async statement, somehow it is not 
routing back the call to the main routing script after post DB query, 
see e.g. below for the current routing using async;


route [1]{


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

}
..
}

route[ob_route_1]{
$avp(res)=$rc;

if ($avp(res) > 0) {
cache_store("local", "DID_$tU", "$avp(outpluse)", 60);
cache_store("local", "Trunk_$tU", "$avp(trunkid)", 60);

}

$avp(ru)=$(avp(ru){s.substr,1,0});

#Look for exten and trunk id for the FROM cache Internal 
number table

if(cache_fetch("local", "$tU", $avp(iexten))) {
if(cache_fetch("local", "GroupID_$tU", $avp(igroupid))) {
#$var(flag) = 1;
$avp(flag) = 1;
}
}


}

At first in route[1], I was setting up 
'$avp(ru)=$(avp(ru){s.substr,1,0});' and post routing script after 
async DB statement, but it is not resuming the route from there. As a 
work around, instead of setting up $avp(ru) and storing variable in 
cache in route[1], added them in route[ob_route_1] (as example above), 
it works.


I would like to know, is there way after executing async DB statement 
(in route[ob_route_1]), we can resume back the route in route[1] or not?


On Tue, Jan 24, 2017 at 9:09 AM, Bogdan-Andrei Iancu 
> wrote:


Could you please rephrase / detail your question, as I do not
understand what you are asking.

Thanks,

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

On 01/24/2017 03:44 PM, Ahmed Munir wrote:

Thanks, have been working on this and it is working.
Btw, I would like to know, is there a way to resume route while
using async avp_db_query? As currently setting/declaring another
async route for DB query, looking for resume route in main
routing script.
On Tue, Jan 24, 2017 at 6:45 AM, Bogdan-Andrei Iancu
> wrote:

Hi Ahmed, Note the $rc holds the return code of the LAST
executed statement/instruction/function in the script. In the
first case you do it right by saving the ret code of the
avp_db_query into a separate variable, so you can use it even
later. In the sync script, the $rc, when entering the resume
route, it will hold the return code of the avp_db_query()
function. But the $rc will be changed when doing the xlog(),
the if(), etc...So when you do the last xlog(), the $rc will
have nothing to do with the avp_db_query(). If you need it
later in the script, better save it, as you do in the first
example. Regards,

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


On 01/20/2017 01:31 AM, Ahmed Munir wrote:

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 

Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Bogdan-Andrei Iancu

OK, that should work for sure.

Regards,

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

On 01/24/2017 03:02 PM, Khalil Khamlichi wrote:

sorry :

# record routing
   record_route();

# create dialog with timeout
   if ( !create_dialog("B") ) {
   send_reply("500","Internal Server Error");
   exit;
   }

# apply transformations from dialplan table
   dp_translate("0","$rU/$rU");

# route calls based on prefix
   if ( !do_routing("1","W",,"$var(rule_attrs)","$var(gw_attrs)") ) {
   send_reply("404","No Route found");
   exit;
   }

   $acc_extra(gwid)=$avp(gw_id);

   t_on_failure("GW_FAILOVER");

   do_accounting("db|log","cdr|missed",);
#NAT
   if (isbflagset(NAT)) setflag(NAT);
#NAT
#TOPOHIDE
  toopology_hiding("UC");
#TOPOHIDE
   route(RELAY);

}


___
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-24 Thread Bogdan-Andrei Iancu
The versions before 2.1 had a completely different approach on hoe the 
timer jobs were handled - different code, so no such warnings. The 2.1 
introduces the a more flexible and scalable processing for the timer jobs.


Could you confirm that removing the DB op from the startup route 
eliminates the warnings ?


Thanks,

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

On 01/24/2017 03:49 PM, Ahmed Munir wrote:
Yes, using startup route in my routing script and running DB query. 
This kind of warning I didn't face using 1.6 and 1.8 opensips versions 
but 2.2.2.


Will you recommend async statement for my current routing (see below) 
for the startup?


startup_route
{
$var(res) = 1;
$avp(tmp) = "1";
   # $var(x) = 0;
while($var(res) > 0)
{
$var(res) = avp_db_query("SELECT Distinct One800, dnis FROM 
DNIS_Mapping where One800 > $avp(tmp) order by One800;", 
"$avp(One800), $avp(dnis)");

if($var(res) >= 0)
{
$var(i) = 0;
while($(avp(One800)[$var(i)]) != "NULL")
{
cache_store("local", 
"DNIS_$(avp(dnis)[$var(i)])", "$(avp(One800)[$var(i)])");

$avp(tmp) = $(avp(One800)[$var(i)]);
 #   $var(x) = $var(x) + 1;
$(avp(One800)[$var(i)]) = "NULL";
$var(i) = $var(i) + 1;
#   xlog("$var(x) : $(avp(s:dnis)[$var(i)])");
}
}
}
}


On Tue, Jan 24, 2017 at 6:38 AM, Bogdan-Andrei Iancu 
> wrote:


Hi Ahmed,

So, the warnings pop up ONLY during startup sequence.  Do you use
startup route or any module performing mem caching of some DB
table (drouting, permission, etc) ? Usually, the first UDP child
is doing some heavy lifting during startup.

Regards,

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

On 01/19/2017 06:01 PM, Ahmed Munir wrote:

Hi Razvan,
During starting up the opensips service, I see the first opensips
child process (pid"11172) consumes CPU process to 70-80% and
later drop downs to 0.3 - 0.0 % CPU per core. See below;
[root@qorblpsisprxyd1 ~]# top -c -u opensips top - 10:49:54 up 76
days, 23:31,  5 users,  load average: 0.00, 0.00, 0.00 Tasks: 229
total,   1 running, 228 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi,
0.0%si,  0.0%st Mem:  65964364k total,  2568124k used, 63396240k
free,   180220k buffers Swap:  1023996k total,0k used, 
1023996k free,  1226104k cached   PID USER  PR  NI  VIRT 
RES  SHR S %CPU %MEMTIME+ COMMAND 11177 opensips  20   0 
165m 5696 4528 S  0.3  0.0   0:00.23 /usr/sbin/opensips -P

/var/run/opensips.pid -m 64 -u opensips -g opensips 11187
opensips  20   0  165m 5628 4460 S  0.3  0.0   0:00.41
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g
opensips 11166 opensips  20   0  165m 6892 5752 S  0.0  0.0  
0:00.23 /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
opensips -g opensips 11168 opensips  20   0  165m 1980  840 S 
0.0  0.0   0:00.00 /usr/sbin/opensips -P /var/run/opensips.pid -m

64 -u opensips -g opensips 11169 opensips  20   0  165m 1464  328
S  0.0  0.0   0:00.53 /usr/sbin/opensips -P /var/run/opensips.pid
-m 64 -u opensips -g opensips 11171 opensips  20   0  165m 1640 
504 S  0.0  0.0   0:00.15 /usr/sbin/opensips -P

/var/run/opensips.pid -m 64 -u opensips -g opensips 11172
opensips  20   0  166m  40m  38m S  0.0  0.1   0:02.61
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g
opensips 11174 opensips  20   0  165m 6304 5136 S  0.0  0.0  
0:00.24 /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
opensips -g opensips 11175 opensips  20   0  165m 5884 4716 S 
0.0  0.0   0:00.22 /usr/sbin/opensips -P /var/run/opensips.pid -m

64 -u opensips -g opensips 11179 opensips  20   0  165m 7660 6492
S  0.0  0.0   0:00.27 /usr/sbin/opensips -P /var/run/opensips.pid
-m 64 -u opensips -g opensips 11181 opensips  20   0  165m 7756
6588 S  0.0  0.0   0:00.33 /usr/sbin/opensips -P
/var/run/opensips.pid -m 64 -u opensips -g opensips 11183
opensips  20   0  165m 5520 4352 S  0.0  0.0   0:00.34
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g
opensips 11185 opensips  20   0  165m 7336 6168 S  0.0  0.0  
0:00.36 /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u
opensips -g opensips 11189 opensips  20   0  165m 7320 6152 S 
0.0  0.0   0:00.36 /usr/sbin/opensips -P /var/run/opensips.pid -m

64 -u opensips -g opensips 11190 opensips  20   0  165m 4688 3528
S  0.0  0.0   0:00.30 /usr/sbin/opensips -P /var/run/opensips.pid
-m 64 -u opensips -g opensips

Re: [OpenSIPS-Users] Async DB statement

2017-01-24 Thread Bogdan-Andrei Iancu
Could you please rephrase / detail your question, as I do not understand 
what you are asking.


Thanks,

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

On 01/24/2017 03:44 PM, Ahmed Munir wrote:

Thanks, have been working on this and it is working.

Btw, I would like to know, is there a way to resume route while using 
async avp_db_query? As currently setting/declaring another async route 
for DB query, looking for resume route in main routing script.


On Tue, Jan 24, 2017 at 6:45 AM, Bogdan-Andrei Iancu 
> wrote:


Hi Ahmed,

Note the $rc holds the return code of the LAST executed
statement/instruction/function in the script. In the first case
you do it right by saving the ret code of the avp_db_query into a
separate variable, so you can use it even later.

In the sync script, the $rc, when entering the resume route, it
will hold the return code of the avp_db_query() function. But the
$rc will be changed when doing the xlog(), the if(), etc...So when
you do the last xlog(), the $rc will have nothing to do with the
avp_db_query(). If you need it later in the script, better save
it, as you do in the first example.

Regards,

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

On 01/20/2017 01:31 AM, Ahmed Munir wrote:

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 

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

2017-01-24 Thread Ahmed Munir
Yes, using startup route in my routing script and running DB query. This
kind of warning I didn't face using 1.6 and 1.8 opensips versions but 2.2.2.

Will you recommend async statement for my current routing (see below) for
the startup?

startup_route
{
$var(res) = 1;
$avp(tmp) = "1";
   # $var(x) = 0;
while($var(res) > 0)
{
$var(res) = avp_db_query("SELECT Distinct One800, dnis FROM
DNIS_Mapping where One800 > $avp(tmp) order by One800;", "$avp(One800),
$avp(dnis)");
if($var(res) >= 0)
{
$var(i) = 0;
while($(avp(One800)[$var(i)]) != "NULL")
{
cache_store("local", "DNIS_$(avp(dnis)[$var(i)])",
"$(avp(One800)[$var(i)])");
$avp(tmp) = $(avp(One800)[$var(i)]);
 #   $var(x) = $var(x) + 1;
$(avp(One800)[$var(i)]) = "NULL";
$var(i) = $var(i) + 1;
#   xlog("$var(x) : $(avp(s:dnis)[$var(i)])");
}
}
}
}


On Tue, Jan 24, 2017 at 6:38 AM, Bogdan-Andrei Iancu 
wrote:

> Hi Ahmed,
>
> So, the warnings pop up ONLY during startup sequence.  Do you use startup
> route or any module performing mem caching of some DB table (drouting,
> permission, etc) ? Usually, the first UDP child is doing some heavy lifting
> during startup.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 01/19/2017 06:01 PM, Ahmed Munir wrote:
>
> Hi Razvan,
>
> During starting up the opensips service, I see the first opensips child
> process (pid"11172) consumes CPU process to 70-80% and later drop downs to
> 0.3 - 0.0 % CPU per core. See below;
>
> [root@qorblpsisprxyd1 ~]# top -c -u opensips
> top - 10:49:54 up 76 days, 23:31,  5 users,  load average: 0.00, 0.00, 0.00
> Tasks: 229 total,   1 running, 228 sleeping,   0 stopped,   0 zombie
> Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi,  0.0%si,
> 0.0%st
> Mem:  65964364k total,  2568124k used, 63396240k free,   180220k buffers
> Swap:  1023996k total,0k used,  1023996k free,  1226104k cached
>
>   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
> 11177 opensips  20   0  165m 5696 4528 S  0.3  0.0   0:00.23
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11187 opensips  20   0  165m 5628 4460 S  0.3  0.0   0:00.41
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11166 opensips  20   0  165m 6892 5752 S  0.0  0.0   0:00.23
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11168 opensips  20   0  165m 1980  840 S  0.0  0.0   0:00.00
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11169 opensips  20   0  165m 1464  328 S  0.0  0.0   0:00.53
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11171 opensips  20   0  165m 1640  504 S  0.0  0.0   0:00.15
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11172 opensips  20   0  166m  40m  38m S  0.0  0.1   0:02.61
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11174 opensips  20   0  165m 6304 5136 S  0.0  0.0   0:00.24
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11175 opensips  20   0  165m 5884 4716 S  0.0  0.0   0:00.22
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11179 opensips  20   0  165m 7660 6492 S  0.0  0.0   0:00.27
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11181 opensips  20   0  165m 7756 6588 S  0.0  0.0   0:00.33
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11183 opensips  20   0  165m 5520 4352 S  0.0  0.0   0:00.34
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11185 opensips  20   0  165m 7336 6168 S  0.0  0.0   0:00.36
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11189 opensips  20   0  165m 7320 6152 S  0.0  0.0   0:00.36
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
> 11190 opensips  20   0  165m 4688 3528 S  0.0  0.0   0:00.30
> /usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
>
> [root@qorblpsisprxyd1 ~]# opensipsctl fifo ps
> Process::  ID=0 PID=11166 Type=attendant
> Process::  ID=1 PID=11168 Type=MI FIFO
> Process::  ID=2 PID=11169 Type=time_keeper
> Process::  ID=3 PID=11171 Type=timer
> Process::  ID=4 PID=11172 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=5 PID=11174 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=6 PID=11175 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=7 PID=11177 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=8 PID=11179 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=9 PID=11181 Type=SIP receiver udp:10.3.120.94:5060
> Process::  ID=10 PID=11183 

Re: [OpenSIPS-Users] Async DB statement

2017-01-24 Thread Ahmed Munir
Thanks, have been working on this and it is working.

Btw, I would like to know, is there a way to resume route while using async
avp_db_query? As currently setting/declaring another async route for DB
query, looking for resume route in main routing script.

On Tue, Jan 24, 2017 at 6:45 AM, Bogdan-Andrei Iancu 
wrote:

> Hi Ahmed,
>
> Note the $rc holds the return code of the LAST executed
> statement/instruction/function in the script. In the first case you do it
> right by saving the ret code of the avp_db_query into a separate variable,
> so you can use it even later.
>
> In the sync script, the $rc, when entering the resume route, it will hold
> the return code of the avp_db_query() function. But the $rc will be changed
> when doing the xlog(), the if(), etc...So when you do the last xlog(), the
> $rc will have nothing to do with the avp_db_query(). If you need it later
> in the script, better save it, as you do in the first example.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 01/20/2017 01:31 AM, Ahmed Munir wrote:
>
> 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 <(609)%20902-> |
> 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 <(609)%20902-> |
> 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 <(609)%20902-> |
> trunkid -> 117 | Return Code: 1---
> Jan 19 18:10:07 qorblpsisprxyd1 /usr/sbin/opensips[14109]: - OB
> Route 1-2 DB fetched value outpluse -> 609902 <(609)%20902-> |
> 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 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>


-- 
Regards,

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


Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Alberto Gonzales
lunch time here, gracias khalil.

On Tue, Jan 24, 2017 at 1:02 PM, Khalil Khamlichi <
khamlichi.kha...@gmail.com> wrote:

> sorry :
>
> # record routing
>record_route();
>
># create dialog with timeout
>if ( !create_dialog("B") ) {
>send_reply("500","Internal Server Error");
>exit;
>}
>
> # apply transformations from dialplan table
>dp_translate("0","$rU/$rU");
>
># route calls based on prefix
>if ( !do_routing("1","W",,"$var(rule_attrs)","$var(gw_attrs)") ) {
>send_reply("404","No Route found");
>exit;
>}
>
>$acc_extra(gwid)=$avp(gw_id);
>
>t_on_failure("GW_FAILOVER");
>
>do_accounting("db|log","cdr|missed",);
> #NAT
>if (isbflagset(NAT)) setflag(NAT);
> #NAT
> #TOPOHIDE
> toopology_hiding("UC");
> #TOPOHIDE
>route(RELAY);
>
> }
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Khalil Khamlichi
sorry :

# record routing
   record_route();

   # create dialog with timeout
   if ( !create_dialog("B") ) {
   send_reply("500","Internal Server Error");
   exit;
   }

# apply transformations from dialplan table
   dp_translate("0","$rU/$rU");

   # route calls based on prefix
   if ( !do_routing("1","W",,"$var(rule_attrs)","$var(gw_attrs)") ) {
   send_reply("404","No Route found");
   exit;
   }

   $acc_extra(gwid)=$avp(gw_id);

   t_on_failure("GW_FAILOVER");

   do_accounting("db|log","cdr|missed",);
#NAT
   if (isbflagset(NAT)) setflag(NAT);
#NAT
#TOPOHIDE
toopology_hiding("UC");
#TOPOHIDE
   route(RELAY);

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


Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Bogdan-Andrei Iancu
I see no indication of creating a dialog in your script sample :(...Are 
you sure about this ?


Regards,

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

On 01/24/2017 02:20 PM, Alberto Gonzales wrote:

I am using dialog in my script,
here is the part of main function

# apply transformations from dialplan table
   dp_translate("0","$rU/$rU");

# route calls based on prefix
   if ( !do_routing("1","W",,"$var(rule_attrs)","$var(gw_attrs)") ) {
   send_reply("404","No Route found");
   exit;
   }

   $acc_extra(gwid)=$avp(gw_id);

   t_on_failure("GW_FAILOVER");

   do_accounting("db|log","cdr|missed",);
#NAT
   if (isbflagset(NAT)) setflag(NAT);
#NAT
#TOPOHIDE
toopology_hiding("UC");
#TOPOHIDE
   route(RELAY);

}



On Tue, Jan 24, 2017 at 12:09 PM, Bogdan-Andrei Iancu 
> wrote:


Hi,

It should be ok, but in your case the TH will not benefit from the
dialog module (you do not use it) - all the info to he hidden will
be appended to the Contact hdr (as extra param), while when using
the dialog support, this info is stored into the dialog.

To be honest, I never tried the combination of nathelper and TH
_without_ dialog support. But give it a try...if you get a trace,
I can check if ok.

Regards,

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

On 01/24/2017 02:03 PM, Alberto Gonzales wrote:

Thanks Bogdan, Well, I have fix_nated_contact() at the very top
of my script :
route{force_rport();   if (nat_uac_test("23")) {
   fix_nated_contact();   setflag(NAT);   }
   if (!mf_process_maxfwd_header("10")) {
   sl_send_reply("483","Too Many
Hops");   exit;   }


if (has_totag()) { # sequential request withing a dialog
should # take the path determined by record-routing 
remplazar : if (loose_route()) { if (topology_hiding_match()) { ...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");   route(RELAY);}
so is my script correct ?
I just want to make sure I have a correct script before I do any
further work on this.
Thanks.
On Tue, Jan 24, 2017 at 11:52 AM, Bogdan-Andrei Iancu
> wrote:

Hi, You can do TH with nathelper, BUT be sure to create the
dialog + TH AFTER doing the fix_nated_contact(). Regards,

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


On 01/20/2017 12:42 PM, Alberto Gonzales wrote:

We used instruction in the book, which states at the end of
the paragraph this :
Topology hiding limitations
You cannot easily combine topology hiding with NAT traversal
because both the
processes mangle the Contact header. Topology hiding will
not hide the address and
other information contained in other headers such as the
display in the From header.
To change the From header, you can use the
uac_replace_from() function.
I think our problem comes from the fact that we are using
nathelper and also an rtpproxy in our script.
can anyone provide help about activating topology hiding
along with nathelper ?
thanks in advance.
On Fri, Jan 20, 2017 at 10:14 AM, Alberto Gonzales
> wrote:

I forgot to mention that doing this resulted in opensips
crashing after 20 minutes :)
On Fri, Jan 20, 2017 at 9:56 AM, Alberto Gonzales
> wrote:

Hello grupo,
We have configured topology hiding in opensips 2.2
this way :
please confirm to us this is the only thing we need
to do or is there anything else that needs to be added.
route {


if (has_totag()) { # sequential request
withing a dialog should # take the path determined
by record-routing  remplazar : if
(loose_route()) { if (topology_hiding_match()) { ...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");   route(RELAY);}
also what could be a quick test to see if this
hiding is working or not.
thanks in advance.
Alberto


Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Alberto Gonzales
I am using dialog in my script,
here is the part of main function

# apply transformations from dialplan table
   dp_translate("0","$rU/$rU");

   # route calls based on prefix
   if ( !do_routing("1","W",,"$var(rule_attrs)","$var(gw_attrs)") ) {
   send_reply("404","No Route found");
   exit;
   }

   $acc_extra(gwid)=$avp(gw_id);

   t_on_failure("GW_FAILOVER");

   do_accounting("db|log","cdr|missed",);
#NAT
   if (isbflagset(NAT)) setflag(NAT);
#NAT
#TOPOHIDE
toopology_hiding("UC");
#TOPOHIDE
   route(RELAY);

}




On Tue, Jan 24, 2017 at 12:09 PM, Bogdan-Andrei Iancu 
wrote:

> Hi,
>
> It should be ok, but in your case the TH will not benefit from the dialog
> module (you do not use it) - all the info to he hidden will be appended to
> the Contact hdr (as extra param), while when using the dialog support, this
> info is stored into the dialog.
>
> To be honest, I never tried the combination of nathelper and TH _without_
> dialog support. But give it a try...if you get a trace, I can check if ok.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 01/24/2017 02:03 PM, Alberto Gonzales wrote:
>
> Thanks Bogdan, Well, I have fix_nated_contact() at the very top of my
> script :
>
> route{
>
>force_rport();
>if (nat_uac_test("23")) {
>fix_nated_contact();
>setflag(NAT);
>}
>
>
>if (!mf_process_maxfwd_header("10")) {
>sl_send_reply("483","Too Many Hops");
>exit;
>}
>
> 
> 
> if (has_totag()) {
># sequential request withing a dialog should
># take the path determined by record-routing
> remplazar : if (loose_route()) {
>if (topology_hiding_match()) {
>
> ...
> ...
>   *## esconder topologia antes de pasar la llamada*
>topology_hiding("UC");
>route(RELAY);
> }
>
> so is my script correct ?
> I just want to make sure I have a correct script before I do any further
> work on this.
>
> Thanks.
>
> On Tue, Jan 24, 2017 at 11:52 AM, Bogdan-Andrei Iancu <
> bog...@opensips.org> wrote:
>
>> Hi,
>>
>> You can do TH with nathelper, BUT be sure to create the dialog + TH AFTER
>> doing the fix_nated_contact().
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>>
>> On 01/20/2017 12:42 PM, Alberto Gonzales wrote:
>>
>> We used instruction in the book, which states at the end of the paragraph
>> this :
>> Topology hiding limitations
>> You cannot easily combine topology hiding with NAT traversal because both
>> the
>> processes mangle the Contact header. Topology hiding will not hide the
>> address and
>> other information contained in other headers such as the display in the
>> From header.
>> To change the From header, you can use the uac_replace_from() function.
>> I think our problem comes from the fact that we are using nathelper and
>> also an rtpproxy in our script.
>> can anyone provide help about activating topology hiding along with
>> nathelper ?
>> thanks in advance.
>> On Fri, Jan 20, 2017 at 10:14 AM, Alberto Gonzales <
>> albertosgonz...@gmail.com> wrote:
>>>
>>> I forgot to mention that doing this resulted in opensips crashing after
>>> 20 minutes :)
>>> On Fri, Jan 20, 2017 at 9:56 AM, Alberto Gonzales <
>>> albertosgonz...@gmail.com> wrote:

 Hello grupo,
 We have configured topology hiding in opensips 2.2 this way :
 please confirm to us this is the only thing we need to do or is there
 anything else that needs to be added.
 route {
 
 
 if (has_totag()) {# sequential request withing
 a dialog should# take the path determined by
 record-routing remplazar : if (loose_route()) {
if (topology_hiding_match()) { ...
 ...
   *## esconder topologia antes de pasar la llamada*
topology_hiding("UC");route(RELAY); }
 also what could be a quick test to see if this hiding is working or not.
 thanks in advance.
 Alberto

>>> ___
>> 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] topology hiding in opensips

2017-01-24 Thread Bogdan-Andrei Iancu

Hi,

It should be ok, but in your case the TH will not benefit from the 
dialog module (you do not use it) - all the info to he hidden will be 
appended to the Contact hdr (as extra param), while when using the 
dialog support, this info is stored into the dialog.


To be honest, I never tried the combination of nathelper and TH 
_without_ dialog support. But give it a try...if you get a trace, I can 
check if ok.


Regards,

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

On 01/24/2017 02:03 PM, Alberto Gonzales wrote:
Thanks Bogdan, Well, I have fix_nated_contact() at the very top of my 
script :


route{

   force_rport();
   if (nat_uac_test("23")) {
   fix_nated_contact();
   setflag(NAT);
   }


   if (!mf_process_maxfwd_header("10")) {
   sl_send_reply("483","Too Many Hops");
   exit;
   }



if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
 remplazar : if (loose_route()) {
if (topology_hiding_match()) {

...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");
   route(RELAY);
}

so is my script correct ?
I just want to make sure I have a correct script before I do any 
further work on this.


Thanks.

On Tue, Jan 24, 2017 at 11:52 AM, Bogdan-Andrei Iancu 
> wrote:


Hi,

You can do TH with nathelper, BUT be sure to create the dialog +
TH AFTER doing the fix_nated_contact().

Regards,

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

On 01/20/2017 12:42 PM, Alberto Gonzales wrote:

We used instruction in the book, which states at the end of the
paragraph this :
Topology hiding limitations
You cannot easily combine topology hiding with NAT traversal
because both the
processes mangle the Contact header. Topology hiding will not
hide the address and
other information contained in other headers such as the display
in the From header.
To change the From header, you can use the uac_replace_from()
function.
I think our problem comes from the fact that we are using
nathelper and also an rtpproxy in our script.
can anyone provide help about activating topology hiding along
with nathelper ?
thanks in advance.
On Fri, Jan 20, 2017 at 10:14 AM, Alberto Gonzales
>
wrote:

I forgot to mention that doing this resulted in opensips
crashing after 20 minutes :)
On Fri, Jan 20, 2017 at 9:56 AM, Alberto Gonzales
> wrote:

Hello grupo,
We have configured topology hiding in opensips 2.2 this
way :
please confirm to us this is the only thing we need to do
or is there anything else that needs to be added.
route {


if (has_totag()) { # sequential request withing a
dialog should # take the path determined by
record-routing  remplazar : if (loose_route()) { if
(topology_hiding_match()) { ...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");   route(RELAY);}
also what could be a quick test to see if this hiding is
working or not.
thanks in advance.
Alberto

___
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 1.6 as a Proxy and Presence Server

2017-01-24 Thread Bogdan-Andrei Iancu

Hi,

Those are SIP URIs to be used as contacts by the presence server (a SIP 
URI pointing back - as address- to the presence server); in a Contact 
URI, the username part is no relevant (as the contact is a reference to 
the IP location of the device), so you can put whatever you want as 
username.


Regards,

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

On 01/19/2017 01:03 PM, maatohewetbi wrote:

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



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


Re: [OpenSIPS-Users] topology hiding in opensips

2017-01-24 Thread Bogdan-Andrei Iancu

Hi,

You can do TH with nathelper, BUT be sure to create the dialog + TH 
AFTER doing the fix_nated_contact().


Regards,

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

On 01/20/2017 12:42 PM, Alberto Gonzales wrote:
We used instruction in the book, which states at the end of the 
paragraph this :


Topology hiding limitations
You cannot easily combine topology hiding with NAT traversal because 
both the
processes mangle the Contact header. Topology hiding will not hide the 
address and
other information contained in other headers such as the display in 
the From header.

To change the From header, you can use the uac_replace_from() function.

I think our problem comes from the fact that we are using nathelper 
and also an rtpproxy in our script.


can anyone provide help about activating topology hiding along with 
nathelper ?


thanks in advance.


On Fri, Jan 20, 2017 at 10:14 AM, Alberto Gonzales 
> wrote:


I forgot to mention that doing this resulted in opensips crashing
after 20 minutes :)

On Fri, Jan 20, 2017 at 9:56 AM, Alberto Gonzales
> wrote:

Hello grupo,

We have configured topology hiding in opensips 2.2 this way :

please confirm to us this is the only thing we need to do or
is there anything else that needs to be added.

route {


if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
 remplazar : if (loose_route()) {
if (topology_hiding_match()) {

...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");
   route(RELAY);
}


also what could be a quick test to see if this hiding is
working or not.

thanks in advance.

Alberto





___
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] topology hiding in opensips

2017-01-24 Thread Bogdan-Andrei Iancu

Hi Alberto,

Do you have any logs to show the crash ? also, do you get a corefile 
(see http://www.opensips.org/Documentation/TroubleShooting-Crash).


Regards,

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

On 01/20/2017 12:14 PM, Alberto Gonzales wrote:
I forgot to mention that doing this resulted in opensips crashing 
after 20 minutes :)


On Fri, Jan 20, 2017 at 9:56 AM, Alberto Gonzales 
> wrote:


Hello grupo,

We have configured topology hiding in opensips 2.2 this way :

please confirm to us this is the only thing we need to do or is
there anything else that needs to be added.

route {


if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
 remplazar : if (loose_route()) {
if (topology_hiding_match()) {

...
...
*## esconder topologia antes de pasar la llamada*
topology_hiding("UC");
   route(RELAY);
}


also what could be a quick test to see if this hiding is working
or not.

thanks in advance.

Alberto




___
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 DB statement

2017-01-24 Thread Bogdan-Andrei Iancu

Hi Ahmed,

Note the $rc holds the return code of the LAST executed 
statement/instruction/function in the script. In the first case you do 
it right by saving the ret code of the avp_db_query into a separate 
variable, so you can use it even later.


In the sync script, the $rc, when entering the resume route, it will 
hold the return code of the avp_db_query() function. But the $rc will be 
changed when doing the xlog(), the if(), etc...So when you do the last 
xlog(), the $rc will have nothing to do with the avp_db_query(). If you 
need it later in the script, better save it, as you do in the first example.


Regards,

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

On 01/20/2017 01:31 AM, Ahmed Munir wrote:

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


___
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-24 Thread Bogdan-Andrei Iancu

Hi Ahmed,

So, the warnings pop up ONLY during startup sequence.  Do you use 
startup route or any module performing mem caching of some DB table 
(drouting, permission, etc) ? Usually, the first UDP child is doing some 
heavy lifting during startup.


Regards,

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

On 01/19/2017 06:01 PM, Ahmed Munir wrote:

Hi Razvan,

During starting up the opensips service, I see the first opensips 
child process (pid"11172) consumes CPU process to 70-80% and later 
drop downs to 0.3 - 0.0 % CPU per core. See below;


[root@qorblpsisprxyd1 ~]# top -c -u opensips
top - 10:49:54 up 76 days, 23:31,  5 users,  load average: 0.00, 0.00, 
0.00

Tasks: 229 total,   1 running, 228 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi, 0.0%si,  
0.0%st

Mem:  65964364k total,  2568124k used, 63396240k free,   180220k buffers
Swap:  1023996k total,0k used,  1023996k free,  1226104k cached

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+ COMMAND
11177 opensips  20   0  165m 5696 4528 S  0.3  0.0   0:00.23 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11187 opensips  20   0  165m 5628 4460 S  0.3  0.0   0:00.41 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11166 opensips  20   0  165m 6892 5752 S  0.0  0.0   0:00.23 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11168 opensips  20   0  165m 1980  840 S  0.0  0.0   0:00.00 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11169 opensips  20   0  165m 1464  328 S  0.0  0.0   0:00.53 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11171 opensips  20   0  165m 1640  504 S  0.0  0.0   0:00.15 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11172 opensips  20   0  166m  40m  38m S  0.0  0.1   0:02.61 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11174 opensips  20   0  165m 6304 5136 S  0.0  0.0   0:00.24 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11175 opensips  20   0  165m 5884 4716 S  0.0  0.0   0:00.22 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11179 opensips  20   0  165m 7660 6492 S  0.0  0.0   0:00.27 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11181 opensips  20   0  165m 7756 6588 S  0.0  0.0   0:00.33 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11183 opensips  20   0  165m 5520 4352 S  0.0  0.0   0:00.34 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11185 opensips  20   0  165m 7336 6168 S  0.0  0.0   0:00.36 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11189 opensips  20   0  165m 7320 6152 S  0.0  0.0   0:00.36 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips
11190 opensips  20   0  165m 4688 3528 S  0.0  0.0   0:00.30 
/usr/sbin/opensips -P /var/run/opensips.pid -m 64 -u opensips -g opensips


[root@qorblpsisprxyd1 ~]# opensipsctl fifo ps
Process::  ID=0 PID=11166 Type=attendant
Process::  ID=1 PID=11168 Type=MI FIFO
Process::  ID=2 PID=11169 Type=time_keeper
Process::  ID=3 PID=11171 Type=timer
Process::  ID=4 PID=11172 Type=SIP receiver udp:10.3.120.94:5060 

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

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

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

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

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

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

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

Process::  ID=12 PID=11187 Type=SIP receiver udp:10.3.120.94:5060 

Process::  ID=13 PID=11189 Type=SIP receiver udp:10.3.120.94:5060 


Process::  ID=14 PID=11190 Type=Timer handler

OpenSIPs used by each CPU processor;

[root@qorblpsisprxyd1 ~]# ps -o pid,psr,comm -C opensips
  PID PSR COMMAND
11166   0 opensips
11168   2 opensips
11169   6 opensips
11171   5 opensips
11172   5 opensips
11174   5 opensips
11175   5 opensips
11177   5 opensips
11179   7 opensips
11181   1 opensips
11183   0 opensips
11185   2 opensips
11187   5 opensips
11189   5 opensips
11190   4 opensips



___
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-24 Thread Bogdan-Andrei Iancu

Hi Agalya,

Please provide the output of "opensipsctl fifo ps"

Best regards.

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

On 01/19/2017 04:55 PM, Ramachandran, Agalya (Contractor) wrote:


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


___
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-24 Thread Bogdan-Andrei Iancu

Hi,

Does this happen ONLY at startup ? without any other warnings during 
runtime ?


There is something interesting in your logs:

First is this log, saying you do an infinite loop in a "while" in the 
script:
Jan 18 13:04:35 qorblpsisprxyd1 /usr/sbin/opensips[3089]: 
INFO:core:do_action: max while loops are encountered
And secondly all the warning are from the same process (3089) which is 
the the first SIP UDP listener.


Do you use any startup route ?

Regards,

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

On 01/18/2017 08:30 PM, Ahmed Munir wrote:

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] tcp with opensips .

2017-01-24 Thread Bogdan-Andrei Iancu

Hi Sasmita,

1.6 is a real old version. The oldest still maintained version is 1.11, 
so you should consider it.


The newer version have support for async (none blocking) TCP support 
(connect, read, write) so it should not be a problem at all.


Regards,

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

On 01/18/2017 03:36 PM, Sasmita Panda wrote:

HI All,

  Earlier there is problem with running tcp with saving data in 
database at the same time . Is the problem get solved . If yes then in 
which version of opensips .


  I think , there was problem with openisps -1.6 . In heavy load 
it was not recomended to run tcp in same instance which is saving data 
in database too .


  Can anybody inform me whcih version i should use for this .


*/Thanks & Regards/*
/Sasmita Panda/
/Network Testing and Software Engineer/
/3CLogic , ph:07827611765/


___
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] scheduled concurrent call reporting

2017-01-24 Thread Khalil Khamlichi
I looked up at the docs, $stat(active_dialogs)  is for the whole system,
If there is no way to call get_profile_size() automatically from whithin
opensips I will need to fall back to MI fifo from an external script.

On Tue, Jan 24, 2017 at 8:49 AM, Khalil Khamlichi <
khamlichi.kha...@gmail.com> wrote:

> Hi Răzvan, would $stat(active_dialogs) give detailed stats ? I mean for
> each label I put on the calls ? example if I am labeling by IP would I get
> from $stat(active_dialogs) stats by label ?
>
> On Tue, Jan 24, 2017 at 8:38 AM, Răzvan Crainea 
> wrote:
>
>> Hello, Khalil!
>>
>> You could check the $stat(active_dialogs) pvar, which will return the
>> number of ongoing dialogs.
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Core Developer
>> http://www.opensips-solutions.com
>>
>> On 01/24/2017 01:05 AM, Khalil Khamlichi wrote:
>>
>>> the idea is that I don't need to get the number of calls 30 times per
>>> second which would happens if I save to redis on each invite. scheduling
>>> the saving to redis every 10 seconds serves  well my purpose but the
>>> timer_route doesn't seem to accept get_profile_size()
>>>
>>> any hints would be appreciated.
>>>
>>> On Mon, Jan 23, 2017 at 10:39 PM, Khalil Khamlichi
>>> > wrote:
>>>
>>> Hi,
>>>
>>> I am trying to get call load information out of opensips at regular
>>> intervals to get some sort of realtime view of the load on the
>>> server.
>>>
>>> After applying profiles on the the INVITEs, I have tried to call
>>> get_profile_size from a timer_route.
>>> I am getting error :
>>>
>>> CRITICAL:core:yyerror: parse error in config file
>>> /usr/local//etc/opensips/opensips.cfg, line 483, column 38-39:
>>> Command cannot be used in the block
>>>
>>> Any alternative solutions ?
>>>
>>> Thanks in advance.
>>>
>>> kkh
>>>
>>>
>>>
>>>
>>> ___
>>> 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] scheduled concurrent call reporting

2017-01-24 Thread Khalil Khamlichi
Hi Răzvan, would $stat(active_dialogs) give detailed stats ? I mean for
each label I put on the calls ? example if I am labeling by IP would I get
from $stat(active_dialogs) stats by label ?

On Tue, Jan 24, 2017 at 8:38 AM, Răzvan Crainea  wrote:

> Hello, Khalil!
>
> You could check the $stat(active_dialogs) pvar, which will return the
> number of ongoing dialogs.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 01/24/2017 01:05 AM, Khalil Khamlichi wrote:
>
>> the idea is that I don't need to get the number of calls 30 times per
>> second which would happens if I save to redis on each invite. scheduling
>> the saving to redis every 10 seconds serves  well my purpose but the
>> timer_route doesn't seem to accept get_profile_size()
>>
>> any hints would be appreciated.
>>
>> On Mon, Jan 23, 2017 at 10:39 PM, Khalil Khamlichi
>> > wrote:
>>
>> Hi,
>>
>> I am trying to get call load information out of opensips at regular
>> intervals to get some sort of realtime view of the load on the server.
>>
>> After applying profiles on the the INVITEs, I have tried to call
>> get_profile_size from a timer_route.
>> I am getting error :
>>
>> CRITICAL:core:yyerror: parse error in config file
>> /usr/local//etc/opensips/opensips.cfg, line 483, column 38-39:
>> Command cannot be used in the block
>>
>> Any alternative solutions ?
>>
>> Thanks in advance.
>>
>> kkh
>>
>>
>>
>>
>> ___
>> 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] scheduled concurrent call reporting

2017-01-24 Thread Răzvan Crainea

Hello, Khalil!

You could check the $stat(active_dialogs) pvar, which will return the 
number of ongoing dialogs.


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 01/24/2017 01:05 AM, Khalil Khamlichi wrote:

the idea is that I don't need to get the number of calls 30 times per
second which would happens if I save to redis on each invite. scheduling
the saving to redis every 10 seconds serves  well my purpose but the
timer_route doesn't seem to accept get_profile_size()

any hints would be appreciated.

On Mon, Jan 23, 2017 at 10:39 PM, Khalil Khamlichi
> wrote:

Hi,

I am trying to get call load information out of opensips at regular
intervals to get some sort of realtime view of the load on the server.

After applying profiles on the the INVITEs, I have tried to call
get_profile_size from a timer_route.
I am getting error :

CRITICAL:core:yyerror: parse error in config file
/usr/local//etc/opensips/opensips.cfg, line 483, column 38-39:
Command cannot be used in the block

Any alternative solutions ?

Thanks in advance.

kkh




___
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