Hello,
it will be usefull a web call back.
tks




tpinnovations wrote:This can be done with the HTTP API and a POST form.




tpinnovations wrote:Yes.
Your WEBBox will need to be able to send a POST form to your 3CXBox for it to work. It will ring the extension, the employee picks up the line and then the system dials out the call.
At some point this week I will post some PHP code to make it work.



<?php
// This is the server upon which 3CX resides. Hostname or IP should work.
$host = 'http://localhost';
// This is the port for which the IVR system resides.
// You will need to open yourfirewall and configure IIS to allow connection.
$port = ':5484';
//The Extension for which the call will originate.
$ext = '1000';
// The PIN of the above extension.
$ext_pin = '1000';
// Prefix If you need to select a line with prefix
$prefix = '9';
?><?php
require ('config.php');
$number = $_POST["number"];
$url = "$host$port/PbxAPI.aspx?func=make_call&from=$ext&pin=$ext_pin&to=$number";
$handle = fopen("$url", "r");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?><html>
<body>
<form action="call.php" method="post">
Number: <input type="text" name="number" />
<input type="submit" />
</form>
</body>
</html>

tpinnovations wrote:This is pretty basic, you will need to customize it for your setup.
config.php
- Code: Select all
<?php
// This is the server upon which 3CX resides. Hostname or IP should work.
$host = 'http://localhost';
// This is the port for which the IVR system resides.
// You will need to open yourfirewall and configure IIS to allow connection.
$port = ':5484';
//The Extension for which the call will originate.
$ext = '1000';
// The PIN of the above extension.
$ext_pin = '1000';
// Prefix If you need to select a line with prefix
$prefix = '9';
?>
call.php
- Code: Select all
<?php
require ('config.php');
$number = $_POST["number"];
$url = "$host$port/PbxAPI.aspx?func=make_call&from=$ext&pin=$ext_pin&to=$number";
$handle = fopen("$url", "r");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>











<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
</head>
<style type="text/css">
.fond {
position: absolute;
background-image: url(http://www.xxxxxxx.fr/webcallback/imb_back.jpg);
width: 396px;
height: 184px;
}
.title {
color: #1b7bb5;
font-size: 0.9em;
font-family: arial;
font-weight: bold;
}
.title2 {
color: #1b7bb5;
font-size: 0.7em;
font-family: arial;
font-weight: bold;
margin-left: 40px;
margin-top: 5px;
}
.texte {
position: absolute;
width : 390px;
height: 80px;
margin-left: 15px;
margin-top: 30px;
color: #000;
font-size: 0.6em;
font-family: arial;
}
</style>
<div class="title2">Merci, un correspondant va vous joindre d'ici quelques minutes.</div>
<br><br><center><INPUT TYPE="button" NAME="btFermer" VALUE="Fermer la fenêtre" onClick="javascript:self.close();"></center>
<?php
require ('config.php');
$number = $_POST["number"];
$url = "$host$port/PbxAPI.aspx?func=make_call&from=$ext&to=$number&pin=$ext_pin";
$handle = fopen("$url", "r");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
<?php
// This is the server upon which 3CX resides. Hostname or IP should work.
$host = 'http://xxxxxxx';
// This is the port for which the IVR system resides.
// You will need to open yourfirewall and configure IIS to allow connection.
$port = ':5484';
//The Extension for which the call will originate.
$ext = 'xxxx';
// The PIN of the above extension.
$ext_pin = 'xxxx';
// Prefix If you need to select a line with prefix
$prefix = '';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
</head>
<style type="text/css">
.fond {
position: absolute;
background-image: url(http://www.xxxxxxxx.fr/webcallback/imb_back.jpg);
width: 396px;
height: 184px;
}
.title {
color: #1b7bb5;
font-size: 0.9em;
font-family: arial;
font-weight: bold;
}
.title2 {
color: #1b7bb5;
font-size: 0.7em;
font-family: arial;
font-weight: bold;
margin-left: 70px;
margin-top: 5px;
}
.texte {
position: absolute;
width : 390px;
height: 80px;
margin-left: 15px;
margin-top: 30px;
color: #000;
font-size: 0.6em;
font-family: arial;
}
</style>
<body>
<div class="fond"> <div class="title">Web call Back </div>
<div class="title2">Service de rappel automatique</div>
<!--la ligne suivante permet d'appeler le fichier call.php afin de faire un "makecall" par le serveur 3cx // the next line call call.php file to make a "makecall" by 3cx system-->
<div class="texte">
<!--saisissez votre texte // Your texte-->
Saisissez le numéro de téléphone sur lequel vous souhaitez être joint.<br>
Cliquez ensuite sur Valider et vous serez appelé dans les plus bref délais.
<!-- le code pour appeler le fichier call.php // the code to call call.php file don't touch-->
<br><br>
<form method="post" name="active" action="call.php" target="newWin" onsubmit="window.open(this.action, 'newWin', 'width=450, scrollbars=yes, height=50');">
Votre numéro de téléphone: <input type="text" name="number" size="15">
<input type="submit" value="Valider" alt="ok">
</form>
</div>
</div>
</body>
</html> 



Users browsing this forum: No registered users and 0 guests