Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

sábado, 29 de agosto de 2015

TRUNK and DID setup

<?php

echo "<center><h2>Caller ID & Trunk  setup. <h2></center>";


// asignar permisos chmod 777 /var/www/cid.conf
// asignar permisos chmod 777 /var/www/trunk.conf

if(isset($_POST[submit])&& strlen($_POST[cid])>0 &&  strlen($_POST[trunk])>0 ){
$myfile = fopen("/var/www/cid.conf", "w") or die("Unable to open file!");
$cid=$_POST[cid];
fwrite($myfile,$cid);
fclose($myfile);
echo "<strong> Selected caller id : $cid</strong><br>";

$myfile1 = fopen("/var/www/trunk.conf", "w") or die("Unable to open file!");
$trunk=$_POST[trunk];
fwrite($myfile1,$trunk);
fclose($myfile1);


echo "<strong>Selected trunk : $trunk</strong>";
}

?>

<body>
<center>
    <div class="login-help">
      <p>Click here to <a href="cid.php"> Go to the main panel </a>.</p>
    </div>
  <section class="container">
    <div class="login">
      <h1>Add Caller ID</h1> <form enctype="multipart/form-data" action="cid.php" method="POST" onsubmit="return val(this)">


        <p><input type="text" name="cid" value="" placeholder="caller id"></p>
        <p><input type="text" name="trunk" value="" placeholder="trunk"></p>


    <p class="submit"><input type="submit" name="submit" value="Done"></p>
</center>
      </form>
    </div>


  </section>

</body>
</html>

####################
[outbound]
exten=>_7.,1,Noop()
same=>n,Set(CID=${SHELL(cat /var/www/cid.conf)})
same=>n,Set(CALLERID(num)=${CID})
same=>n,Set(TRUNK=${SHELL(cat /var/www/trunk.conf)})
same=>n,Dial(SIP/${EXTEN:1}@${TRUNK},25)
same=>n,hangup()

No hay comentarios:

Publicar un comentario