. */ /* Determines how many columns per row for the codecs and formats the table */ $cols_per_row = 4; $width = (100.0 / $cols_per_row); $tabindex = 0; $dispnum = "iaxsettings"; $error_displays = array(); $action = isset($_POST['action'])?$_POST['action']:''; $codecs = array( 'ulaw' => '', 'alaw' => '', 'slin' => '', 'g726' => '', 'gsm' => '', 'g729' => '', 'ilbc' => '', 'g723' => '', 'g726aal2' => '', 'adpcm' => '', 'lpc10' => '', 'speex' => '', 'g722' => '', ); foreach (array_keys($codecs) as $codec) { $codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; } $iax_settings['codecs'] = $codecs; $video_codecs = array( 'h261' => '', 'h263' => '', 'h263p' => '', 'h264' => '', ); foreach (array_keys($video_codecs) as $codec) { $video_codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; } $iax_settings['codecpriority'] = isset($_POST['codecpriority']) ? $_POST['codecpriority'] : 'host'; $iax_settings['bandwidth'] = isset($_POST['bandwidth']) ? $_POST['bandwidth'] : 'unset'; $iax_settings['video_codecs'] = $video_codecs; $iax_settings['videosupport'] = isset($_POST['videosupport']) ? $_POST['videosupport'] : 'no'; $iax_settings['maxregexpire'] = isset($_POST['maxregexpire']) ? htmlspecialchars($_POST['maxregexpire']) : '3600'; $iax_settings['minregexpire'] = isset($_POST['minregexpire']) ? htmlspecialchars($_POST['minregexpire']) : '60'; $iax_settings['jitterbuffer'] = isset($_POST['jitterbuffer']) ? $_POST['jitterbuffer'] : 'no'; $iax_settings['forcejitterbuffer'] = isset($_POST['forcejitterbuffer']) ? $_POST['forcejitterbuffer'] : 'no'; $iax_settings['maxjitterbuffer'] = isset($_POST['maxjitterbuffer']) ? htmlspecialchars($_POST['maxjitterbuffer']) : '200'; $iax_settings['resyncthreshold'] = isset($_POST['resyncthreshold']) ? htmlspecialchars($_POST['resyncthreshold']) : '1000'; $iax_settings['maxjitterinterps'] = isset($_POST['maxjitterinterps']) ? htmlspecialchars($_POST['maxjitterinterps']) : '10'; $iax_settings['iax_language'] = isset($_POST['iax_language']) ? htmlspecialchars($_POST['iax_language']) : ''; $iax_settings['bindaddr'] = isset($_POST['bindaddr']) ? htmlspecialchars($_POST['bindaddr']) : ''; $iax_settings['bindport'] = isset($_POST['bindport']) ? htmlspecialchars($_POST['bindport']) : ''; $iax_settings['delayreject'] = isset($_POST['delayreject']) ? htmlspecialchars($_POST['delayreject']) : 'yes'; $p_idx = 0; $n_idx = 0; while (isset($_POST["iax_custom_key_$p_idx"])) { if ($_POST["iax_custom_key_$p_idx"] != '') { $iax_settings["iax_custom_key_$n_idx"] = htmlspecialchars($_POST["iax_custom_key_$p_idx"]); $iax_settings["iax_custom_val_$n_idx"] = htmlspecialchars($_POST["iax_custom_val_$p_idx"]); $n_idx++; } $p_idx++; } switch ($action) { case "edit": //just delete and re-add if (($errors = iaxsettings_edit($iax_settings)) !== true) { $error_displays = process_errors($errors); } else { needreload(); //redirect_standard(); } break; default: /* only get them if first time load, if they pressed submit, use values from POST */ $iax_settings = iaxsettings_get(); } $error_displays = array_merge($error_displays,iaxsettings_check_custom_files()); ?>