dual load calling with pstnweb an webrtc
Showing
3 changed files
with
194 additions
and
89 deletions
| ... | @@ -239,58 +239,14 @@ class DialerController extends Controller | ... | @@ -239,58 +239,14 @@ class DialerController extends Controller |
| 239 | 239 | ||
| 240 | } | 240 | } |
| 241 | $wakka->setPersonKey($users[0]['id'], "status", "Incall"); | 241 | $wakka->setPersonKey($users[0]['id'], "status", "Incall"); |
| 242 | // $searchresult = '<div style="clear:both"></div><div id=divworking></div><div style="clear:both"></div>'; | 242 | |
| 243 | 243 | if (Auth::user()->sessiontype == '0') { | |
| 244 | if (!empty($users)) { | 244 | $webrtc=$this->webrtc($users,$callnumber,$client,$kstychDialer['mDialerState'],$kstychDialer['phone']); |
| 245 | if (sizeof($users) >= 1) { | 245 | return $webrtc; |
| 246 | if ($redial!="redial") { | 246 | }else{ |
| 247 | print_r($redial); | 247 | $pstnweb=$this->pstnweb($users,$callnumber,$client,$kstychDialer['mDialerState'],$kstychDialer['phone'],$redial,$enable); |
| 248 | 248 | return $pstnweb; | |
| 249 | |||
| 250 | $searchresult = "<div style='clear:both'></div><div id=divworking></div><div style='clear:both'></div><script>showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>"; | ||
| 251 | |||
| 252 | $searchresult .= "<script>kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');</script>"; | ||
| 253 | |||
| 254 | $searchresult .= "<div id=internalid_matchlist></div><script> | ||
| 255 | doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 256 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 257 | });</script>"; | ||
| 258 | } | ||
| 259 | $searchresult .="<script>doAjax('dialer?action=agentcall&users=" . urlencode(json_encode($users)) . "&callnumber=" . $callnumber . "&client=" . $client . "&mDialerState=" . $kstychDialer['mDialerState'] ."&kstychDialerphone=" . $kstychDialer['phone'] . "','','', 'ajax_manualdial','singlefail','POST',function(retstr){ | ||
| 260 | if(retstr.responseText=='hangup_agentcall'){ | ||
| 261 | kSetDData('C','callid','hangup_agentcall'); | ||
| 262 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 263 | simpleNotification('error','topRight','You Are Not Connected!'); | ||
| 264 | }else if(retstr.responseText=='NoFreeLines'){ | ||
| 265 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 266 | simpleNotification('error','topRight','No Lines Free to Dial!'); | ||
| 267 | }else if(retstr.responseText=='NoNumber'){ | ||
| 268 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 269 | simpleNotification('error','topRight','No Number in Record!'); | ||
| 270 | }else if(retstr.responseText=='MultipleRecords'){ | ||
| 271 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 272 | simpleNotification('error','topRight','Multiple Records Found!'); | ||
| 273 | createSearchRecordDiv('dialersearchbox'); | ||
| 274 | }else{ | ||
| 275 | var string = retstr.responseText.trim(); | ||
| 276 | if(string){ | ||
| 277 | var string1=string.split('&'); | ||
| 278 | var string2=string1[7].split('='); | ||
| 279 | console.log(string1); | ||
| 280 | console.log(string2[1]); | ||
| 281 | kSetDData('C','callid',string2[1]); | ||
| 282 | doAjax(retstr.responseText,'','', 'ajax_manualdial','singlefail','POST');}} | ||
| 283 | }); | ||
| 284 | </script>"; | ||
| 285 | |||
| 286 | return Response::make($searchresult); | ||
| 287 | } else { | ||
| 288 | return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 289 | } | ||
| 290 | } else { | ||
| 291 | return Response::make($searchresult .= "<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"); | ||
| 292 | } | 249 | } |
| 293 | |||
| 294 | } | 250 | } |
| 295 | if ($action == "agentcall") { | 251 | if ($action == "agentcall") { |
| 296 | $wakka = new KHRMSLib(); | 252 | $wakka = new KHRMSLib(); |
| ... | @@ -299,6 +255,7 @@ class DialerController extends Controller | ... | @@ -299,6 +255,7 @@ class DialerController extends Controller |
| 299 | $client = Input::get("client"); | 255 | $client = Input::get("client"); |
| 300 | $mDialerState = Input::get("mDialerState"); | 256 | $mDialerState = Input::get("mDialerState"); |
| 301 | $kstychDialerphone = Input::get("kstychDialerphone"); | 257 | $kstychDialerphone = Input::get("kstychDialerphone"); |
| 258 | |||
| 302 | if (!empty($users)) { | 259 | if (!empty($users)) { |
| 303 | if (sizeof($users) >= 1) { | 260 | if (sizeof($users) >= 1) { |
| 304 | $users[0]->peopledata = preg_replace_callback('!s:(\d+):"(.*?)";!', function ($m) { | 261 | $users[0]->peopledata = preg_replace_callback('!s:(\d+):"(.*?)";!', function ($m) { |
| ... | @@ -356,7 +313,7 @@ class DialerController extends Controller | ... | @@ -356,7 +313,7 @@ class DialerController extends Controller |
| 356 | $userstatus = true; | 313 | $userstatus = true; |
| 357 | break; | 314 | break; |
| 358 | } | 315 | } |
| 359 | sleep(15); | 316 | sleep(5); |
| 360 | } | 317 | } |
| 361 | break; | 318 | break; |
| 362 | } | 319 | } |
| ... | @@ -428,20 +385,11 @@ class DialerController extends Controller | ... | @@ -428,20 +385,11 @@ class DialerController extends Controller |
| 428 | $dialline->save(); | 385 | $dialline->save(); |
| 429 | 386 | ||
| 430 | $wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s")); | 387 | $wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s")); |
| 431 | //start actual calls | 388 | |
| 432 | // if (Auth::user()->sessiontype == '0') { | ||
| 433 | // $newqueue = new Kqueue(); | ||
| 434 | // $newqueue->userToConf($sipid); | ||
| 435 | // $newqueue = new Kqueue(); | ||
| 436 | // $newqueue->custToConf($sipid, $callnumber, $callerid, $crmcall, $dialline); | ||
| 437 | // } else { | ||
| 438 | // $newqueue = new Kqueue(); | ||
| 439 | // $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); | ||
| 440 | // } | ||
| 441 | $sipid = $sipid->toArray(); | 389 | $sipid = $sipid->toArray(); |
| 442 | 390 | ||
| 443 | $searchresult .= " | 391 | $searchresult .= " |
| 444 | dialer?action=dialcall&sipid=" . urlencode(json_encode($sipid)) . "&callnumber=" . $callnumber . "&callerid=" . urlencode(json_encode($callerid)) . "&crmcall=" . urlencode(json_encode($crmcall)) . "&sipid1=" . urlencode(json_encode($sipid)) . "&dialline=" . urlencode(json_encode($dialline)) . "&sipid1=" . urlencode(json_encode($crmcall->id)) . " | 392 | dialer?action=dialcall&sipid=" . urlencode(json_encode($sipid)) . "&callnumber=" . $callnumber . "&callerid=" . urlencode(json_encode($callerid)) . "&crmcall=" . urlencode(json_encode($crmcall)) . "&sipid1=" . urlencode(json_encode($sipid)) . "&dialline=" . urlencode(json_encode($dialline)). "&userid=" . urlencode(json_encode($users[0]->id)) . "&sipid1=" . urlencode(json_encode($crmcall->id)) . " |
| 445 | "; | 393 | "; |
| 446 | 394 | ||
| 447 | return Response::make($searchresult); | 395 | return Response::make($searchresult); |
| ... | @@ -461,36 +409,15 @@ class DialerController extends Controller | ... | @@ -461,36 +409,15 @@ class DialerController extends Controller |
| 461 | } else { | 409 | } else { |
| 462 | return Response::make($searchresult .= "<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"); | 410 | return Response::make($searchresult .= "<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"); |
| 463 | } | 411 | } |
| 464 | |||
| 465 | } | 412 | } |
| 466 | if ($action == "dialcall") { | 413 | if ($action == "dialcall") { |
| 467 | //echo(urldecode(Input::get("sipid1"))); | 414 | |
| 468 | //$t = explode("||",Input::get("sipid1")); | ||
| 469 | //$t0 = $t[0]; | ||
| 470 | |||
| 471 | // substr($string, 0, -1); | ||
| 472 | //echo (trim(html_entity_decode($t0),'"')); | ||
| 473 | //dd(html_entity_decode(Input::get("sipid1"))); | ||
| 474 | $sipid = json_decode(html_entity_decode(Input::get("sipid"))); | 415 | $sipid = json_decode(html_entity_decode(Input::get("sipid"))); |
| 475 | $callnumber = json_decode(html_entity_decode(Input::get("callnumber"))); | 416 | $callnumber = json_decode(html_entity_decode(Input::get("callnumber"))); |
| 476 | $callerid = json_decode(html_entity_decode(Input::get("callerid"))); | 417 | $callerid = json_decode(html_entity_decode(Input::get("callerid"))); |
| 477 | $crmcall = json_decode(html_entity_decode(Input::get("crmcall"))); | 418 | $crmcall = json_decode(html_entity_decode(Input::get("crmcall"))); |
| 478 | $dialline = json_decode(html_entity_decode(Input::get("dialline"))); | 419 | $dialline = json_decode(html_entity_decode(Input::get("dialline"))); |
| 479 | //dd($sipid, $callnumber, $callerid, $crmcall,$dialline, html_entity_decode(Input::get("dialline"))); | 420 | |
| 480 | //dd($sipid,$callnumber,$callerid,$crmcall,$dialline); | ||
| 481 | //dd(Input::get("sipid1")); | ||
| 482 | // $sipid = Input::get("sipid"); | ||
| 483 | // $callnumber = Input::get("callnumber"); | ||
| 484 | // $callerid = (object) Input::get("callerid"); | ||
| 485 | // $crmcall = Input::get("crmcall"); | ||
| 486 | // $dialline= Input::get("dialline"); | ||
| 487 | // $sipid = explode("-", $sipid); | ||
| 488 | // $sipid_key = ['id', 'server']; | ||
| 489 | // $crmcall_key = ['id']; | ||
| 490 | // $dialline_key = ['dialstr']; | ||
| 491 | // $sipid = (object) array_combine($sipid_key, $sipid); | ||
| 492 | // $crmcall = (object) array_combine($crmcall_key, $crmcall); | ||
| 493 | // $dialline = (object) array_combine($dialline_key, $dialline); | ||
| 494 | if (Auth::user()->sessiontype == '0') { | 421 | if (Auth::user()->sessiontype == '0') { |
| 495 | $newqueue = new Kqueue(); | 422 | $newqueue = new Kqueue(); |
| 496 | $newqueue->userToConf($sipid); | 423 | $newqueue->userToConf($sipid); |
| ... | @@ -500,6 +427,7 @@ class DialerController extends Controller | ... | @@ -500,6 +427,7 @@ class DialerController extends Controller |
| 500 | $newqueue = new Kqueue(); | 427 | $newqueue = new Kqueue(); |
| 501 | $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); | 428 | $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline); |
| 502 | } | 429 | } |
| 430 | return "true"; | ||
| 503 | } | 431 | } |
| 504 | if ($action == "addconfcall") { | 432 | if ($action == "addconfcall") { |
| 505 | $retstr = ""; | 433 | $retstr = ""; |
| ... | @@ -1596,4 +1524,181 @@ class DialerController extends Controller | ... | @@ -1596,4 +1524,181 @@ class DialerController extends Controller |
| 1596 | 1524 | ||
| 1597 | return $returnArray; | 1525 | return $returnArray; |
| 1598 | } | 1526 | } |
| 1527 | public function webrtc($users,$callnumber,$client,$kstychDialer_mDialerState,$kstychDialer_phone){ | ||
| 1528 | $wakka = new KHRMSLib(); | ||
| 1529 | if (!empty($users)) { | ||
| 1530 | if (sizeof($users) >= 1) { | ||
| 1531 | $users[0]['peopledata'] = preg_replace_callback('!s:(\d+):"(.*?)";!', function ($m) { | ||
| 1532 | return "s:" . strlen($m[2]) . ":\"" . $m[2] . "\";"; | ||
| 1533 | }, $users[0]['peopledata']); | ||
| 1534 | $ppldata = unserialize($users[0]['peopledata']); | ||
| 1535 | if (!isset($ppldata['client'])) $ppldata['client'] = ""; | ||
| 1536 | if (!isset($ppldata['department'])) $ppldata['department'] = ""; | ||
| 1537 | |||
| 1538 | if ($callnumber == "" || intval($callnumber) <= 0) $callnumber = $ppldata['mobile']; | ||
| 1539 | if ($callnumber != "" && intval($callnumber) > 0) { | ||
| 1540 | $mastersdata = $wakka->getCompanyMaster($ppldata['client']); | ||
| 1541 | $callerid = ""; | ||
| 1542 | if (!empty($mastersdata["DialerDID"])) $callerid = $mastersdata["DialerDID"]; | ||
| 1543 | if ($callerid == "") $callerid = Auth::user()->exten; | ||
| 1544 | |||
| 1545 | $calleridarr = explode(":", $callerid); | ||
| 1546 | $dspan = "1"; | ||
| 1547 | if (isset($calleridarr[1])) { | ||
| 1548 | $callerid = $calleridarr[0]; | ||
| 1549 | $dspan = $calleridarr[1]; | ||
| 1550 | } | ||
| 1551 | |||
| 1552 | //see if user is online on this sipid | ||
| 1553 | $userstatus = true; | ||
| 1554 | |||
| 1555 | $sipid = Sipid::find($kstychDialer_phone); | ||
| 1556 | |||
| 1557 | |||
| 1558 | //see if user is online on this sipid | ||
| 1559 | if ($userstatus) { | ||
| 1560 | if ($dspan == "1") { | ||
| 1561 | $dialline = Dialline::where("status", "=", "Free")->where("enabled", "=", "1"); | ||
| 1562 | if ($dspan != "") $dialline = $dialline->where('dspan', '=', '1')->where('id', '<=', '30'); | ||
| 1563 | $dialline = $dialline->orderBy('updated_at', 'ASC')->first(); | ||
| 1564 | } | ||
| 1565 | if (empty($dialline)) { | ||
| 1566 | $dialline = Dialline::where("status", "=", "Free")->where("enabled", "=", "1"); | ||
| 1567 | if ($dspan != "") $dialline = $dialline->where('dspan', '=', '2')->where('id', '>', '30'); | ||
| 1568 | $dialline = $dialline->orderBy('updated_at', 'ASC')->first(); | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | if ($dialline) { | ||
| 1572 | $dialline->status = "Blocked"; | ||
| 1573 | $dialline->user_id = Auth::user()->id; | ||
| 1574 | $dialline->number = $users[0]['mobile']; | ||
| 1575 | $dialline->regexstr = $client; | ||
| 1576 | $dialline->save(); | ||
| 1577 | |||
| 1578 | $nowts = microtime(true) * 1000; | ||
| 1579 | |||
| 1580 | //get ts_Wait | ||
| 1581 | $userlog = UserLog::where('user_id', '=', Auth::user()->id)->orderBy("id", "DESC")->first(); | ||
| 1582 | $ts_Wait = $userlog->getLastTs($sipid->id, $nowts); | ||
| 1583 | $userlog->save(); | ||
| 1584 | |||
| 1585 | //start the call log | ||
| 1586 | $crmcall = new CRMCall(); | ||
| 1587 | $crmcall->number = $callnumber; | ||
| 1588 | $crmcall->user_id = Auth::user()->id; | ||
| 1589 | $crmcall->sipid_id = $sipid->id; | ||
| 1590 | $crmcall->crm_id = $users[0]['id']; | ||
| 1591 | $crmcall->lan = $users[0]['lan']; | ||
| 1592 | //$crmcall->client=$ppldata['client']; | ||
| 1593 | $crmcall->client = $client; | ||
| 1594 | $crmcall->department = $ppldata['department']; | ||
| 1595 | $crmcall->state = 'New'; | ||
| 1596 | $crmcall->type = $kstychDialer_mDialerState; | ||
| 1597 | $crmcall->dialline_id = $dialline->id; | ||
| 1598 | |||
| 1599 | $crmcall->setTs('ts_Wait', $ts_Wait); | ||
| 1600 | $crmcall->setTs('ts_Call', $nowts); | ||
| 1601 | |||
| 1602 | $crmcall->did = $callerid; | ||
| 1603 | |||
| 1604 | $tdata = array(); | ||
| 1605 | $crmcall->data = json_encode($tdata); | ||
| 1606 | $crmcall->save(); | ||
| 1607 | |||
| 1608 | $dialline->call_id = $crmcall->id; | ||
| 1609 | $dialline->save(); | ||
| 1610 | |||
| 1611 | $wakka->setPersonKey($crmcall->crm_id, "dialer_lastcall", date("Y-m-d H:i:s")); | ||
| 1612 | |||
| 1613 | $sipid=$sipid->toArray(); | ||
| 1614 | $searchresult = "<div style='clear:both'></div><div id=divworking></div><div style='clear:both'></div><script>showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>"; | ||
| 1615 | $searchresult .= "<script>kSetDData('C','callid','" . $crmcall->id . "');kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');</script>"; | ||
| 1616 | |||
| 1617 | |||
| 1618 | |||
| 1619 | $searchresult .= "<div id=internalid_matchlist></div><script> | ||
| 1620 | doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 1621 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 1622 | }); | ||
| 1623 | |||
| 1624 | doAjax('dialer?action=dialcall&sipid=" . urlencode(json_encode($sipid)) . "&callnumber=" . $callnumber . "&callerid=" . urlencode(json_encode($callerid)) . "&crmcall=" . urlencode(json_encode($crmcall)) ."&sipid1=".urlencode(json_encode($sipid))."&dialline=" . urlencode(json_encode($dialline)) . "','','', 'ajax_manualdial','singlefail','POST'); | ||
| 1625 | </script>"; | ||
| 1626 | |||
| 1627 | |||
| 1628 | return Response::make($searchresult); | ||
| 1629 | } else { | ||
| 1630 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Lines Free to Dial!');</script>"); | ||
| 1631 | } | ||
| 1632 | } else { | ||
| 1633 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','You Are Not Connected!');</script>"); | ||
| 1634 | } | ||
| 1635 | } else { | ||
| 1636 | $wakka->setPersonKey($users[0]['id'], "status", "NoNumber"); | ||
| 1637 | |||
| 1638 | return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Number in Record!');</script>"); | ||
| 1639 | } | ||
| 1640 | } else { | ||
| 1641 | return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 1642 | } | ||
| 1643 | } else return Response::make($searchresult .= "<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"); | ||
| 1644 | } | ||
| 1645 | |||
| 1646 | public function pstnweb($users,$callnumber,$client,$kstychDialer_mDialerState,$kstychDialer_phone,$redial,$enable){ | ||
| 1647 | |||
| 1648 | if (!empty($users)) { | ||
| 1649 | if (sizeof($users) >= 1) { | ||
| 1650 | if ($redial!="redial") { | ||
| 1651 | $searchresult = "<div style='clear:both'></div><div id=divworking></div><div style='clear:both'></div><script>showRecruit(\"" . $users[0]['id'] . "\",\"" . $enable . "\");</script>"; | ||
| 1652 | |||
| 1653 | $searchresult .= "<script>kSetDData('C','crmid','" . $users[0]['id'] . "');kSetDData('C','callnumber','$callnumber');</script>"; | ||
| 1654 | |||
| 1655 | $searchresult .= "<div id=internalid_matchlist></div><script> | ||
| 1656 | doAjax('record?action=quicksearch','maintextsearch_1_txt=" . $users[0]['clientinternalid'] . "&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 1657 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 1658 | });</script>"; | ||
| 1659 | } | ||
| 1660 | $searchresult .="<script>doAjax('dialer?action=agentcall&users=" . urlencode(json_encode($users)) . "&callnumber=" . $callnumber . "&client=" . $client . "&mDialerState=" . $kstychDialer_mDialerState ."&kstychDialerphone=" . $kstychDialer_phone . "','','', 'ajax_manualdial','singlefail','POST',function(retstr){ | ||
| 1661 | if(retstr.responseText=='hangup_agentcall'){ | ||
| 1662 | kSetDData('C','callid','hangup_agentcall'); | ||
| 1663 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 1664 | simpleNotification('error','topRight','You Are Not Connected!'); | ||
| 1665 | }else if(retstr.responseText=='NoFreeLines'){ | ||
| 1666 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 1667 | simpleNotification('error','topRight','No Lines Free to Dial!'); | ||
| 1668 | }else if(retstr.responseText=='NoNumber'){ | ||
| 1669 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 1670 | simpleNotification('error','topRight','No Number in Record!'); | ||
| 1671 | }else if(retstr.responseText=='MultipleRecords'){ | ||
| 1672 | kstychCall['crmid']=0;kSetDData('C','previewcrmid',''); | ||
| 1673 | simpleNotification('error','topRight','Multiple Records Found!'); | ||
| 1674 | createSearchRecordDiv('dialersearchbox'); | ||
| 1675 | }else { | ||
| 1676 | var string = retstr.responseText.trim(); | ||
| 1677 | if(string){ | ||
| 1678 | var string1=string.split('&'); | ||
| 1679 | var string2=string1[8].split('='); | ||
| 1680 | var string4=string1[7].split('='); | ||
| 1681 | var string3=string1[2].split('='); | ||
| 1682 | console.log(string1); | ||
| 1683 | console.log(string2[1]); | ||
| 1684 | kSetDData('C','crmid',string4[1]); | ||
| 1685 | kSetDData('C','callnumber',string3[1]); | ||
| 1686 | kSetDData('C','callid',string2[1]); | ||
| 1687 | doAjax(retstr.responseText,'','', 'ajax_manualdial','singlefail','POST',function(retstr){ | ||
| 1688 | kSetDData('C','mCallState','Call'); | ||
| 1689 | kSetDData('C','ts_Call',getNowTS()); | ||
| 1690 | updateDialerState(); | ||
| 1691 | }); | ||
| 1692 | } } | ||
| 1693 | }); | ||
| 1694 | </script>"; | ||
| 1695 | |||
| 1696 | return Response::make($searchresult); | ||
| 1697 | } else { | ||
| 1698 | return Response::make($searchresult . "<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 1699 | } | ||
| 1700 | } else { | ||
| 1701 | return Response::make($searchresult .= "<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"); | ||
| 1702 | } | ||
| 1703 | } | ||
| 1599 | } | 1704 | } | ... | ... |
| ... | @@ -1143,13 +1143,13 @@ function updateDialerState(objstr,key,val,key2,val2) | ... | @@ -1143,13 +1143,13 @@ function updateDialerState(objstr,key,val,key2,val2) |
| 1143 | 1143 | ||
| 1144 | if(key=="dialnext" && val== "redial") | 1144 | if(key=="dialnext" && val== "redial") |
| 1145 | { | 1145 | { |
| 1146 | alert(val+"1"); | 1146 | |
| 1147 | outgoingCall(val); | 1147 | outgoingCall(val); |
| 1148 | 1148 | ||
| 1149 | } | 1149 | } |
| 1150 | if(key=="dialnext" && val== ""){ | 1150 | if(key=="dialnext" && val== ""){ |
| 1151 | 1151 | ||
| 1152 | alert(val+"2"); | 1152 | |
| 1153 | outgoingCall(); | 1153 | outgoingCall(); |
| 1154 | 1154 | ||
| 1155 | } | 1155 | } | ... | ... |
| ... | @@ -353,7 +353,7 @@ function doAjax(varUrl,dataStr,targetDiv,handleStr,ajaxType,ajaxtype,kcallback) | ... | @@ -353,7 +353,7 @@ function doAjax(varUrl,dataStr,targetDiv,handleStr,ajaxType,ajaxtype,kcallback) |
| 353 | } | 353 | } |
| 354 | else | 354 | else |
| 355 | { | 355 | { |
| 356 | if(kstychAppObject['config']['appdebug'])eval(response); | 356 | if(kstychAppObject['config']['appdebug']) response; |
| 357 | else | 357 | else |
| 358 | { | 358 | { |
| 359 | try{eval(response)}catch(e) | 359 | try{eval(response)}catch(e) | ... | ... |
-
Please register or sign in to post a comment