Core Dump using Realtime

Hi folks,

First of all, I have to say that I’m quite new to Linux and also Asterisk. My problem is with realtime configuration. Here I provide some details of my deployment:

  • Asterisk Version: 1.2.9.1
  • Asterisk Addons Version: 1.2.3
  • Zaptel Version: 1.2.6
  • Libpri Version: 1.2.3
  • MySQL Version: 5.0.22-standard-log
  • uname -a Output: Linux Asterisk 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux
  • cat /etc/redhat-release Output: Red Hat Enterprise Linux AS release 3 (Taroon)

My system is an IBM eServer with Intel Xeon @ 2.4 GHz and 1 GB RAM. Although the kernel version appears as “smp”, in fact, the system has only one processor.

Here is the precedure I follow to test the realtime configuration, by which I get a core dump:
1. MySQL and Asterisk are both boot-loaded by Linux. Obviously, MySQL is loaded first.
2. I connect to the Asterisk CLI
3. Check if Asterisk is connected to MySQL issueing a realtime mysql status. I get the response: Connected to asterisk@localhost, port 3306 with username asterisk for 41 seconds. That’s fine.
4. Check if Asterisk can access data of the sippeers family by issueing a realtime load mysql sippeers name 1234. I deliberately asked for 1234 because I know that there’s no entry for this name, so there’s no problem here. I get a No rows found matching search criteria reponse in the Asterisk CLI. It’s fine.
5. Here comes the problem. When I try to load an entry that really is in the database I get the core dump. The only entry in the database is for the user 205, but if I enter the command realtime load sippeers name 205 I get the following response: Segmentation fault (core dumped).

I follow this procedure only to test if the changes I made are taking effect. The first scenario in which I got the core dump was when I tried to register a client using realtime. It worths noting that I plan to use realtime for voicemail and extensions but, at this moment, I was trying first with sip friends only. Also, I have to tell that I’m already using MySQL with Asterisk to collect CDRs and there’s no problem with that.

I will appreciate any help because I feel very lost with this problem. If you need more information please tell me.
Thanks in advance for your time and atention.

As I don’t know how to attach text files here, I will paste some information that I think could be valuable. I apologize for so much text.

[size=84]MYSQL CLI
[root@Asterisk root]# mysql -u asterisk -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17 to server version: 5.0.22-standard-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use asterisk
Database changed
mysql> show tables;
±-------------------+
| Tables_in_asterisk |
±-------------------+
| cdr |
| extensions_table |
| sips |
| voicemail_users |
±-------------------+
4 rows in set (0.00 sec)

mysql> describe sips;
±------------±-------------±-----±----±--------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(80) | NO | UNI | NULL | |
| canreinvite | char(3) | YES | | yes | |
| context | varchar(80) | YES | | from-sip | |
| dtmfmode | varchar(7) | YES | | rfc2833 | |
| host | varchar(31) | NO | | dynamic | |
| language | char(2) | YES | | es | |
| mailbox | varchar(50) | YES | | NULL | |
| nat | varchar(5) | NO | | no | |
| secret | varchar(80) | YES | | 1234 | |
| type | varchar(6) | NO | | friend | |
| username | varchar(80) | NO | | NULL | |
| disallow | varchar(100) | YES | | all | |
| allow | varchar(100) | YES | | gsm;g729;alaw | |
| ipaddr | varchar(15) | NO | | NULL | |
| regseconds | int(11) | NO | | 0 | |
| port | varchar(5) | NO | | NULL | |
±------------±-------------±-----±----±--------------±---------------+
17 rows in set (0.00 sec)

mysql> select id,name,username,secret,type,context,host,nat from sips;
±—±-----±---------±-------±-------±---------±--------±----+
| id | name | username | secret | type | context | host | nat |
±—±-----±---------±-------±-------±---------±--------±----+
| 1 | 205 | 205 | none | friend | from-sip | dynamic | no |
±—±-----±---------±-------±-------±---------±--------±----+
1 row in set (0.00 sec)

mysql>

ASTERISK CLI
[root@Asterisk root]# asterisk -vvvvvvvvvvr
== Parsing ‘/etc/asterisk/asterisk.conf’: Found
== Parsing ‘/etc/asterisk/extconfig.conf’: Found
== Binding sipusers to mysql/asterisk/sips
== Binding sippeers to mysql/asterisk/sips
Asterisk 1.2.9.1, Copyright © 1999 - 2006 Digium, Inc. and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘show license’ for details.

Connected to Asterisk 1.2.9.1 currently running on Asterisk (pid = 9346)
Verbosity was 0 and is now 10
AsteriskCLI> realtime mysql status
Connected to asterisk@localhost, port 3306 with username asterisk for 41 seconds.
Asterisk
CLI> realtime load sippeers name 1234
No rows found matching search criteria.
AsteriskCLI> realtime load sippeers name 205
Asterisk
CLI>
Segmentation fault (core dumped)
[root@Asterisk root]#

LAST LINES OF /var/log/asterisk/debug WHEN I GET THE CORE DUMP
Jun 19 08:11:53 DEBUG[9358] res_config_mysql.c: MySQL RealTime: Everything is fine.
Jun 19 08:12:07 DEBUG[9358] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sips WHERE name = '1234’
Jun 19 08:12:07 DEBUG[9358] res_config_mysql.c: MySQL RealTime: Everything is fine.
Jun 19 08:12:12 DEBUG[9358] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sips WHERE name = '205’
Jun 19 08:12:12 DEBUG[9358] res_config_mysql.c: MySQL RealTime: Everything is fine.

res_mysql.conf
[general]
dbhost = localhost
dbname = asterisk
dbuser = asterisk
dbpass = mypassword
dbport = 3306
dbsock = /tmp/mysql.sock

cdr_mysql.conf
[global]
hostname=localhost
dbname=asterisk
table=cdr
password=mypassword
user=asterisk
port=3306
sock=/tmp/mysql.sock
userfield=1

extconfig.conf
sipusers => mysql,asterisk,sips
sippeers => mysql,asterisk,sips[/size]