8c8c5014 by Nitesh

Removed preview mode from progressive mode and changed calling strategy

1 parent 59030e1f
......@@ -340,15 +340,15 @@ class DialerController extends Controller
$wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s"));
//start actual calls
if (Auth::user()->sessiontype == '0') {
$newqueue = new Kqueue();
$newqueue->userToConf($sipid);
$newqueue = new Kqueue();
$newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline);
} else {
$newqueue = new Kqueue();
$newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline);
}
// if (Auth::user()->sessiontype == '0') {
// $newqueue = new Kqueue();
// $newqueue->userToConf($sipid);
// $newqueue = new Kqueue();
// $newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline);
// } else {
// $newqueue = new Kqueue();
// $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline);
// }
$searchresult .= "<script>kSetDData('C','callid','" . $crmcall->id . "');kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>";
......@@ -357,6 +357,7 @@ class DialerController extends Controller
doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){
if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html('');
});
doAjax('dialer?action=dialcall&sipid=". $sipid->id."-".$sipid->server ."&callnumber=". $callnumber ."&callerid=". $callerid ."&crmcall=". $crmcall->id ."&dialline=". $dialline->dialstr ."','','', 'ajax_manualdial','singlefail','POST');
</script>";
......@@ -377,7 +378,29 @@ class DialerController extends Controller
}
} else return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>");
}
if ($action == "dialcall") {
$sipid = Input::get("sipid");
$callnumber = Input::get("callnumber");
$callerid = (object)Input::get("callerid");
$crmcall[] = Input::get("crmcall");
$dialline[] = Input::get("dialline");
$sipid=explode("-", $sipid);
$sipid_key=['id','server'];
$crmcall_key=['id'];
$dialline_key=['dialstr'];
$sipid=(object)array_combine($sipid_key,$sipid);
$crmcall=(object)array_combine($crmcall_key,$crmcall);
$dialline=(object)array_combine($dialline_key,$dialline);
if (Auth::user()->sessiontype == '0') {
$newqueue = new Kqueue();
$newqueue->userToConf($sipid);
$newqueue = new Kqueue();
$newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline);
} else {
$newqueue = new Kqueue();
$newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline);
}
}
if ($action == "addconfcall") {
$retstr = "";
$callnumber = Input::get("confnumber");
......@@ -1337,7 +1360,7 @@ class DialerController extends Controller
if ($limit > 0) {
$tusers = $wakka->getPersons("status='New' and mobile!='' and $roclientstr order by dialer_lastcall asc limit $limit");
$tusers = $wakka->getPersons("status IN ('Called','Incall') and mobile!='' and $roclientstr order by dialer_lastcall asc limit $limit");
foreach ($tusers as $tuser) if (!isset($users[$tuser['id']])) $users[$tuser['id']] = $tuser;
$limit = $limit - sizeof($tusers);
}
......
......@@ -1093,19 +1093,20 @@ function updateDialerState(objstr,key,val,key2,val2)
if(val=="Progressive"||(kstychCall['previewcrmid']!=""&&kstychCall['previewcrmid']>0))
{
doAjax('dialer?action=previewnext&client='+client,datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST',
function(retstr){
if(kstychCall['previewcrmid']!="")
{
updateDialerState();
}
else
{
resetCallArray();
simpleNotification('error','topRight',"Failed to Dial Next Record");
updateDialerState("dialer","mDialerState","Paused","mDialerSubState","NotReady");
}
});
// doAjax('dialer?action=previewnext&client='+client,datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST',
// function(retstr){
// if(kstychCall['previewcrmid']!="")
// {
// updateDialerState();
// }
// else
// {
// resetCallArray();
// simpleNotification('error','topRight',"Failed to Dial Next Record");
// updateDialerState("dialer","mDialerState","Paused","mDialerSubState","NotReady");
// }
// });
updateDialerState("action","dialnext","");
}
updateDialerState();
});
......@@ -1457,15 +1458,15 @@ function dialerTimersUpdate()
{
if(kstychDialer['mDialerState']=="Progressive")
{
var progressiveDelay=Math.ceil(kstychCall['prograssiveDelay']-((getNowTS()-kstychCall['ts_Wait'])/1000));
// var progressiveDelay=Math.ceil(kstychCall['prograssiveDelay']-((getNowTS()-kstychCall['ts_Wait'])/1000));
if(progressiveDelay<0)progressiveDelay=0;
// if(progressiveDelay<0)progressiveDelay=0;
$("#manualdial_btn").attr("disabled",false);
$("#manualdial_btn").attr("dialaction","dialnext");
$("#manualdial_btn").html("<i class='fa fa-play text-default'></i> "+progressiveDelay);
// $("#manualdial_btn").attr("disabled",false);
// $("#manualdial_btn").attr("dialaction","dialnext");
// $("#manualdial_btn").html("<i class='fa fa-play text-default'></i> "+progressiveDelay);
if(progressiveDelay<=0)$("#manualdial_btn").click();
// if(progressiveDelay<=0)$("#manualdial_btn").click();
}
// if(kstychDialer['mDialerSubState']=="Predictive")
......@@ -2415,7 +2416,7 @@ function dialerSipMsg(omsg)
try
{
console.log(omsg.ao_headers[6].s_name);
if(omsg.ao_headers[6].s_name=='kstych-data')
if(omsg.ao_headers[6].s_name=='kstych-data' || omsg.ao_headers[6].s_name=='kstych-Data')
{
var vparts=omsg.ao_headers[6].s_value.split("|");
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!