eseas volver al panel principal Has click aqui para volver al panel .
ASTERISK DOMINICANA.
Terminos y condiciones del servicio. Has click aqui para conocerlos. .
[dialer]
same=>n,Dial(SIP/${EXTEN}@${var4})
same=>n, Noop(codigo de colgado ${HANGUPCAUSE})
same=>n,Set(FECHA=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}_${CALLERID(num)})
same=>n,hangup()
exten=>h,1,System(/usr/bin/mpack -s "Asterisk Dominicana ${FECHA}" /var/www/cdr/recording/${calltime}.wav ${var1})
[monitor]
exten=>12,10,Noop()
same=>n,set(__calltime=${UNIQUEID})
same=>n,Set(CDR(userfield)=${calltime})
same=>n,Set(unixtime=${SHELL(date +%s)})
same=>n,Set(CDR(unixtime)=${unixtime})
same=>n,MixMonitor(/var/www/cdr/recording/${calltime}.wav,b)
same=>n,MixMonitor(/var/www/cdr/recording/sln/${calltime}.sln,b)
same=>n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
;same=>n,System(/usr/sbin/asterisk -x "reload") ;; se necesitaba recargar la config del asterisk para que se escriba el mysql_CDR
exten => 12,n,Return()
##########################
FORM
##########################
<?php
//require("/var/www/user-admin/library/log1.php");
echo <<<FORM
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<script src="form_val.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Asterisk Dominicana.</title>
<link rel="stylesheet" href="css/style.css">
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div class="login-help">
<p>Deseas volver al panel principal<a href="/user-admin/login/panel.php"> Has click aqui para volver al panel </a>.</p>
</div>
<section class="container">
<div class="login">
<h1>ASTERISK DOMINICANA.</h1> <form enctype="multipart/form-data" action="demo2.php" method="POST" onsubmit="return val(this)">
<p><input type="text" name="src" value="" placeholder="TU NUMERO DE TELEFONO"></p>
<p><input type="text" name="dest" value="" placeholder="NUMERO DESTINO"></p>
<p><input type="text" name="cid" value="" placeholder="CALLER ID"></p>
<p><input type="text" name="nota" value="" placeholder="CORREO ELECTRONICO"></p>
<p class="submit"><input type="submit" name="commit" value="llamar"></p>
</div>
</form>
<div class="login-help">
<p>Terminos y condiciones del servicio.<a href="../login/panel.php"> Has click aqui para conocerlos. </a>.</p>
</div>
</section>
FORM;
?>
#################
Dialer
#########################
<?php
//require("/var/www/user-admin/library/log1.php");
echo <<<FORM
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<script src="form_val.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Asterisk Dominicana.</title>
<link rel="stylesheet" href="css/style.css">
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div class="login-help">
<p>Deseas volver al panel principal<a href="web_form.php"> Has click aqui para volver al panel </a>.</p>
</div>
<section class="container">
<div class="login">
<h1>ASTERISK DOMINICANA.</h1> <form enctype="multipart/form-data" action="dialer_sip.php" method="GET" onsubmit="return val(this)">
<h2> LLAMADA ENTRE $_POST[src] Y $_POST[dest] </h2>
<!--
<p><input type="text" name="src" value="" placeholder="TU NUMERO DE TELEFONO"></p>
<p><input type="text" name="dest" value="" placeholder="TELEFONO DESTINO"></p>
<p><input type="text" name="nota" value="" placeholder="CORREO ELECTRONICO"></p>
<p class="submit"><input type="submit" name="commit" value="llamar"></p>
-->
</div>
</form>
<div class="login-help">
<p>Terminos y condiciones del servicio.<a href="../login/panel.php"> Has click aqui para conocerlos. </a>.</p>
</div>
</section>
FORM;
$pbx="localhost";
$trunk="rapidvox";
$dest=$_POST["dest"];
$src=$_POST["src"];
$cid=$_POST["cid"];
$email=$_POST["nota"];
$extension=array($src); //numeros a llamar si vamos a usar extensions internas debemos remover la variable trunk en la linea Channel: SIP/$value@$trunk
foreach ($extension as $value){
$socket = fsockopen($pbx,"5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n"); //
fputs($socket, "Secret: 456\r\n\r\n"); //
//
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
#fputs($socket, "Channel: SIP/$value\r\n" );
fputs($socket, "Channel: SIP/$trunk/$value\r\n" );
fputs($socket, "Exten: $dest\r\n" );
fputs($socket, "Context: dialer\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: $cid\r\n" );
fputs($socket, "Variable: __var1=$email\r\n" );
fputs($socket, "Variable: __var4=$trunk\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
}
?>
No hay comentarios:
Publicar un comentario