Carlos Chavez
2007-Sep-07 17:44 UTC
[asterisk-users] Asterisk + Realtime + Manager reload = crash
I have several installations of Asterisk (several versions) where we have our own web interface that uses Mysql and Realtime. When we do modifications to Mysql we use a Manager connection in order to reload the configuration (we use Realtime static for extensions) sometimes Asterisk will crash. Not every time and not every X times we reload. Sometimes it takes ten reloads and other just one before it crashes. I use a simple function in php to do the reload: function reload_conf ( $conf ) { $socket = fsockopen("localhost","5038", $errno, $errstr, $timeout); fputs($socket, "Action: Login\r\n"); fputs($socket, "UserName: user\r\n"); fputs($socket, "Secret: password\r\n\r\n"); fputs($socket, "Action: Command\r\n"); switch ($conf) { case "sip": fputs($socket, "Command: sip reload\r\n\r\n"); break; case "ext": fputs($socket, "Command: dialplan reload\r\n\r \n"); break; case "iax2": fputs($socket, "Command: iax2 reload\r\n\r\n"); break; case "agent": fputs($socket, "Command: module reload chan_agent.so\r\n\r\n"); break; case "todo": fputs($socket, "Command: reload\r\n\r\n"); break; default: fputs($socket, "Command: dialplan reload\r\n\r \n"); } fclose($socket); } Why would asterisk crash after reloading the dialplan? -- Telecomunicaciones Abiertas de M?xico S.A. de C.V. Carlos Ch?vez Prats Director de Tecnolog?a +52-55-91169161 ext 2001 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070907/419bdc32/attachment.pgp
On 9/7/07, Carlos Chavez <cursor at telecomabmex.com> wrote:> I have several installations of Asterisk (several versions) where we > have our own web interface that uses Mysql and Realtime. When we do > modifications to Mysql we use a Manager connection in order to reload > the configuration (we use Realtime static for extensions) sometimes > Asterisk will crash. Not every time and not every X times we reload. > Sometimes it takes ten reloads and other just one before it crashes. I > use a simple function in php to do the reload:Why don't you move to "real" realtime.. IMHO it doesn't take so much resources, as mysql is fast, especially if you have predictable queries for which you can create indexes.. It's almost as reading from memory. Regards, Atis -- Atis Lezdins, IT Responsible of BEST Riga, atis at BEST.eu.org ICQ: 142239285 Skype: atis.lezdins Cell Phone: +371 28806004 [Tele2, Latvia] Work phone: +1 800 7502835 [Toll free, USA] ?BEST? -> www.BEST.eu.org