Asterisk Realtime Configuration Problem

Hi all,

Recently i configured asterisk Realtime with my asterisk 11.6.0 server.I enabled addons and i done the changes in res_odbc.conf,odbc.ini file,sip.conf,extconfig.conf and i installed Unix-odbc drivers and mysql drivers also.When i run REALTIME MYSQL STATUS in cli mode it is showing the message like this.

general connected to asterisk@127.0.0.1, port 3306 with username asterisk for 1 hours, 29 minutes.

i configured new databses with all tables means sip_buddies,queue_table and e.t.c.I add users in sip_buddies table.But the users are not showing in CLI mode and users are not registering in softphone.Can any one pls help me to get out of this problem.My complete configurations file are below.

/etc/odbc.ini
[asterisk-connector]
Description = MySQL connection to ‘asterisk’ database
Driver = MySQL
Database = asterisk
Server = localhost
UserName = uname
Password = pw
Port = 3306
Socket = /var/lib/mysql/mysql.sock

res_config_mysql.conf
[general]
dbhost = 127.0.0.1
dbname = asterisk
dbuser = uname
dbpass = PW
dbport = 3306

extconfig.conf

[settings]
sippeers => odbc,general,sip_buddies
extensions => odbc,general,extensions
voicemail => odbc,general,voicemail_users
queues => odbc,general,queue_table
queue_members => odbc,general,queue_member_table
meetme => odbc,general,meetme

sip.conf

[general]
context=from-sip
disallow=all
allow=ulaw
allow=alaw

Sip_buddies Table

±---------------±-------------±-----±----±------------------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±---------------±-------------±-----±----±------------------------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(80) | NO | UNI | NULL | |
| callerid | varchar(80) | YES | | NULL | |
| defaultuser | varchar(80) | NO | | NULL | |
| regexten | varchar(80) | NO | | NULL | |
| secret | varchar(80) | YES | | NULL | |
| mailbox | varchar(50) | YES | | NULL | |
| accountcode | varchar(20) | YES | | NULL | |
| context | varchar(80) | YES | | NULL | |
| amaflags | varchar(7) | YES | | NULL | |
| callgroup | varchar(10) | YES | | NULL | |
| canreinvite | char(3) | YES | | yes | |
| 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) | NO | | NULL | |
| insecure | varchar(4) | YES | | NULL | |
| language | char(2) | YES | | NULL | |
| md5secret | varchar(80) | YES | | NULL | |
| nat | varchar(5) | NO | | no | |
| deny | varchar(95) | YES | | NULL | |
| permit | varchar(95) | YES | | NULL | |
| mask | varchar(95) | YES | | NULL | |
| pickupgroup | varchar(10) | YES | | NULL | |
| port | varchar(5) | NO | | NULL | |
| qualify | char(3) | YES | | NULL | |
| restrictcid | char(1) | YES | | NULL | |
| rtptimeout | char(3) | YES | | NULL | |
| rtpholdtimeout | char(3) | YES | | NULL | |
| type | varchar(6) | NO | | friend | |
| disallow | varchar(100) | YES | | all | |
| allow | varchar(100) | YES | | g729;ilbc;gsm;ulaw;alaw | |
| musiconhold | varchar(100) | YES | | NULL | |
| regseconds | int(11) | NO | | 0 | |
| ipaddr | varchar(15) | NO | | NULL | |
| cancallforward | char(3) | YES | | yes | |
| lastms | int(11) | NO | | NULL | |
| useragent | char(255) | YES | | NULL | |
| regserver | varchar(100) | YES | | NULL | |
±---------------±-------------±-----±----±------------------------±---------------+
I am not getting clearly whats the problem i done in this configurations.Can any one please help me to solve this problem.

Thanks & Regards,
Vishnu

Whilst I don’t use realtime, I can’t see any error messages, or any other problem description, in your question.

Hi, Thanks for response I configured Asterisk realtime SIP in asterisk 11.0.6 server,but users are not registering in the softphone, which i entered the users in the ASterisk Realtime DB under the SIP_buddies table.And users are not showing in the Asterisk CLI mode when i run sip show peers.
This is the problem.

If you run the command: sip show peer load
Asterisk show an error?

No, i am not getting any error message

Hope, this scheme will be useful for those, who implement realtime.
This is for ODBC connection.

You should use not res_config_mysql.conf, but res_odbc.conf instead, as you’ve mentioned in extconfig.conf that you use ODBC:

[settings] sippeers => odbc,general,sip_buddies

So, configure res_odbc.conf or just set the correct connector in extconfig.conf, something like:

[settings] sippeers => mysql,general,sip_buddies

If you decide to configure res_odbc.conf, it must look something like this (just write your dsn and login/pass, according to the image I posted here):

[astertest]
enabled => yes
dsn => asterisk-test
username => dblogin
password => dbpass
pre-connect => yes
backslash_is_escape => no

You also need to preload res_odbc.so, in case of disabled module’s autoloading (or maybe always, I’m not sure).

I have a lovely overview Asterisk Realtime configuration for PJSIP in Asterisk 12 here - wiki.asterisk.org/wiki/display/ … P+Realtime

Hi Lexus,

Thanks for quick response i got solved my problem every thing working fine now,and sorry for my slow response.

Regards,
Vishnu