Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function crear($ex) {
- global $ext;
- global $nodo;
- $str = '';
- for($x=0;$x<count($ext);$x++) {
- $teclas = array(1,73,74);
- for($u=3;$u<74;$u++) {
- for($z=0;$z<count($ext);$z++) {
- if($z!=$x) {
- if(!in_array($u, $teclas)) {
- $str .= 'SET Subscriber_Keyboard "'.$nodo.'": "'.$ext[$x]['ext'].'": "'.$u.'"<br>';
- $nom = ucfirst(strtolower($ext[$z]['nombre']));
- $str .= '{<br>';
- $str .= ' Type = "Station_Supervision",<br>';
- $str .= ' Directory_Number = "'.$ext[$z]['ext'].'",<br>';
- $str .= ' Ringing_Mode = "No_Ring",<br>';
- $str .= ' Key_NOE_Mnemonic1 = "'.$nom.'"<br>';
- $str .= '}<br>';
- }
- }
- $teclas[] = $u;
- }
- }
- unset($teclas);
- }
- return $str;
- }
- ?>
- <form action="" method="POST">
- <textarea name="prueba"></textarea><br>
- <input type="submit" name="e" />
- </form>
- <?php
- ob_start();
- echo str_pad('',4096);
- function flushi(){
- ob_end_flush();
- ob_flush();
- flush();
- ob_start();
- }
- if(isset($_POST['prueba'])) { // if isset $_POST
- $a = explode("\n", $_POST['prueba']);
- $extensiones = count($a);
- $entidad = 129; // en el cs, "ippstat d <ext> | grep domain" y sale
- $nodo = 110; // bdg
- $mla = 3; // ni idea
- $exten = array();
- $ext = array();
- $sterm = '';
- foreach($a as $e) if(!empty($e)) $lin[] = explode("\t", trim($e));
- //var_dump($lin);
- for($i=0;$i<count($lin);$i++) {
- $ext[$i]['ext'] = $lin[$i][0];
- $ext[$i]['nombre'] = $lin[$i][4];
- $ext[$i]['ga'] = $lin[$i][7];
- }
- foreach ($ext as $extn) {
- $s = crear($ext);
- echo $s;
- flushi();
- }
- } // fin if isset $_POST
- ?>
Add Comment
Please, Sign In to add comment