[OpenSER-Users] Fwd: Version table
Bård Aase
bard at aase.name
Wed May 7 11:20:23 CEST 2008
On Wed, May 7, 2008 at 10:30 AM, Henning Westerholt
<henning.westerholt at 1und1.de> wrote:
> On Wednesday 07 May 2008, Bård Aase wrote:
> > I am trying to switch from SER to OpenSER, and I'm using mysql for
> > data storage. Asterisk's sip_buddies table is supposed to contain
> > authentication data.
> > The configuration is set up, the openser database is appearantly set
> > up and working, but when I try to authenticate against
> > asterisk.sip_buddies i get the following errors:
> >
> > May 6 12:36:58 [25672] ERROR:auth_db:auth_fixup: invalid table
> > version (use openser_mysql.sh reinstall)
> > [..]
>
> >
> > The version tables in asterisk and openser is as follows:
> > SELECT * FROM asterisk.`version`
> > 5
> > SELECT * FROM openser.`version`
> > 6
> >
> > What is the differences between database version 5 and 6?
> >
> > Since the asterisk database is shared between multiple asterisks and
> > SER instances, its not trivial to upgrade the tables if that would
> > have implications on asterisk and/or ser
>
> Hi Bård,
>
> OpenSER checks on startup during the fixup process of the config script that
> the table version is correct. This version data is read from the
> openser.version table. The auth_db module uses normally the 'subscriber'
> table, thus its expect the table version entry under the same name.
>
> from trunk: select table_version from version where table_name='subscriber';
> -> 6
>
> If the asterisk.sip_buddies table has the correct format (compare against a
> fresh DB setup with your OpenSER version), then it should be sufficient to
> add a entry with the correct version number (check in auth_db
> source, 'VERSION') in the version table, or just remove the check from the
> source code. To get the differences you could also just setup a fresh
> installation of the DB, and use the usual tools to show the table
format. For
> more information you should provide the OpenSER version you use, and the
> table format of the table you authenticate against.
Thanks, I will check this out now, I'm using OpenSER 1.3.1 and the
sip_buddies table looks like this:
+--------------------+------------------+------+-----+-------------------------+-------+
| Field | Type | Null | Key | Default
| Extra |
+--------------------+------------------+------+-----+-------------------------+-------+
| name | varchar(80) | | PRI |
| |
| accountcode | varchar(20) | YES | | NULL
| |
| secret | varchar(80) | YES | | NULL
| |
| type | varchar(6) | | | friend
| |
| username | varchar(80) | | |
| |
| amaflags | varchar(7) | YES | | DEFAULT
| |
| callgroup | varchar(10) | YES | | NULL
| |
| callerid | varchar(80) | YES | | NULL
| |
| canreinvite | varchar(3) | YES | | yes
| |
| context | varchar(80) | YES | | NULL
| |
| defaultip | varchar(15) | YES | | NULL
| |
| dtmfmode | varchar(7) | YES | | NULL
| |
| fromuser | varchar(80) | YES | | NULL
| |
| fromdomain | varchar(80) | YES | | NULL
| |
| host | varchar(31) | | | dynamic
| |
| incominglimit | int(2) | YES | | NULL
| |
| outgoinglimit | int(2) | YES | | NULL
| |
| insecure | varchar(4) | YES | | NULL
| |
| language | varchar(2) | YES | | NULL
| |
| mailbox | varchar(50) | YES | | NULL
| |
| md5secret | varchar(80) | YES | | NULL
| |
| nat | varchar(8) | | | yes
| |
| permit | varchar(95) | YES | | NULL
| |
| deny | varchar(95) | YES | | NULL
| |
| mask | varchar(95) | YES | | NULL
| |
| pickupgroup | varchar(10) | YES | | NULL
| |
| port | varchar(5) | | |
| |
| qualify | varchar(8) | YES | | NULL
| |
| mobilenumber | varchar(16) | | |
| |
| restrictcid | char(1) | YES | | NULL
| |
| rtptimeout | varchar(3) | YES | | NULL
| |
| rtpholdtimeout | varchar(3) | YES | | NULL
| |
| allow | varchar(100) | YES | |
g729;ilbc;gsm;ulaw;alaw | |
| disallow | varchar(100) | YES | | all
| |
| musiconhold | varchar(100) | YES | | NULL
| |
| regseconds | int(11) | | | 0
| |
| ipaddr | varchar(15) | | MUL |
| |
| cancallforward | varchar(3) | YES | | yes
| |
| fullcontact | varchar(80) | YES | | NULL
| |
| domain | varchar(128) | YES | | UNDISCLOSED
| |
| ha1b | varchar(128) | YES | |
| |
| rpid | varchar(255) | YES | |
| |
| trustrpid | enum('YES','NO') | | | NO
| |
+--------------------+------------------+------+-----+-------------------------+-------+
The openser.cfg configuration for auth_db:
loadmodule "auth_db.so"
# -- auth_db params --
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "user_column", "name")
modparam("auth_db", "domain_column", "domain")
modparam("auth_db", "password_column", "secret")
modparam("auth_db", "password_column_2", "ha1b")
modparam("auth_db", "use_domain", 0)
modparam("auth_db", "db_url",
"mysql://UNDISCLOSED:UNDISCLOSED@UNDISCLOSED/asterisk")
All the fields referred to here exists in the asterisk.sip_buddies
table, so my guess now is that this is just a matter of disabling the
version check, or bumping the version number.
--
Bård Aase
gTalk/Jabber: elzapp at elzapp.com MSN: msn at elzapp.com
http://blog.elzapp.com
More information about the sr-users
mailing list