Removed preview mode from progressive mode and changed calling strategy
Showing
2 changed files
with
55 additions
and
31 deletions
| ... | @@ -340,15 +340,15 @@ class DialerController extends Controller | ... | @@ -340,15 +340,15 @@ class DialerController extends Controller |
| 340 | $wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s")); | 340 | $wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s")); |
| 341 | 341 | ||
| 342 | //start actual calls | 342 | //start actual calls |
| 343 | if (Auth::user()->sessiontype == '0') { | 343 | // if (Auth::user()->sessiontype == '0') { |
| 344 | $newqueue = new Kqueue(); | 344 | // $newqueue = new Kqueue(); |
| 345 | $newqueue->userToConf($sipid); | 345 | // $newqueue->userToConf($sipid); |
| 346 | $newqueue = new Kqueue(); | 346 | // $newqueue = new Kqueue(); |
| 347 | $newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline); | 347 | // $newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline); |
| 348 | } else { | 348 | // } else { |
| 349 | $newqueue = new Kqueue(); | 349 | // $newqueue = new Kqueue(); |
| 350 | $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); | 350 | // $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); |
| 351 | } | 351 | // } |
| 352 | $searchresult .= "<script>kSetDData('C','callid','" . $crmcall->id . "');kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>"; | 352 | $searchresult .= "<script>kSetDData('C','callid','" . $crmcall->id . "');kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>"; |
| 353 | 353 | ||
| 354 | 354 | ||
| ... | @@ -357,6 +357,7 @@ class DialerController extends Controller | ... | @@ -357,6 +357,7 @@ class DialerController extends Controller |
| 357 | doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | 357 | doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ |
| 358 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | 358 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); |
| 359 | }); | 359 | }); |
| 360 | doAjax('dialer?action=dialcall&sipid=". $sipid->id."-".$sipid->server ."&callnumber=". $callnumber ."&callerid=". $callerid ."&crmcall=". $crmcall->id ."&dialline=". $dialline->dialstr ."','','', 'ajax_manualdial','singlefail','POST'); | ||
| 360 | </script>"; | 361 | </script>"; |
| 361 | 362 | ||
| 362 | 363 | ||
| ... | @@ -377,7 +378,29 @@ class DialerController extends Controller | ... | @@ -377,7 +378,29 @@ class DialerController extends Controller |
| 377 | } | 378 | } |
| 378 | } else return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | 379 | } else return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); |
| 379 | } | 380 | } |
| 380 | 381 | if ($action == "dialcall") { | |
| 382 | $sipid = Input::get("sipid"); | ||
| 383 | $callnumber = Input::get("callnumber"); | ||
| 384 | $callerid = (object)Input::get("callerid"); | ||
| 385 | $crmcall[] = Input::get("crmcall"); | ||
| 386 | $dialline[] = Input::get("dialline"); | ||
| 387 | $sipid=explode("-", $sipid); | ||
| 388 | $sipid_key=['id','server']; | ||
| 389 | $crmcall_key=['id']; | ||
| 390 | $dialline_key=['dialstr']; | ||
| 391 | $sipid=(object)array_combine($sipid_key,$sipid); | ||
| 392 | $crmcall=(object)array_combine($crmcall_key,$crmcall); | ||
| 393 | $dialline=(object)array_combine($dialline_key,$dialline); | ||
| 394 | if (Auth::user()->sessiontype == '0') { | ||
| 395 | $newqueue = new Kqueue(); | ||
| 396 | $newqueue->userToConf($sipid); | ||
| 397 | $newqueue = new Kqueue(); | ||
| 398 | $newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline); | ||
| 399 | } else { | ||
| 400 | $newqueue = new Kqueue(); | ||
| 401 | $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); | ||
| 402 | } | ||
| 403 | } | ||
| 381 | if ($action == "addconfcall") { | 404 | if ($action == "addconfcall") { |
| 382 | $retstr = ""; | 405 | $retstr = ""; |
| 383 | $callnumber = Input::get("confnumber"); | 406 | $callnumber = Input::get("confnumber"); |
| ... | @@ -1337,7 +1360,7 @@ class DialerController extends Controller | ... | @@ -1337,7 +1360,7 @@ class DialerController extends Controller |
| 1337 | 1360 | ||
| 1338 | if ($limit > 0) { | 1361 | if ($limit > 0) { |
| 1339 | 1362 | ||
| 1340 | $tusers = $wakka->getPersons("status='New' and mobile!='' and $roclientstr order by dialer_lastcall asc limit $limit"); | 1363 | $tusers = $wakka->getPersons("status IN ('Called','Incall') and mobile!='' and $roclientstr order by dialer_lastcall asc limit $limit"); |
| 1341 | foreach ($tusers as $tuser) if (!isset($users[$tuser['id']])) $users[$tuser['id']] = $tuser; | 1364 | foreach ($tusers as $tuser) if (!isset($users[$tuser['id']])) $users[$tuser['id']] = $tuser; |
| 1342 | $limit = $limit - sizeof($tusers); | 1365 | $limit = $limit - sizeof($tusers); |
| 1343 | } | 1366 | } | ... | ... |
| ... | @@ -1093,19 +1093,20 @@ function updateDialerState(objstr,key,val,key2,val2) | ... | @@ -1093,19 +1093,20 @@ function updateDialerState(objstr,key,val,key2,val2) |
| 1093 | 1093 | ||
| 1094 | if(val=="Progressive"||(kstychCall['previewcrmid']!=""&&kstychCall['previewcrmid']>0)) | 1094 | if(val=="Progressive"||(kstychCall['previewcrmid']!=""&&kstychCall['previewcrmid']>0)) |
| 1095 | { | 1095 | { |
| 1096 | doAjax('dialer?action=previewnext&client='+client,datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST', | 1096 | // doAjax('dialer?action=previewnext&client='+client,datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST', |
| 1097 | function(retstr){ | 1097 | // function(retstr){ |
| 1098 | if(kstychCall['previewcrmid']!="") | 1098 | // if(kstychCall['previewcrmid']!="") |
| 1099 | { | 1099 | // { |
| 1100 | updateDialerState(); | 1100 | // updateDialerState(); |
| 1101 | } | 1101 | // } |
| 1102 | else | 1102 | // else |
| 1103 | { | 1103 | // { |
| 1104 | resetCallArray(); | 1104 | // resetCallArray(); |
| 1105 | simpleNotification('error','topRight',"Failed to Dial Next Record"); | 1105 | // simpleNotification('error','topRight',"Failed to Dial Next Record"); |
| 1106 | updateDialerState("dialer","mDialerState","Paused","mDialerSubState","NotReady"); | 1106 | // updateDialerState("dialer","mDialerState","Paused","mDialerSubState","NotReady"); |
| 1107 | } | 1107 | // } |
| 1108 | }); | 1108 | // }); |
| 1109 | updateDialerState("action","dialnext",""); | ||
| 1109 | } | 1110 | } |
| 1110 | updateDialerState(); | 1111 | updateDialerState(); |
| 1111 | }); | 1112 | }); |
| ... | @@ -1457,15 +1458,15 @@ function dialerTimersUpdate() | ... | @@ -1457,15 +1458,15 @@ function dialerTimersUpdate() |
| 1457 | { | 1458 | { |
| 1458 | if(kstychDialer['mDialerState']=="Progressive") | 1459 | if(kstychDialer['mDialerState']=="Progressive") |
| 1459 | { | 1460 | { |
| 1460 | var progressiveDelay=Math.ceil(kstychCall['prograssiveDelay']-((getNowTS()-kstychCall['ts_Wait'])/1000)); | 1461 | // var progressiveDelay=Math.ceil(kstychCall['prograssiveDelay']-((getNowTS()-kstychCall['ts_Wait'])/1000)); |
| 1461 | 1462 | ||
| 1462 | if(progressiveDelay<0)progressiveDelay=0; | 1463 | // if(progressiveDelay<0)progressiveDelay=0; |
| 1463 | 1464 | ||
| 1464 | $("#manualdial_btn").attr("disabled",false); | 1465 | // $("#manualdial_btn").attr("disabled",false); |
| 1465 | $("#manualdial_btn").attr("dialaction","dialnext"); | 1466 | // $("#manualdial_btn").attr("dialaction","dialnext"); |
| 1466 | $("#manualdial_btn").html("<i class='fa fa-play text-default'></i> "+progressiveDelay); | 1467 | // $("#manualdial_btn").html("<i class='fa fa-play text-default'></i> "+progressiveDelay); |
| 1467 | 1468 | ||
| 1468 | if(progressiveDelay<=0)$("#manualdial_btn").click(); | 1469 | // if(progressiveDelay<=0)$("#manualdial_btn").click(); |
| 1469 | } | 1470 | } |
| 1470 | 1471 | ||
| 1471 | // if(kstychDialer['mDialerSubState']=="Predictive") | 1472 | // if(kstychDialer['mDialerSubState']=="Predictive") |
| ... | @@ -2415,7 +2416,7 @@ function dialerSipMsg(omsg) | ... | @@ -2415,7 +2416,7 @@ function dialerSipMsg(omsg) |
| 2415 | try | 2416 | try |
| 2416 | { | 2417 | { |
| 2417 | console.log(omsg.ao_headers[6].s_name); | 2418 | console.log(omsg.ao_headers[6].s_name); |
| 2418 | if(omsg.ao_headers[6].s_name=='kstych-data') | 2419 | if(omsg.ao_headers[6].s_name=='kstych-data' || omsg.ao_headers[6].s_name=='kstych-Data') |
| 2419 | { | 2420 | { |
| 2420 | var vparts=omsg.ao_headers[6].s_value.split("|"); | 2421 | var vparts=omsg.ao_headers[6].s_value.split("|"); |
| 2421 | 2422 | ... | ... |
-
Please register or sign in to post a comment