Re: [OpenSIPS-Users] SIP Authentication Attacks

2012-02-02 Thread Dovid Bender
James,


We have found with out users that some of them put the phones on public
IP's. If the default password is not changed, no matter how hard the
password is they will get in. Also try using characters like "@:^#" in your
passwords.


Regards,

 

Dovid

 

  _  

From: users-boun...@lists.opensips.org
[mailto:users-boun...@lists.opensips.org] On Behalf Of aws j
Sent: Thursday, February 02, 2012 06:08
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] SIP Authentication Attacks

 

Dear Mr James
Can you attached to me your suspect file to make VoIP forensic on it .
thanks
Aws 
Msc VoIP security 

2012/2/1 James Lamanna 

Hi,
I've noticed lately that a server of mine is getting repeatedly hit by
an attacker trying to make international calls.
The scary part is that the attacker seems to be able to register
correctly on different extensions, even though each extension has a
different, random password.
I'm not sure how the attacker is getting the passwords or if there's a
man-in-the-middle attack going on, but I would like some suggestions
on how to increase the security of SIP authentication in opensips.
I could enforce security through IP addresses, but I fear that will
become quite cumbersome.

Thanks.

-- James

___
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] check_source_address not working with upgrade

2012-02-02 Thread duane . larson
I just upgraded my b2bua opensips server to the latest trunk version and  
now my if statements using "check_source_address" from the permissions  
module isn't working. I have the following set up


loadmodule "permissions.so"
modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx/opensips")


if (check_source_address("2") || check_source_address("3") ||  
check_source_address("4")) {


The INVITE comes from my SIP Proxy and worked before the upgrade without  
issue




Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX, 5060,  
1> in tables
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:hash_match: specified group does not exist in hash table
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:match_subnet_table: subnet table is empty
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX, 5060,  
1> in tables
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:hash_match: specified group does not exist in hash table
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:match_subnet_table: subnet table is empty
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX, 5060,  
1> in tables
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:hash_match: specified group does not exist in hash table
Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:  
DBG:permissions:match_subnet_table: subnet table is empty





This is what I have in the database
Proxy01:/var/log# opensipsctl db show address
+-+-++--+--+---+-+--+
| id | grp | ip | mask | port | proto | pattern | context_info |
+-+-++--+--+---+-+--+
| 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
| 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
| 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
| 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
| 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
| 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
+-+-++--+--+---+-+--+



I am not sure if OpenSIPS is really querying the mysql database because I  
don't really see any connections from the server when a call is made. How  
could this be possible? When I start OpenSIPS I see that it talks to the  
database.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] check_source_address not working with upgrade

2012-02-02 Thread Ryan Bullock
I will chime into say that I ran into the same issue when attempting
to upgrade to the latest trunk. I just have not had time to open a bug
and get a test setup to do in-depth trouble shooting.

On Thu, Feb 2, 2012 at 8:38 AM,   wrote:
> I just upgraded my b2bua opensips server to the latest trunk version and now
> my if statements using "check_source_address" from the permissions module
> isn't working. I have the following set up
>
> loadmodule "permissions.so"
> modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx/opensips")
>
>
> if (check_source_address("2") || check_source_address("3") ||
> check_source_address("4")) {
>
> The INVITE comes from my SIP Proxy and worked before the upgrade without
> issue
>
>
>
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
>
>
>
>
> This is what I have in the database
> Proxy01:/var/log# opensipsctl db show address
> +-+-++--+--+---+-+--+
> | id | grp | ip | mask | port | proto | pattern | context_info |
> +-+-++--+--+---+-+--+
> | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
> | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> +-+-++--+--+---+-+--+
>
>
>
> I am not sure if OpenSIPS is really querying the mysql database because I
> don't really see any connections from the server when a call is made. How
> could this be possible? When I start OpenSIPS I see that it talks to the
> database.
> ___
> 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] check_source_address not working with upgrade

2012-02-02 Thread Duane Larson
Hmmm.  That would suck if its a bug.  Just to follow up on my last email
here is what I see when I start OpenSIPS.  You can see that OpenSIPS grabs
all the info from the "address" table


Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: number of rows in address table: 6
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <216.82.224.202, 2, 5060, 0, ,
> inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <64.2.142.15, 4, 5060, 0, , >
inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <173.XXX.XXX.63, 10, 5060, 0, ,
> inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <173.XXX.XXX.10, 10, 5060, 0, ,
> inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <173.XXX.XXX.107, 3, 5060, 0, ,
> inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: Tuple <216.82.225.202, 2, 5060, 0, ,
> inserted into address hash table
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_columns: freeing result columns at 0x7fd95d243710
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_rows: freeing 6 rows
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d244248
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d244348
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d28
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d244548
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d244648
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_row: freeing row values at 0x7fd95d244748
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_rows: freeing rows at 0x7fd95d2441e8
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:db_free_result: freeing result set at 0x7fd95d2358e8
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:permissions:reload_address_table: address table reloaded successfully.
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]:
DBG:core:pool_remove: removing connection from the pool
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]: DBG:core:init_mod:
register MI for permissions
Feb  2 10:39:32 proxy01 /usr/local/sbin/opensips[14584]: DBG:core:init_mod:
initializing module uri





On Thu, Feb 2, 2012 at 10:43 AM, Ryan Bullock  wrote:

> I will chime into say that I ran into the same issue when attempting
> to upgrade to the latest trunk. I just have not had time to open a bug
> and get a test setup to do in-depth trouble shooting.
>
> On Thu, Feb 2, 2012 at 8:38 AM,   wrote:
> > I just upgraded my b2bua opensips server to the latest trunk version and
> now
> > my if statements using "check_source_address" from the permissions module
> > isn't working. I have the following set up
> >
> > loadmodule "permissions.so"
> >
> modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx
> /opensips")
> >
> >
> > if (check_source_address("2") || check_source_address("3") ||
> > check_source_address("4")) {
> >
> > The INVITE comes from my SIP Proxy and worked before the upgrade without
> > issue
> >
> >
> >
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: subnet table is empty
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: subnet table is empty
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: su

Re: [OpenSIPS-Users] check_source_address not working with upgrade

2012-02-02 Thread Ovidiu Sas
Check the in memory cache:
http://www.opensips.org/html/docs/modules/devel/permissions.html#id293903
See "address_dump" and "subnet_dump".

At start up, opensips will cache everything in memory.

Regards,
Ovidiu Sas

--
VoIP Embedded, Inc.
http://www.voipembedded.com


On Thu, Feb 2, 2012 at 11:38 AM,   wrote:
> I just upgraded my b2bua opensips server to the latest trunk version and now
> my if statements using "check_source_address" from the permissions module
> isn't working. I have the following set up
>
> loadmodule "permissions.so"
> modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx/opensips")
>
>
> if (check_source_address("2") || check_source_address("3") ||
> check_source_address("4")) {
>
> The INVITE comes from my SIP Proxy and worked before the upgrade without
> issue
>
>
>
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX, 5060,
> 1> in tables
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:hash_match: specified group does not exist in hash table
> Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> DBG:permissions:match_subnet_table: subnet table is empty
>
>
>
>
> This is what I have in the database
> Proxy01:/var/log# opensipsctl db show address
> +-+-++--+--+---+-+--+
> | id | grp | ip | mask | port | proto | pattern | context_info |
> +-+-++--+--+---+-+--+
> | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
> | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> +-+-++--+--+---+-+--+
>
>
>
> I am not sure if OpenSIPS is really querying the mysql database because I
> don't really see any connections from the server when a call is made. How
> could this be possible? When I start OpenSIPS I see that it talks to the
> database.
> ___
> 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] Presence pidf accumulating

2012-02-02 Thread Mihai Richard
Hello,

I¹m having  a bit of a problem with the presence mechanism provided by the
OpenSIPS server. From one device I send information with a PUBLISH and the
pidf xml looks like this:




my status
available



And if I send more statuses, with a different note in activities, the remote
client receives through the NOTIFY a set of statuses instead of the last
one, something like this:




my status
available




older status
available




even older status
available




Does anyone know why the server keeps track of my older statuses?

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


Re: [OpenSIPS-Users] check_source_address not working with upgrade

2012-02-02 Thread Duane Larson
This is what I see

Proxy01:/var/log# opensipsctl fifo address_dump
  15 <173.XXX.XXX.XXX,3, 5060, 0, NULL, NULL>
  20 <216.82.224.202,2, 5060, 0, NULL, NULL>
  34 <64.2.142.15,4, 5060, 0, NULL, NULL>
  50 <216.82.225.202,2, 5060, 0, NULL, NULL>
  63 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
  85 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
Proxy01:/var/log#
Proxy01:/var/log#
Proxy01:/var/log#
Proxy01:/var/log#
Proxy01:/var/log# opensipsctl fifo subnet_dump


So the subnet_dump is empty.




On Thu, Feb 2, 2012 at 10:48 AM, Ovidiu Sas  wrote:

> Check the in memory cache:
> http://www.opensips.org/html/docs/modules/devel/permissions.html#id293903
> See "address_dump" and "subnet_dump".
>
> At start up, opensips will cache everything in memory.
>
> Regards,
> Ovidiu Sas
>
> --
> VoIP Embedded, Inc.
> http://www.voipembedded.com
>
>
> On Thu, Feb 2, 2012 at 11:38 AM,   wrote:
> > I just upgraded my b2bua opensips server to the latest trunk version and
> now
> > my if statements using "check_source_address" from the permissions module
> > isn't working. I have the following set up
> >
> > loadmodule "permissions.so"
> >
> modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx
> /opensips")
> >
> >
> > if (check_source_address("2") || check_source_address("3") ||
> > check_source_address("4")) {
> >
> > The INVITE comes from my SIP Proxy and worked before the upgrade without
> > issue
> >
> >
> >
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: subnet table is empty
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: subnet table is empty
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX,
> 5060,
> > 1> in tables
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:hash_match: specified group does not exist in hash table
> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> > DBG:permissions:match_subnet_table: subnet table is empty
> >
> >
> >
> >
> > This is what I have in the database
> > Proxy01:/var/log# opensipsctl db show address
> >
> +-+-++--+--+---+-+--+
> > | id | grp | ip | mask | port | proto | pattern | context_info |
> >
> +-+-++--+--+---+-+--+
> > | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> > | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
> > | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> > | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> > | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> > | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> >
> +-+-++--+--+---+-+--+
> >
> >
> >
> > I am not sure if OpenSIPS is really querying the mysql database because I
> > don't really see any connections from the server when a call is made. How
> > could this be possible? When I start OpenSIPS I see that it talks to the
> > database.
> > ___
> > 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
>



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


Re: [OpenSIPS-Users] check_source_address not working with upgrade

2012-02-02 Thread Ovidiu Sas
The subnet is empty because you don't have any subnets (the mask is
set to 32 and therefore you have full IP matching).  Is the message
source IP in the address_dump?

Regards,
Ovidiu Sas

-- 
VoIP Embedded, Inc.
http://www.voipembedded.com

On Thu, Feb 2, 2012 at 11:52 AM, Duane Larson  wrote:
> This is what I see
>
> Proxy01:/var/log# opensipsctl fifo address_dump
>   15 <173.XXX.XXX.XXX,3, 5060, 0, NULL, NULL>
>   20 <216.82.224.202,2, 5060, 0, NULL, NULL>
>   34 <64.2.142.15,4, 5060, 0, NULL, NULL>
>   50 <216.82.225.202,2, 5060, 0, NULL, NULL>
>   63 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
>   85 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
> Proxy01:/var/log#
> Proxy01:/var/log#
> Proxy01:/var/log#
> Proxy01:/var/log#
> Proxy01:/var/log# opensipsctl fifo subnet_dump
>
>
> So the subnet_dump is empty.
>
>
>
>
> On Thu, Feb 2, 2012 at 10:48 AM, Ovidiu Sas  wrote:
>>
>> Check the in memory cache:
>> http://www.opensips.org/html/docs/modules/devel/permissions.html#id293903
>> See "address_dump" and "subnet_dump".
>>
>> At start up, opensips will cache everything in memory.
>>
>> Regards,
>> Ovidiu Sas
>>
>> --
>> VoIP Embedded, Inc.
>> http://www.voipembedded.com
>>
>>
>> On Thu, Feb 2, 2012 at 11:38 AM,   wrote:
>> > I just upgraded my b2bua opensips server to the latest trunk version and
>> > now
>> > my if statements using "check_source_address" from the permissions
>> > module
>> > isn't working. I have the following set up
>> >
>> > loadmodule "permissions.so"
>> >
>> > modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx/opensips")
>> >
>> >
>> > if (check_source_address("2") || check_source_address("3") ||
>> > check_source_address("4")) {
>> >
>> > The INVITE comes from my SIP Proxy and worked before the upgrade without
>> > issue
>> >
>> >
>> >
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX,
>> > 5060,
>> > 1> in tables
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:hash_match: specified group does not exist in hash table
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:match_subnet_table: subnet table is empty
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX,
>> > 5060,
>> > 1> in tables
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:hash_match: specified group does not exist in hash table
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:match_subnet_table: subnet table is empty
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX,
>> > 5060,
>> > 1> in tables
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:hash_match: specified group does not exist in hash table
>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
>> > DBG:permissions:match_subnet_table: subnet table is empty
>> >
>> >
>> >
>> >
>> > This is what I have in the database
>> > Proxy01:/var/log# opensipsctl db show address
>> >
>> > +-+-++--+--+---+-+--+
>> > | id | grp | ip | mask | port | proto | pattern | context_info |
>> >
>> > +-+-++--+--+---+-+--+
>> > | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
>> > | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
>> > | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
>> > | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
>> > | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
>> > | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
>> >
>> > +-+-++--+--+---+-+--+
>> >
>> >
>> >
>> > I am not sure if OpenSIPS is really querying the mysql database because
>> > I
>> > don't really see any connections from the server when a call is made.
>> > How
>> > could this be possible? When I start OpenSIPS I see that it talks to the
>> > database.
>> > ___
>> > 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
>
>
>
>
> --
> --
> *--*--*--*--*--*
> Duane
> *--*--*--*--*--*
> --
>
> ___
> 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] check_source_address not working with upgrade

2012-02-02 Thread Duane Larson
Yeah.  It is the first one in the list (Number 15 in the dump).  Like I
said this worked before I upgraded.

On Thu, Feb 2, 2012 at 10:56 AM, Ovidiu Sas  wrote:

> The subnet is empty because you don't have any subnets (the mask is
> set to 32 and therefore you have full IP matching).  Is the message
> source IP in the address_dump?
>
> Regards,
> Ovidiu Sas
>
> --
> VoIP Embedded, Inc.
> http://www.voipembedded.com
>
> On Thu, Feb 2, 2012 at 11:52 AM, Duane Larson 
> wrote:
> > This is what I see
> >
> > Proxy01:/var/log# opensipsctl fifo address_dump
> >   15 <173.XXX.XXX.XXX,3, 5060, 0, NULL, NULL>
> >   20 <216.82.224.202,2, 5060, 0, NULL, NULL>
> >   34 <64.2.142.15,4, 5060, 0, NULL, NULL>
> >   50 <216.82.225.202,2, 5060, 0, NULL, NULL>
> >   63 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
> >   85 <173.XXX.XXX.XXX,10, 5060, 0, NULL, NULL>
> > Proxy01:/var/log#
> > Proxy01:/var/log#
> > Proxy01:/var/log#
> > Proxy01:/var/log#
> > Proxy01:/var/log# opensipsctl fifo subnet_dump
> >
> >
> > So the subnet_dump is empty.
> >
> >
> >
> >
> > On Thu, Feb 2, 2012 at 10:48 AM, Ovidiu Sas 
> wrote:
> >>
> >> Check the in memory cache:
> >>
> http://www.opensips.org/html/docs/modules/devel/permissions.html#id293903
> >> See "address_dump" and "subnet_dump".
> >>
> >> At start up, opensips will cache everything in memory.
> >>
> >> Regards,
> >> Ovidiu Sas
> >>
> >> --
> >> VoIP Embedded, Inc.
> >> http://www.voipembedded.com
> >>
> >>
> >> On Thu, Feb 2, 2012 at 11:38 AM,   wrote:
> >> > I just upgraded my b2bua opensips server to the latest trunk version
> and
> >> > now
> >> > my if statements using "check_source_address" from the permissions
> >> > module
> >> > isn't working. I have the following set up
> >> >
> >> > loadmodule "permissions.so"
> >> >
> >> >
> modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx
> /opensips")
> >> >
> >> >
> >> > if (check_source_address("2") || check_source_address("3") ||
> >> > check_source_address("4")) {
> >> >
> >> > The INVITE comes from my SIP Proxy and worked before the upgrade
> without
> >> > issue
> >> >
> >> >
> >> >
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:check_src_addr_3: Looking for : <2, 173.XXX.XXX.XXX,
> >> > 5060,
> >> > 1> in tables
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:hash_match: specified group does not exist in hash
> table
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:match_subnet_table: subnet table is empty
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:check_src_addr_3: Looking for : <3, 173.XXX.XXX.XXX,
> >> > 5060,
> >> > 1> in tables
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:hash_match: specified group does not exist in hash
> table
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:match_subnet_table: subnet table is empty
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:check_src_addr_3: Looking for : <4, 173.XXX.XXX.XXX,
> >> > 5060,
> >> > 1> in tables
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:hash_match: specified group does not exist in hash
> table
> >> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:
> >> > DBG:permissions:match_subnet_table: subnet table is empty
> >> >
> >> >
> >> >
> >> >
> >> > This is what I have in the database
> >> > Proxy01:/var/log# opensipsctl db show address
> >> >
> >> >
> +-+-++--+--+---+-+--+
> >> > | id | grp | ip | mask | port | proto | pattern | context_info |
> >> >
> >> >
> +-+-++--+--+---+-+--+
> >> > | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> >> > | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |
> >> > | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> >> > | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> >> > | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |
> >> > | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |
> >> >
> >> >
> +-+-++--+--+---+-+--+
> >> >
> >> >
> >> >
> >> > I am not sure if OpenSIPS is really querying the mysql database
> because
> >> > I
> >> > don't really see any connections from the server when a call is made.
> >> > How
> >> > could this be possible? When I start OpenSIPS I see that it talks to
> the
> >> > database.
> >> > ___
> >> > 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] check_source_address not working with upgrade

2012-02-02 Thread duane . larson
I talked a little with Ovidiu offline so I went ahead and opened a bug  
ticket.



Ticket is
3483337 check_source_address broken in latest trunk Open 2012-02-02 nobody  
duanelarson123 None 5


Thanks for the help Ovidiu.




On , Duane Larson  wrote:
Yeah. It is the first one in the list (Number 15 in the dump). Like I  
said this worked before I upgraded.



On Thu, Feb 2, 2012 at 10:56 AM, Ovidiu Sas o...@voipembedded.com> wrote:



The subnet is empty because you don't have any subnets (the mask is



set to 32 and therefore you have full IP matching). Is the message



source IP in the address_dump?





Regards,



Ovidiu Sas





--



VoIP Embedded, Inc.



http://www.voipembedded.com





On Thu, Feb 2, 2012 at 11:52 AM, Duane Larson duane.lar...@gmail.com>  
wrote:



> This is what I see



>



> Proxy01:/var/log# opensipsctl fifo address_dump



> 15



> 20



> 34



> 50



> 63



> 85



> Proxy01:/var/log#



> Proxy01:/var/log#



> Proxy01:/var/log#



> Proxy01:/var/log#



> Proxy01:/var/log# opensipsctl fifo subnet_dump



>



>



> So the subnet_dump is empty.



>



>



>



>


> On Thu, Feb 2, 2012 at 10:48 AM, Ovidiu Sas o...@voipembedded.com>  
wrote:



>>



>> Check the in memory cache:


>>  
http://www.opensips.org/html/docs/modules/devel/permissions.html#id293903



>> See "address_dump" and "subnet_dump".



>>



>> At start up, opensips will cache everything in memory.



>>



>> Regards,



>> Ovidiu Sas



>>



>> --



>> VoIP Embedded, Inc.



>> http://www.voipembedded.com



>>



>>



>> On Thu, Feb 2, 2012 at 11:38 AM, duane.lar...@gmail.com> wrote:


>> > I just upgraded my b2bua opensips server to the latest trunk version  
and



>> > now



>> > my if statements using "check_source_address" from the permissions



>> > module



>> > isn't working. I have the following set up



>> >



>> > loadmodule "permissions.so"



>> >


>> >  
modparam("permissions","db_url","mysql://adfasdf:dfasdf...@108.xxx.xxx.xxx/opensips")



>> >



>> >



>> > if (check_source_address("2") || check_source_address("3") ||



>> > check_source_address("4")) {



>> >


>> > The INVITE comes from my SIP Proxy and worked before the upgrade  
without



>> > issue



>> >



>> >



>> >



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:check_src_addr_3: Looking for :
>> > 5060,



>> > 1> in tables



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:


>> > DBG:permissions:hash_match: specified group does not exist in hash  
table



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:match_subnet_table: subnet table is empty



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:check_src_addr_3: Looking for :
>> > 5060,



>> > 1> in tables



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:


>> > DBG:permissions:hash_match: specified group does not exist in hash  
table



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:match_subnet_table: subnet table is empty



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:check_src_addr_3: Looking for :
>> > 5060,



>> > 1> in tables



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:


>> > DBG:permissions:hash_match: specified group does not exist in hash  
table



>> > Feb 1 22:41:01 proxy01 /usr/local/sbin/opensips[30163]:



>> > DBG:permissions:match_subnet_table: subnet table is empty



>> >



>> >



>> >



>> >



>> > This is what I have in the database



>> > Proxy01:/var/log# opensipsctl db show address



>> >


>> >  
+-+-++--+--+---+-+--+



>> > | id | grp | ip | mask | port | proto | pattern | context_info |



>> >


>> >  
+-+-++--+--+---+-+--+



>> > | 3 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |



>> > | 258 | 4 | 64.XXX.XXX.15 | 32 | 5060 | any | NULL | NULL |



>> > | 1 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |



>> > | 2 | 10 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |



>> > | 257 | 3 | 173.XXX.XXX.XXX | 32 | 5060 | any | NULL | NULL |



>> > | 4 | 2 | 216.XXX.XXX.202 | 32 | 5060 | any | NULL | NULL |



>> >


>> >  
+-+-++--+--+---+-+--+



>> >



>> >



>> >


>> > I am not sure if OpenSIPS is really querying the mysql database  
because



>> > I



>> > don't really see any connections from the server when a call is made.



>> > How


>> > could this be possible? When I start OpenSIPS I see that it talks to  
the



>> > database.



>> > ___



>> > Users mailing list



>> > Users@lists.opensips.org



>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users



>> >



>>



>> _

[OpenSIPS-Users] dispatcher problem

2012-02-02 Thread Matt Hamilton

Hi,

I'm using Opensips to dispatch to 2 servers - serverA, serverB. When one of the 
servers is down, Opensips is dispatching to the active one correctly. However, 
when both of them are Active, it's picking only one of them and ignoring the 
other; e.g.,

when serverB is down, dispatches to serverA
when serverA is down, dispatches to serverB
when both up, dispatches to serverB
while dispatching to serverA when serverB is down, if I activate serverB, all 
requests dispatched to serverB  


Here is my code:

modparam("dispatcher", "hash_pvar", "$avp(75)")


in the script, I'm setting $avp(75) to one of the following "061002", "061003", 
"061004", "061005", "061006" just before calling ds_select_dst.

$avp(75)=..
ds_select_dst("1", "7");

Any ideas why this is happening?

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


Re: [OpenSIPS-Users] dispatcher problem

2012-02-02 Thread Razvan Crainea

Hi, Matt!

Are you sure you are not using the same hashing value all the time?
If yes, can you increase your debugging level to 6 and provide more 
information? I would be looking in the opensips log for lines that 
contain the following strings: "ds_hash_pvar: Hashing " and 
"ds_select_dst: alg hash ".


Regards,

--
Ra(zvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/



On 02/02/2012 10:15 PM, Matt Hamilton wrote:

Hi,

I'm using Opensips to dispatch to 2 servers - serverA, serverB. When 
one of the servers is down, Opensips is dispatching to the active one 
correctly. However, when both of them are Active, it's picking only 
one of them and ignoring the other; e.g.,


when serverB is down, dispatches to serverA
when serverA is down, dispatches to serverB
when both up, dispatches to serverB
while dispatching to serverA when serverB is down, if I activate 
serverB, all requests dispatched to serverB



Here is my code:

modparam("dispatcher", "hash_pvar", "$avp(75)")


in the script, I'm setting $avp(75) to one of the following "061002", 
"061003", "061004", "061005", "061006" just before calling ds_select_dst.


$avp(75)=..
ds_select_dst("1", "7");

Any ideas why this is happening?

Regards,
Matt


___
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] dispatcher problem

2012-02-02 Thread Matt Hamilton

Hi Răzvan,

Yes, I'm using the same hashing values - the values I assign to the PV are also 
passed to the ds_select_dst correctly as far as I can see. Here is a typical
debug output:

DBG:dispatcher:ds_hash_pvar: Hashing "061002"!
DBG:dispatcher:ds_select_dst: alg hash [1], id [1]
DBG:dispatcher:ds_select_dst: selected [7-1/1] 
DBG:dispatcher:ds_select_dst: using entry [1/0]


I ran some test with 3 Asterisk servers with interesting results:

With 3 Asterisk servers specified in dispatcher.list, here is the distribution:

Server1: 061003
Server2: 061002, 061007, 061008
Server3: 061005, 061006

With only Server1 and Server2 specified in dispatcher.list:

Server1: 
Server2: 061002, 061003, 061005, 061006, 61007, 061008


Likewise, with Server1 and Server3, Server3 gets everything.
  with Server2 and Server3, Server3 gets everything.

Is there anything I can do to fix this (somehow trick the function assuming the 
way I do is the correct way)?

Thanks,
Matt

 





Date: Thu, 2 Feb 2012 22:51:46 +0200
From: razvancrai...@opensips.org
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] dispatcher problem


  



  
  
Hi, Matt!



Are you sure you are not using the same hashing value all the time?

If yes, can you increase your debugging level to 6 and provide more
information? I would be looking in the opensips log for lines that
contain the following strings: "ds_hash_pvar: Hashing " and
"ds_select_dst: alg hash ".



Regards,

-- 
Răzvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/




On 02/02/2012 10:15 PM, Matt Hamilton wrote:

  
  
Hi,



I'm using Opensips to dispatch to 2 servers - serverA, serverB.
When one of the servers is down, Opensips is dispatching to the
active one correctly. However, when both of them are Active,
it's picking only one of them and ignoring the other; e.g.,



when serverB is down, dispatches to serverA

when serverA is down, dispatches to serverB

when both up, dispatches to serverB

while dispatching to serverA when serverB is down, if I activate
serverB, all requests dispatched to serverB  





Here is my code:



modparam("dispatcher", "hash_pvar", "$avp(75)")





in the script, I'm setting $avp(75) to one of the following
"061002", "061003", "061004", "061005", "061006" just before
calling ds_select_dst.



$avp(75)=..

ds_select_dst("1", "7");



Any ideas why this is happening?



Regards,

Matt

  
  

  
  

  ___
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] dispatcher problem

2012-02-02 Thread Razvan Crainea

Hi, Matt!

So for different hashed strings like:

DBG:dispatcher:ds_hash_pvar: Hashing "061002"!

you always get the same output:

DBG:dispatcher:ds_select_dst: alg hash [1], id [1]


Also, are you assigning different weights for any of the Asterisk?

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/



On 02/03/2012 12:16 AM, Matt Hamilton wrote:

Hi Ra(zvan,

Yes, I'm using the same hashing values - the values I assign to the PV are also
passed to the ds_select_dst correctly as far as I can see. Here is a typical
debug output:

DBG:dispatcher:ds_hash_pvar: Hashing "061002"!
DBG:dispatcher:ds_select_dst: alg hash [1], id [1]
DBG:dispatcher:ds_select_dst: selected [7-1/1]
DBG:dispatcher:ds_select_dst: using entry [1/0]


I ran some test with 3 Asterisk servers with interesting results:

With 3 Asterisk servers specified in dispatcher.list, here is the distribution:

Server1: 061003
Server2: 061002, 061007, 061008
Server3: 061005, 061006

With only Server1 and Server2 specified in dispatcher.list:

Server1:
Server2: 061002, 061003, 061005, 061006, 61007, 061008


Likewise, with Server1 and Server3, Server3 gets everything.
   with Server2 and Server3, Server3 gets everything.

Is there anything I can do to fix this (somehow trick the function assuming the 
way I do is the correct way)?

Thanks,
Matt








Date: Thu, 2 Feb 2012 22:51:46 +0200
From: razvancrai...@opensips.org
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] dispatcher problem

Hi, Matt!

Are you sure you are not using the same hashing value all the time?
If yes, can you increase your debugging level to 6 and provide more 
information? I would be looking in the opensips log for lines that 
contain the following strings: "ds_hash_pvar: Hashing " and 
"ds_select_dst: alg hash ".


Regards,
--
Ra(zvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/


On 02/02/2012 10:15 PM, Matt Hamilton wrote:

Hi,

I'm using Opensips to dispatch to 2 servers - serverA, serverB.
When one of the servers is down, Opensips is dispatching to the
active one correctly. However, when both of them are Active, it's
picking only one of them and ignoring the other; e.g.,

when serverB is down, dispatches to serverA
when serverA is down, dispatches to serverB
when both up, dispatches to serverB
while dispatching to serverA when serverB is down, if I activate
serverB, all requests dispatched to serverB


Here is my code:

modparam("dispatcher", "hash_pvar", "$avp(75)")


in the script, I'm setting $avp(75) to one of the following
"061002", "061003", "061004", "061005", "061006" just before
calling ds_select_dst.

$avp(75)=..
ds_select_dst("1", "7");

Any ideas why this is happening?

Regards,
Matt


___
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] dispatcher problem

2012-02-02 Thread Matt Hamilton

Hi Răzvan,

I don't assign any weights, and I use the dispatcher.list file:
1 sip:x.x.x.11:5060
1 sip:x.x.x.12:5060
1 sip:x.x.x.13:5060


When there are only 2 servers in that file, I always get:
DBG:dispatcher:ds_select_dst: alg hash [1], id [1] and dispatcher selects the 
2nd entry.

When there are 3 servers - when the dispatcher distributes to all 3 servers, I 
get


DBG:dispatcher:ds_select_dst: alg hash [0], id [0]  before it dispatches to 
server1 (x.x.x.11)
DBG:dispatcher:ds_select_dst: alg hash [1], id [1] for 
x.x.x.12DBG:dispatcher:ds_select_dst: alg hash [2], id [2] for x.x.x.13



Anyway I did some more tests, and it turns out that the hash algorithm is very 
sensitive to the PV. 

1. when the input hash_pvar is from this set (my original set that gave me 
problems): "061002"  "061003"  "061005"  "061006"  "61007"  "061008"
Dispatcher splits them:
Server1: 0
server2: 6

2. if I add a 1 in front of my hash PV - so that the new values are 1"061002", 
etc.  (indentation mark is part of the string)
Server1: 2
Server2: 4

3. If I add another character, so that PVs look like x1"061002"
Server1: 3
Server2: 3

3-3 or 2-4 split is OK of course, but the 0-6 split threw me off. Is there a 
"safe" PV (integers, certain combinations, etc.) that I can use that will give 
me the best distribution? I can use a lookup table (like dialplan) to get those.

Thanks,
Matt








Date: Fri, 3 Feb 2012 00:36:37 +0200
From: razvancrai...@opensips.org
To: users@lists.opensips.org
Subject: Re: [OpenSIPS-Users] dispatcher problem


  



  
  
Hi, Matt!



So for different hashed strings like:

DBG:dispatcher:ds_hash_pvar: Hashing "061002"!
you always get the same output:

DBG:dispatcher:ds_select_dst: alg hash [1], id [1]


Also, are you assigning different weights for any of the Asterisk?



Regards,

-- 
Răzvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/




On 02/03/2012 12:16 AM, Matt Hamilton wrote:

  
  
Hi Răzvan,

Yes, I'm using the same hashing values - the values I assign to the PV are also 
passed to the ds_select_dst correctly as far as I can see. Here is a typical
debug output:

DBG:dispatcher:ds_hash_pvar: Hashing "061002"!
DBG:dispatcher:ds_select_dst: alg hash [1], id [1]
DBG:dispatcher:ds_select_dst: selected [7-1/1] 
DBG:dispatcher:ds_select_dst: using entry [1/0]


I ran some test with 3 Asterisk servers with interesting results:

With 3 Asterisk servers specified in dispatcher.list, here is the distribution:

Server1: 061003
Server2: 061002, 061007, 061008
Server3: 061005, 061006

With only Server1 and Server2 specified in dispatcher.list:

Server1: 
Server2: 061002, 061003, 061005, 061006, 61007, 061008


Likewise, with Server1 and Server3, Server3 gets everything.
  with Server2 and Server3, Server3 gets everything.

Is there anything I can do to fix this (somehow trick the function assuming the 
way I do is the correct way)?

Thanks,
Matt

 









  Date: Thu, 2 Feb 2012 22:51:46 +0200

  From: razvancrai...@opensips.org

  To: users@lists.opensips.org

  Subject: Re: [OpenSIPS-Users] dispatcher problem

  

  
  
  Hi, Matt!

  

  Are you sure you are not using the same hashing value all the
  time?

  If yes, can you increase your debugging level to 6 and provide
  more information? I would be looking in the opensips log for
  lines that contain the following strings: "ds_hash_pvar:
  Hashing " and "ds_select_dst: alg hash ".

  

  Regards,

  -- 
Răzvan Crainea
OpenSIPS Developer
http://opensips-solutions.org/
  

  

  On 02/02/2012 10:15 PM, Matt Hamilton wrote:
  

 Hi,

  

  I'm using Opensips to dispatch to 2 servers - serverA,
  serverB. When one of the servers is down, Opensips is
  dispatching to the active one correctly. However, when
  both of them are Active, it's picking only one of them and
  ignoring the other; e.g.,

  

  when serverB is down, dispatches to serverA

  when serverA is down, dispatches to serverB

  when both up, dispatches to serverB

  while dispatching to serverA when serverB is down, if I
  activate serverB, all requests dispatched to serverB  

  

  

  Here is my code:

  

  modparam("dispatcher", "hash_pvar", "$avp(75)")

  

  

  in the script, I'm setting $avp(75) to one of the
  following "061002", "061003", "061004", "061005", "061006"
  just before calling ds_select_dst.

  

  $avp(75)=..

  ds_select_dst("1", "7");