Trouble with asterisk Realtime configuration


#1

I’m using Asterisk@Home, and I’m trying to get the MySQL Realtime configuration working, without any luck. According to voip-info.org/wiki/view/Asterisk+RealTime, I’m doing this right, but it still doesn’t work. (when I do ‘sip show peers’ in the asterisk console, I don’t get any of the peers in the MySQL database)

Asterisk@Home comes with the following mysql tables in the asteriskrealtime database:

mysql> show tables;
+----------------------------+
| Tables_in_asteriskrealtime |
+----------------------------+
| extensions                 |
| iax_buddies                |
| queue_member_table         |
| queue_table                |
| sip_buddies                |
| voicemail_users            |
+----------------------------+
6 rows in set (0.01 sec)

The really important tables (extensions and sip_buddies) look like this:

mysql> desc extensions;
+----------+--------------+------+-----+---------+----------------+
| Field    | Type         | Null | Key | Default | Extra          |
+----------+--------------+------+-----+---------+----------------+
| id       | int(11)      |      | MUL | NULL    | auto_increment |
| context  | varchar(20)  |      | PRI |         |                |
| exten    | varchar(20)  |      | PRI |         |                |
| priority | tinyint(4)   |      | PRI | 0       |                |
| app      | varchar(20)  |      |     |         |                |
| appdata  | varchar(128) |      |     |         |                |
+----------+--------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)

mysql> desc sip_buddies;
+----------------+--------------+------+-----+-------------------------+----------------+
| Field          | Type         | Null | Key | Default                 | Extra          |
+----------------+--------------+------+-----+-------------------------+----------------+
| id             | int(11)      |      | PRI | NULL                    | auto_increment |
| name           | varchar(80)  |      | UNI |                         |                |
| accountcode    | varchar(20)  | YES  |     | NULL                    |                |
| amaflags       | varchar(7)   | YES  |     | NULL                    |                |
| callgroup      | varchar(10)  | YES  |     | NULL                    |                |
| callerid       | varchar(80)  | YES  |     | NULL                    |                |
| canreinvite    | char(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                    |                |
| fullcontact    | varchar(80)  | YES  |     | NULL                    |                |
| host           | varchar(31)  |      |     |                         |                |
| insecure       | varchar(4)   | YES  |     | NULL                    |                |
| language       | char(2)      | YES  |     | NULL                    |                |
| mailbox        | varchar(50)  | YES  |     | NULL                    |                |
| md5secret      | varchar(80)  | YES  |     | NULL                    |                |
| nat            | varchar(5)   |      |     | no                      |                |
| deny           | varchar(95)  | YES  |     | NULL                    |                |
| permit         | varchar(95)  | YES  |     | NULL                    |                |
| mask           | varchar(95)  | YES  |     | NULL                    |                |
| pickupgroup    | varchar(10)  | YES  |     | NULL                    |                |
| port           | varchar(5)   |      |     |                         |                |
| qualify        | char(3)      | YES  |     | NULL                    |                |
| restrictcid    | char(1)      | YES  |     | NULL                    |                |
| rtptimeout     | char(3)      | YES  |     | NULL                    |                |
| rtpholdtimeout | char(3)      | YES  |     | NULL                    |                |
| secret         | varchar(80)  | YES  |     | NULL                    |                |
| type           | varchar(6)   |      |     | friend                  |                |
| username       | varchar(80)  |      |     |                         |                |
| disallow       | varchar(100) | YES  |     | all                     |                |
| allow          | varchar(100) | YES  |     | g729;ilbc;gsm;ulaw;alaw |                |
| musiconhold    | varchar(100) | YES  |     | NULL                    |                |
| regseconds     | int(11)      |      |     | 0                       |                |
| ipaddr         | varchar(15)  |      |     |                         |                |
| regexten       | varchar(80)  |      |     |                         |                |
| cancallforward | char(3)      | YES  |     | yes                     |                |
+----------------+--------------+------+-----+-------------------------+----------------+
38 rows in set (0.00 sec)

And this is the contents of my extconfig.conf:

[settings]
sipusers => mysql,asteriskrealtime,sip_buddies
sippeers => mysql,asteriskrealtime,sip_buddies
extensions => mysql,asteriskrealtime,extensions

#2

you’re not supposed to see any peers when you do a sip show peers. that console command does NOT trigger a sql query to check what’s in the database.

A good way to check if it’s working is to set ipaddr=‘NULL’ for all records in sip_peers table (e.g. update asterisk.sip_peers set ipaddr=NULL;), then see if IP addresses get set following endpoint registration with Asterisk. (e.g. select name,ipaddr from asterisk.sip_peers;)

Also you can connect to console with “asterisk -rvvvvvv” etc. to increase level of verbosity, and you should see something like “seeding sip peers in the database” when an endpoint registers and Asterisk does a sql update into the database with the ipaddr.

regards,
scott


#3

Ah, thank you, that helped a lot. I can tell just by setting up an ATA, and it’s working from the configuration in the database. :smile: