[Asterisk-Users] IAX2 peers via MySQL DB with Asterisk 1.0.2

Bastian Schern ml01 at in-bln.de
Thu Nov 18 07:14:41 MST 2004


Does nobody else has got this Problem?
Or does nobody know how it should be fixed? ;-)

Bastian Schern schrieb:
> Hi all,
> 
> I try to get the IAX2 peers from a MySQL DB. But this will not work. I'm 
> working with Asterisk 1.0.2.
> First I had enabled MYSQL_FRIENDS in the channels Makefile, then I had 
> created the user "asterisk", the database "asterisk" and the table 
> "iaxfriends" inside my MySQL server (modelled on 
> http://www.voip-info.org/wiki-Asterisk+sip+mysql+peers).
> 
> I add this to my iax.conf:
> --- snip ---
> dbname=asterisk     ; Name of database in your MySQL server
> dbhost=localhost    ; Hostname of server
> dbuser=asterisk     ; Username in MySQL
> dbpass=123456       ; Password for user in MySQL
> --- snap ---
> 
> 
> A added the User as following:
> 
> mysql> INSERT INTO `iaxfriends` ( `name` , `secret` , `context` , 
> `ipaddr` , `port` , `regseconds` ) VALUES (
>     'bastian', '123456', 'default', '', '0', '0'
> );
> 
> 
> After that I start my Asterisk without problems, but the peers defined 
> in the "iaxfriends" table are not working':
> 
> SP2106*CLI> iax2 show peers
> Name/Username    Host                 Mask             Port      Status
> 
> 
> If a IAX-Client tries to connect it will produce this message:
> --- snip ---
>     -- Unregistered 'bastian' (AUTHENTICATED)
> --- snap ---
> 
> 
> If I try to dial from the client I will get this on the Asterisk console:
> --- snip ---
> Nov 16 20:30:00 NOTICE[1092774832]: chan_iax2.c:5402 socket_read: 
> Rejected connect attempt from 212.202.169.118
> --- snap ---
> 
> 
> But inside the DB-Table it looks like the client is registered:
> mysql> SELECT * FROM iaxfriends;
> +---------+--------+---------+-----------------+------+------------+
> | name    | secret | context | ipaddr          | port | regseconds |
> +---------+--------+---------+-----------------+------+------------+
> | bastian | r2dzwo | default | 212.202.169.118 | 4569 | 1100655488 |
> +---------+--------+---------+-----------------+------+------------+
> 1 row in set (0.00 sec)
> 
> 
> What is wrong?
> 
> Regards
>     Bastian
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list