Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Realtime device update weirdness


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
mkezys at gmail.com
Guest





PostPosted: Thu Jan 31, 2008 4:46 am    Post subject: [asterisk-users] Realtime device update weirdness Reply with quote

Hello,

We use Asterisk Realtime for our billing software. 200+ installations of Asterisk with Realtime, but I see this for the first time.

Asterisk 1.4.17, Addons 1.4.5, No patches, no NAT - just plain simple installation.
With debug I can see:

[Jan 30 22:38:21] DEBUG[27885]: res_config_mysql.c:662 mysql_reconnect: MySQL RealTime: Everything is fine.
[Jan 30 22:38:21] DEBUG[27885]: res_config_mysql.c:138 realtime_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = '109' AND host = 'dynamic'
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:662 mysql_reconnect: MySQL RealTime: Everything is fine.
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:365 update_mysql: MySQL RealTime: Update SQL: UPDATE devices SET ipaddr = '0.0.0.0', port = '0', regseconds = '0' WHERE name = '109'
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:379 update_mysql: MySQL RealTime: Updated 0 rows on table: devices
[Jan 30 22:38:21] DEBUG[27885]: res_config_mysql.c:662 mysql_reconnect: MySQL RealTime: Everything is fine.
[Jan 30 22:38:21] DEBUG[27885]: res_config_mysql.c:365 update_mysql: MySQL RealTime: Update SQL: UPDATE devices SET ipaddr = '0.0.0.0', port = '0', regseconds = '0' WHERE name = '109'
[Jan 30 22:38:21] DEBUG[27885]: res_config_mysql.c:379 update_mysql: MySQL RealTime: Updated 0 rows on table: devices
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:662 mysql_reconnect: MySQL RealTime: Everything is fine.
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:365 update_mysql: MySQL RealTime: Update SQL: UPDATE devices SET ipaddr = '213.164.10.178', port = '60854', regseconds = '1201750701' WHERE name = '109'
[Jan 30 22:38:21] DEBUG[27917]: res_config_mysql.c:379 update_mysql: MySQL RealTime: Updated 1 rows on table: devices


Notice update: UPDATE devices SET ipaddr = '0.0.0.0', port = '0', regseconds = '0' WHERE name = '109'

Correct behaviour is: UPDATE devices SET ipaddr = '213.164.10.178', port = '60854', regseconds = '1201750701' WHERE name = '109'

Why update to 0.0.0.0 is executed? It makes devices unreachable. When device reregisters - it becomes available for short time - then again - update to 0.0.0.0. Why it is happening?


For temporaly solution i had to patch res_config_mysql.c at line 342, added such lines:

if ((!strcmp(newparam, "ipaddr")) && (!strcmp(buf, "0.0.0.0"))){
ast_log(LOG_DEBUG,"MySQL RealTime: Avoided to update %s to %s !!!\n", newparam, buf);
ast_mutex_unlock(&mysql_lock);
return -1;
}


Regards/Pagarbiai,
Mindaugas Kezys
http://www.kolmisoft.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services