parent.dial mini browser
Hi FOP2 Team,
Until now our team also focus developement crm telemarketing system that integrated to FOP2 Page. Our crm embeded on mini browser FOP2.
But i still have issue how to mapping "customer_id" on database CRM with "recording_file" on table asteriskcdr
Do you have other solution for this case?, so when we using function click dial "parent.dial" can send other parameter, example like this :
$row="081287264002";
$numberstrip = preg_replace("/[^0-9]/","",$row);
echo "<a href='#' onclick='parent.dial(\"$numberstrip\","\$customer_id\")'>081287264002</a>";
This same like "Originate Variable" can send to asterisk.
I really appreciate your help to implement my request.
Thanks
Until now our team also focus developement crm telemarketing system that integrated to FOP2 Page. Our crm embeded on mini browser FOP2.
But i still have issue how to mapping "customer_id" on database CRM with "recording_file" on table asteriskcdr
Do you have other solution for this case?, so when we using function click dial "parent.dial" can send other parameter, example like this :
$row="081287264002";
$numberstrip = preg_replace("/[^0-9]/","",$row);
echo "<a href='#' onclick='parent.dial(\"$numberstrip\","\$customer_id\")'>081287264002</a>";
This same like "Originate Variable" can send to asterisk.
I really appreciate your help to implement my request.
Thanks
Comments
Any update for my Question?
Thanks
Now it working:
my code as below :
originate.php
<?php
require_once("/var/www/html/fop2/admin/asmanager.php");
$astman = new AsteriskManager();
$extension=trim($_REQUEST);
$phone_number=trim($_REQUEST);
$cust_id=trim($_REQUEST);
$uniq_id=trim($_REQUEST);
//Originate($channel, $exten, $context, $priority, $timeout, $callerid, $variable, $account, $application, $data)
if(!empty($extension) && !empty($phone_number) && !empty($cust_id)){
global $astman, $conf;
if($astman->connect()){
$res = $astman->Originate('SIP/'.$extension,$phone_number,'from-internal',1,null,$phone_number,'PARAM_VALUE=CUSTOMER_ID='.$cust_id,null,null,null,null);
if(false) {
$this->log("Failed to login.");
$this->disconnect();
return false;
}
if($res=='Error') {
return false;
}
echo true;
}
}else{
return false;
}
?>
php script
$ph="081287264002";
$cust_id = empty($_REQUEST)?'1234':$_REQUEST;
$extension = empty($_SESSION)?'1000':$_SESSION;
$numberstrip = preg_replace("/[^0-9]/","",$ph);
$cust_id=preg_replace("/[^0-9]/","",$cust_id);
echo "<a href='#' onclick='parent_dial(\"$numberstrip\",\"$cust_id\",\"$extension\")'>{$ph}</a>";
my.js
<script type="text/javascript">
function parent_dial(phone_number,cust_id,extension){
$.ajax({
url: 'http://my/zd/originate.php',
type: 'POST',
dataType: 'text',
data: 'extension='+ extension+'&phone_number='+ phone_number+'&cust_id='+cust_id,
success: function (response) {
$(".result").html(response);
},
error: function () {
alert("error");
}
});
}
</script>
After i recheck again, i have issue.
If i dialed number from minibrowser using module asmanager, we can't see log queue_log.
Why it happen?
Is there something wrong with my code ?
$res = $astman->Originate('SIP/'.$extension,$phone_number,'from-internal',1,null,$phone_number,'PARAM_VALUE=CUSTOMER_ID='.$cust_id,null,null,null,null);
I need to track outbound call if i using "module asmanager", because we using reporting asternic call center.
here is my log when i dial using astmanager
Thanks
Now it solve, i should set "account" and "callerid"
$res = $astman->Originate('SIP/'.$extension,$phone_number,'from-internal',1,null,$extension,'PARAM_VALUE=CUSTOMER_ID='.$cust_id,'cs-outbound',null,null,null);
Thanks