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
 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________

Sign up now for AstriCon 2007!  September 25-28th.  http://www.astricon.net/ 

--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to