AGI Vorlage zum starten
Aus metasec wiki
Version vom 17. Oktober 2009, 13:04 Uhr von Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „<pre> #!/usr/bin/php4 -q <?php →some zphone specific includes: // main config file //include_once("/var/www/zphone/etc/config.inc.php"); // main file fo…“)
#!/usr/bin/php4 -q <?php /* some zphone specific includes */ // main config file //include_once("/var/www/zphone/etc/config.inc.php"); // main file for doing any sql lookups //include($CCBOX["INC"]."func_sql.inc.php"); // some other zAPI files //include($CCBOX["INC"]."func_voip.inc.php"); $in = fopen("php://stdin", "r" ); $err = fopen("php://stderr", "r" ); /* asterisk pass some values via stdin to the agi script. format is key: vale just get the values and extact them into an array named $agivars with key value index */ $agivars = array(); while (!feof($in)) { $agivar = trim(fgets($in)); if ($agivar === '') break; $agivar = explode(':', $agivar); $agivars[$agivar[0]] = trim($agivar[1]); } /* this is needed if executing via DeadAGI dialplan app */ pcntl_signal(SIGHUP, SIG_IGN); /* hier kommt der code hin, den man verwenden will wenn man die richtigen includes im kopf definiert, stehen einem alle zphone internen funktionen zur verfuegung paste here your code you want to use if you include the needed/right files in the header of this file, you are able to user all of the internal zphone functions form the zAPI */ /* print("noop just an info...\n"); print("set varialble Z_AGI_TEST hallo\n"); */ fclose($in); fclose($err); return 0; ?>