Asterisk sip realtime not working


#1

I have configured it as best i can given the lacking docs. When i put in realtime mysql status i get connected and a time as shown below:

Connected to asterisk@localhost, port 3306 with username astadmin for 7 minutes, 4 seconds.

when i try realtime load sip_2 name 101 i get the following:
voip*CLI> realtime load sip_2 id 1
No rows found matching search criteria.

if i do a mysql query at the mysql client it get the info as shown below:
±—±-----±------------±---------±----------±---------±------------±---------±----------±---------±---------±-----------±-------------±--------±---------±---------±--------±----------±----±-----±-------±-----±------------±-----±--------±------------±-----------±---------------±-------±-------±---------±---------±--------------±------------±-----------±-------±---------±---------------±-------+
| id | name | accountcode | amaflags | callgroup | callerid | canreinvite | context | defaultip | dtmfmode | fromuser | fromdomain | fullcontact | host | insecure | language | mailbox | md5secret | nat | deny | permit | mask | pickupgroup | port | qualify | restrictcid | rtptimeout | rtpholdtimeout | secret | type | username | disallow | allow | musiconhold | regseconds | ipaddr | regexten | cancallforward | setvar |
±—±-----±------------±---------±----------±---------±------------±---------±----------±---------±---------±-----------±-------------±--------±---------±---------±--------±----------±----±-----±-------±-----±------------±-----±--------±------------±-----------±---------------±-------±-------±---------±---------±--------------±------------±-----------±-------±---------±---------------±-------+
| 1 | 101 | 101 | NULL | NULL | 101 | | internal | NULL | NULL | 101 | NULL | Greg Kennedy | dynamic | NULL | NULL | 101 | NULL | | NULL | NULL | NULL | NULL | | 100 | NULL | NULL | NULL | md5 | friend | 101 | all | gsm;alaw;ulaw | NULL | 0 | | | yes | |
±—±-----±------------±---------±----------±---------±------------±---------±----------±---------±---------±-----------±-------------±--------±---------±---------±--------±----------±----±-----±-------±-----±------------±-----±--------±------------±-----------±---------------±-------±-------±---------±---------±--------------±------------±-----------±-------±---------±---------------±-------+
1 row in set (0.00 sec)

I can not figure out whats wrong with it. I have set my extconfig as follows:
sipusers => mysql,asterisk,sip_2
sippeers => mysql,asterisk,sip_2

and my res_config_mysql.conf as follows:
[general]
dbhost = localhost
dbname = asterisk
dbuser = astadmin
dbpass = ********
dbport = 3306
dbsock = /tmp/mysqld.sock

here are my tables:
±-------------------+
| Tables_in_asterisk |
±-------------------+
| cdr |
| extensions_ps |
| faxtoemail |
| sip_2 |
| sip_ps |
±-------------------+

and the sip_2 table:±---------------±-------------±-----±----±------------------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±---------------±-------------±-----±----±------------------------±---------------+
| id | int(11) | | PRI | NULL | auto_increment |
| name | varchar(80) | | UNI | | |
| accountcode | varchar(20) | YES | | NULL | |
| amaflags | varchar(13) | 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 | |
| setvar | varchar(100) | | | | |
±---------------±-------------±-----±----±------------------------±---------------+

Any help would be appreciated.

Thanks,

Greg


#2

I have been looking at this all morning and still ca not figure it out. I can query the mysql table from teh mysql client no problem and return results, yet realtime load returns no rows.

I am sure others have ahd this problem but I can not find an answer in the forums here. Anybody got any ideas?


#3

Hi,

I’ve got the same problem, my version of asterisk is 1.2.7.1.

Regards,
Sylvain


#4

I believe you can actually do a query from the Asterisk CLI to test with, unless that is what the load command is doing. Also, I know you cannot show the sip users available when using realtime.

—Mike