Hola, he estado estos dias probando la posibilidad de realizar un click to call con 3cx. He encontrado la información en el foro ingles, pero estaba desactualizado ya que cambia completamente el formato de la url para generar la llamada a través de la http api con la V10 (estaba estructurado para versiones anteriores, este solo funciona con V10), por lo que he tenido que modificarlo, y ya aprovechando le he añadido un indicador de carga, cierre automatico del pop-up y alguna cosilla más.
Info original: http: //www.3cx.com/forums/web-call-back-11323.html
este es el resultado sin embeber en ninguna web, solo cargando el index.php en el navegador.
Y con el popup:
El funcionamiento es basico. Cliente en una web introduce su numero en el cajetin y se cursa una llamada a la extension indicada en el config.php. En el momento que el agente descuelga, queda en espera con música y se lanza la llamada al cliente.
Cuando el cliente descuelga, se pone directamente en contacto con el operador, tal y como solicito a través de la web.
os dejo el código de los archivos, y los mismos en un rar por si quereis probarlo. solo teneis que cambiar las ip de la centralita y de las imágenes de fondo del popup y de lo que sería el widget a embeber en la web.
call.php
<head><br />
</head><br />
<script type="text/javascript"><br />
//<![CDATA[<br />
function cerrar(){<br />
self.close();<br />
}<br />
var cierre = setTimeout('cerrar()', 6000);<br />
//]]><br />
</script><br />
<style type="text/css"><br />
.fond {<br />
position: absolute;<br />
background-image: url(http://xxx.com/tu-fondo-popup.jpg);<br />
width: 340px;<br />
height: 184px;<br />
}<br />
.title {<br />
color: #1b7bb5;<br />
font-size: 0.9em;<br />
font-family: arial;<br />
font-weight: bold;<br />
}<br />
.title2 {<br />
color: #1b7bb5;<br />
font-size: 0.7em;<br />
font-family: arial;<br />
font-weight: bold;<br />
margin-left: 40px;<br />
margin-top: 5px;<br />
}<br />
.texte {<br />
position: absolute;<br />
width : 390px;<br />
height: 80px;<br />
margin-left: 15px;<br />
margin-top: 30px;<br />
color: #000;<br />
font-size: 0.6em;<br />
font-family: arial;<br />
}<br />
<br />
</style><br />
<center><div class="title2">Contactando con un agente.</div> <br><br />
</center><br />
<br />
<br><br><center><INPUT TYPE="button" NAME="btFermer" VALUE="Cerrar" onClick="javascript:self.close();"></center><br />
<br />
<?php<br />
require ('config.php'<br />
$number = $_POST["number"];<br />
$number = $_POST["number"];<br />
$url = "$host$port/ivr/PbxAPI.aspx?func=make_call&from=$ext&to=$number&pin=$ext_pin";<br />
<br />
$handle = fopen("$url", "r");<br />
$contents = '';<br />
while (!feof($handle)) {<br />
$contents .= fread($handle, 8192);<br />
}<br />
fclose($handle);<br />
?>
config.php
<?php<br />
// Ip o hostname de la 3CX<br />
$host = 'http://la-ip-de-tu-3CX';<br />
// Puerto conexion centralita.<br />
// tiene que aceptar conexiones en este puerto (firewall, IIS).<br />
$port = ':5000';<br />
//Extension que iniciara la llamada.<br />
$ext = '100';<br />
// Pin de la extension.<br />
$ext_pin = '123456';<br />
// Prefijo. Si usted necesita seleccionar una línea con prefijo<br />
$prefix = '9';<br />
?>
index.php
<head><br />
</head><br />
<style type="text/css"><br />
.fond {<br />
position: absolute;<br />
background-image: url(http://xxxx.com/bg.png);<br />
width: 330px;<br />
height: 184px;<br />
<br />
}<br />
.title {<br />
color: #1b7bb5;<br />
font-size: 0.9em;<br />
font-family: arial;<br />
font-weight: bold;<br />
}<br />
.title2 {<br />
color: #1b7bb5;<br />
font-size: 0.7em;<br />
font-family: arial;<br />
font-weight: bold;<br />
margin-left: 70px;<br />
margin-top: 5px;<br />
}<br />
.texte {<br />
position: absolute;<br />
width : 390px;<br />
height: 80px;<br />
margin-left: 15px;<br />
margin-top: 30px;<br />
color: #000;<br />
font-size: 0.6em;<br />
font-family: arial;<br />
}<br />
<br />
</style><br />
<body><br />
<div class="fond"> <div class="title">C2C</div><br />
<div class="title2">Servicio gratuito de contacto click to call</div><br />
<br />
<!--formulario --><br />
<div class="texte"><br />
<!--aqui el texto que queramos añadir al widget--><br />
Introduzca su numero de telefono<br><br />
A continuacion, haga clic en Aceptar.<br />
<br />
<!-- no tocar // llamada a archivo call.php --><br />
<br><br><br />
<form method="post" name="active" action="call.php" target="newWin" onSubmit="window.open(this.action, 'newWin', 'width=450, scrollbars=yes, height=50'<br />
setTimeout('active.close()',3000);"><br />
Su numero: <input type="text" name="number" size="15"><br />
<input type="submit" value="Llamar" alt="ok"><br />
</form><br />
</div><br />
<br />
</div><br />
</body><br />
</html>
Cualquier cosa no dudeis en preguntar
Un saludo
Info original: http: //www.3cx.com/forums/web-call-back-11323.html
este es el resultado sin embeber en ninguna web, solo cargando el index.php en el navegador.
Y con el popup:
El funcionamiento es basico. Cliente en una web introduce su numero en el cajetin y se cursa una llamada a la extension indicada en el config.php. En el momento que el agente descuelga, queda en espera con música y se lanza la llamada al cliente.
Cuando el cliente descuelga, se pone directamente en contacto con el operador, tal y como solicito a través de la web.
os dejo el código de los archivos, y los mismos en un rar por si quereis probarlo. solo teneis que cambiar las ip de la centralita y de las imágenes de fondo del popup y de lo que sería el widget a embeber en la web.
call.php
<head><br />
</head><br />
<script type="text/javascript"><br />
//<![CDATA[<br />
function cerrar(){<br />
self.close();<br />
}<br />
var cierre = setTimeout('cerrar()', 6000);<br />
//]]><br />
</script><br />
<style type="text/css"><br />
.fond {<br />
position: absolute;<br />
background-image: url(http://xxx.com/tu-fondo-popup.jpg);<br />
width: 340px;<br />
height: 184px;<br />
}<br />
.title {<br />
color: #1b7bb5;<br />
font-size: 0.9em;<br />
font-family: arial;<br />
font-weight: bold;<br />
}<br />
.title2 {<br />
color: #1b7bb5;<br />
font-size: 0.7em;<br />
font-family: arial;<br />
font-weight: bold;<br />
margin-left: 40px;<br />
margin-top: 5px;<br />
}<br />
.texte {<br />
position: absolute;<br />
width : 390px;<br />
height: 80px;<br />
margin-left: 15px;<br />
margin-top: 30px;<br />
color: #000;<br />
font-size: 0.6em;<br />
font-family: arial;<br />
}<br />
<br />
</style><br />
<center><div class="title2">Contactando con un agente.</div> <br><br />
</center><br />
<br />
<br><br><center><INPUT TYPE="button" NAME="btFermer" VALUE="Cerrar" onClick="javascript:self.close();"></center><br />
<br />
<?php<br />
require ('config.php'<br />
$number = $_POST["number"];<br />
$number = $_POST["number"];<br />
$url = "$host$port/ivr/PbxAPI.aspx?func=make_call&from=$ext&to=$number&pin=$ext_pin";<br />
<br />
$handle = fopen("$url", "r");<br />
$contents = '';<br />
while (!feof($handle)) {<br />
$contents .= fread($handle, 8192);<br />
}<br />
fclose($handle);<br />
?>
config.php
<?php<br />
// Ip o hostname de la 3CX<br />
$host = 'http://la-ip-de-tu-3CX';<br />
// Puerto conexion centralita.<br />
// tiene que aceptar conexiones en este puerto (firewall, IIS).<br />
$port = ':5000';<br />
//Extension que iniciara la llamada.<br />
$ext = '100';<br />
// Pin de la extension.<br />
$ext_pin = '123456';<br />
// Prefijo. Si usted necesita seleccionar una línea con prefijo<br />
$prefix = '9';<br />
?>
index.php
<head><br />
</head><br />
<style type="text/css"><br />
.fond {<br />
position: absolute;<br />
background-image: url(http://xxxx.com/bg.png);<br />
width: 330px;<br />
height: 184px;<br />
<br />
}<br />
.title {<br />
color: #1b7bb5;<br />
font-size: 0.9em;<br />
font-family: arial;<br />
font-weight: bold;<br />
}<br />
.title2 {<br />
color: #1b7bb5;<br />
font-size: 0.7em;<br />
font-family: arial;<br />
font-weight: bold;<br />
margin-left: 70px;<br />
margin-top: 5px;<br />
}<br />
.texte {<br />
position: absolute;<br />
width : 390px;<br />
height: 80px;<br />
margin-left: 15px;<br />
margin-top: 30px;<br />
color: #000;<br />
font-size: 0.6em;<br />
font-family: arial;<br />
}<br />
<br />
</style><br />
<body><br />
<div class="fond"> <div class="title">C2C</div><br />
<div class="title2">Servicio gratuito de contacto click to call</div><br />
<br />
<!--formulario --><br />
<div class="texte"><br />
<!--aqui el texto que queramos añadir al widget--><br />
Introduzca su numero de telefono<br><br />
A continuacion, haga clic en Aceptar.<br />
<br />
<!-- no tocar // llamada a archivo call.php --><br />
<br><br><br />
<form method="post" name="active" action="call.php" target="newWin" onSubmit="window.open(this.action, 'newWin', 'width=450, scrollbars=yes, height=50'<br />
setTimeout('active.close()',3000);"><br />
Su numero: <input type="text" name="number" size="15"><br />
<input type="submit" value="Llamar" alt="ok"><br />
</form><br />
</div><br />
<br />
</div><br />
</body><br />
</html>
Cualquier cosa no dudeis en preguntar
Un saludo