From: Tjardick v. d. K. <tja...@va...> - 2003-10-03 08:21:13
|
Hi Everyone, Well let me take the mike and say hi to all of you :) I started on www.vanderkraan.net/awacs/ a couple weeks ago, but i'm going to abondon that and just rather put my time in astweb as soon as Jamie is ready with his framework/first setup and allows other coders to join in. Eager to put in some php coding time for the project (been doing php since 1999), but for now i'll just sit on the sideline and wait :) Little question: What database interface is being used now ? BTW Jamie, no need to start on command line reload i've allready done a reload.php which uses the tcp 5038 manager port, which means no exec rights needed for php :) Feel free to include this reload.php in the project i need to finish it off a bit more to do error checking etc. but at least if everything is set properly it works :) Greetings, Tj <?php // $Id: reload.php,v 1.2 2003/08/30 20:24:05 tjardick Exp $ // // ---------------------------------------------------------------------- // Asterisk WebAdmin Control System // Copyright (C) 2003 by Tjardick van der Kraan // http://????? // ---------------------------------------------------------------------- // LICENSE // // The License goes here // // To read the license please visit: http://???? // ---------------------------------------------------------------------- // Filename : reload.php // Original Author : Tjardick van der Kraan tja...@va... // Purpose : Reload asterisk via manager tcp port // ---------------------------------------------------------------------- // // Set manager user, password, hostname (or ip) and timeout $manager_user = 'tjardick'; $manager_pass = 'youwish'; $manager_host = 'localhost'; $manager_time = '30'; // Setup socket to * with 30 sec timeout $manager_conn = fsockopen($manager_host,"5038", $errno, $errstr, $manager_time); // Did our connection went ok ? if (!$manager_conn) { // No spit out error echo "$errstr ($errno)<br>\n"; } else { //Yep, let's do the goodies // Login fputs($manager_conn, "Action: Login\r\n"); fputs($manager_conn, "UserName: ".$manager_user."\r\n"); fputs($manager_conn, "Secret: ".$manager_pass."\r\n\r\n"); // Send action and reload command fputs($manager_conn, "Action: Command\r\n"); fputs($manager_conn, "Command: reload\r\n\r\n"); // For now just spit out response // We'll need proper reponse parsing later // While thinking about it * could keep us connected // if lot's of phonecalls spit out info to the manager // console so skipping the wile for now too. // while (!feof($manager_conn)) { echo fgets ($manager_conn,128); //} // End connection (maybe do a proper logout later ?!!) fclose ($manager_conn); } ?> |