. */ /* 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()); ?>

END; } $idx++; $var_iax_custom_key = "iax_custom_key_$idx"; $var_iax_custom_val = "iax_custom_val_$idx"; } $tabindex += 60; // make room for dynamic insertion of new fields ?>

    ".$div_disp['div'].""; } ?>

$codec_state) { if ($cols == 0) { echo "\n"; $cols = $cols_per_row; } $cols--; $tabindex++; $codec_trans = _($codec); $codec_checked = $codec_state ? 'checked' : ''; echo <<< END END; } ?>
host - Consider the host's preferred order ahead of the caller's.
caller - Consider the callers preferred order ahead of the host's.
disabled - Disable the consideration of codec preference altogether. (this is the original behavior before preferences were added)
reqonly - Same as disabled, only do not consider capabilities if the requested format is not available the call will only be accepted if the requested format is available.")?>
/> /> /> />
/> /> /> />

/> />
$codec_state) { if ($cols == 0) { echo "\n"; $cols = $cols_per_row; } $cols--; $tabindex++; $codec_trans = _($codec); $codec_checked = $codec_state ? 'checked' : ''; echo <<< END END; } ?>

 (minregexpire)   (maxregexpire) 

/> />
/> />
Asterisk: resyncthreshold. When the jitterbuffer notices a significant change in delay that continues over a few frames, it will resync, assuming that the change in delay was caused by a timestamping mix-up. The threshold for noticing a change in delay is measured as twice the measured jitter plus this resync threshold. Resyncing can be disabled by setting this parameter to -1.")?>  (maxjitterbuffer)   (resyncthreshold) 

bindaddr=192.168.10.100:4555.
It is recommended to leave this blank.")?>
/> />

[setting] = [value]
in the boxes below. Click the Add Field box to add additional fields. Blank boxes will be deleted when submitted.")?>
=
= END; $tabindex++; echo <<< END

" />

" tabindex="">
"$('#".$error['id']."').addClass('validation-error');\n", 'div' => $error['message'], ); } return $error_display; } function iaxsettings_check_custom_files() { global $amp_conf; $errors = array(); $custom_files[] = $amp_conf['ASTETCDIR']."/iax.conf"; $custom_files[] = $amp_conf['ASTETCDIR']."/iax_general_custom.conf"; $custom_files[] = $amp_conf['ASTETCDIR']."/iax_custom.conf"; foreach ($custom_files as $file) { if (file_exists($file)) { $iax_conf = parse_ini_file($file,true); $main = true; // 1 is iax.conf, after that don't care foreach ($iax_conf as $section => $item) { // If setting is an array, then it is a subsection // if (!is_array($item)) { $msg = sprintf(_("Settings in %s may override these. Those settings should be removed."),"$file"); $errors[] = array( 'js' => '', 'div' => $msg); break; } elseif ($main && is_array($item) && strtolower($section) == 'general' && !empty($item)) { $msg = sprintf(_("File %s should not have any settings in it. Those settings should be removed."),"$file"); $errors[] = array( 'js' => '', 'div' => $msg); break; } $main = false; } } } return $errors; } ?>