function phpagiconf_gen_conf() { global $active_modules; // create the tmp file in the same dir // fixes ticket:1910 $file = "/etc/asterisk/phpagi_" . rand() . ".conf"; $data = phpagiconf_get(); $content = "[phpagi]\n"; $content .= "debug=" . ($data['debug'] ? 'true' : 'false') . "\n"; $content .= "error_handler=" . ($data['error_handler'] ? 'true' : 'false') . "\n"; $content .= "admin=" . $data['err_email'] . "\n"; $content .= "hostname=" . $data['hostname'] . "\n"; $content .= "tempdir=" . $data['tempdir'] . "\n\n"; $content .= "[asmanager]\n"; $content .= "server=" . $data['asman_server'] . "\n"; $content .= "port=" . $data['asman_port'] . "\n"; $content .= "username="******"\n"; $content .= "secret=" . $data['asman_secret'] . "\n\n"; $content .= "[fastagi]\n"; $content .= "setuid=" . ($data['setuid'] ? 'true' : 'false') . "\n"; $content .= "basedir=" . $data['basedir'] . "\n\n"; $content .= "[festival]\n"; $content .= "text2wave=" . $data['festival_text2wave'] . "\n\n"; $content .= "[cepstral]\n"; $content .= "swift=" . $data['cepstral_swift'] . "\n"; $content .= "voice=" . $data['cepstral_voice'] . "\n"; $fd = fopen($file, "w"); fwrite($fd, $content); fclose($fd); if (!rename($file, "/etc/asterisk/phpagi.conf")) { echo "<script>javascript:alert('" . _("Error writing the phpagi.conf file.") . "');</script>"; } }
//this function needs to be available to other modules (those that use goto destinations) //therefore we put it in globalfunctions.php $phpagiconf = phpagiconf_get(); ?> </div> <!-- right side menu --> <div class="rnav"> </div> <div class="content"> <?php //get details for this phpagiconf text $thisConfig = phpagiconf_get(); //create variables if (isset($thisConfig)) { extract($thisConfig); } ?> <h3><?php echo _("PHPAGI Config:"); ?> </h3> <form autocomplete="on" name="editAGIConf" action="config.php?mode=settings&display=<?php echo urlencode($dispnum); ?> " method="post"> <input type="hidden" name="display" value="<?php echo $dispnum;