Changed hangup logic as per the record table design
Showing
1 changed file
with
9 additions
and
29 deletions
| ... | @@ -664,33 +664,7 @@ class KPAMIListen implements IEventListener | ... | @@ -664,33 +664,7 @@ class KPAMIListen implements IEventListener |
| 664 | foreach ($userslist as $ulist) { | 664 | foreach ($userslist as $ulist) { |
| 665 | $crmcall->user_id=$ulist->id; | 665 | $crmcall->user_id=$ulist->id; |
| 666 | } | 666 | } |
| 667 | // if($crmcall->client==".") | 667 | |
| 668 | // { | ||
| 669 | // $wakka = new KHRMSLib(); | ||
| 670 | // $users=$wakka->searchPhone("mobile",$crmcall->number); | ||
| 671 | |||
| 672 | // if(!empty($users)) | ||
| 673 | // { | ||
| 674 | // $ppldata=unserialize($users[0]['peopledata']); | ||
| 675 | |||
| 676 | // $crmcall->crm_id=$users[0]['id']; | ||
| 677 | // $crmcall->number=$users[0]['mobile']; | ||
| 678 | // $crmcall->client=($ppldata['client']?$ppldata['client']:""); | ||
| 679 | // $crmcall->department=($ppldata['department']?$ppldata['department']:""); | ||
| 680 | |||
| 681 | // $wakka->setPersonKey($crmcall->crm_id,"dialer_lastcall",date("Y-m-d H:i:s")); | ||
| 682 | // echo $users[0]['id']." -- ID Found\n"; | ||
| 683 | // } | ||
| 684 | // else | ||
| 685 | // { | ||
| 686 | // $crmcall->crm_id=0; | ||
| 687 | // $crmcall->client=""; | ||
| 688 | // $crmcall->department=""; | ||
| 689 | // echo "User Not Found!!\n"; | ||
| 690 | // } | ||
| 691 | |||
| 692 | // $crmcall->save(); | ||
| 693 | // } | ||
| 694 | $crmcall->userstatus="InboundDROP"; | 668 | $crmcall->userstatus="InboundDROP"; |
| 695 | $crmcall->usersubstatus="InboundDROP"; | 669 | $crmcall->usersubstatus="InboundDROP"; |
| 696 | $crmcall->call_flag="Z"; | 670 | $crmcall->call_flag="Z"; |
| ... | @@ -699,12 +673,13 @@ class KPAMIListen implements IEventListener | ... | @@ -699,12 +673,13 @@ class KPAMIListen implements IEventListener |
| 699 | if($crmcall->crm_id>0) | 673 | if($crmcall->crm_id>0) |
| 700 | { | 674 | { |
| 701 | $wakka = new KHRMSLib(); | 675 | $wakka = new KHRMSLib(); |
| 702 | $record=$wakka->getPerson($crmcall->crm_id); | 676 | $record=$wakka->getPerson($crmcall->crm_id,$crmcall->client); |
| 703 | if($record) | 677 | if($record) |
| 704 | { | 678 | { |
| 705 | $record["peopledata"]["dialer_status"]="InboundDROP"; | 679 | $record["peopledata"]["dialer_status"]="InboundDROP"; |
| 706 | $record["peopledata"]["dialer_substatus"]="InboundDROP"; | 680 | $record["peopledata"]["dialer_substatus"]="InboundDROP"; |
| 707 | $wakka->setPerson($crmcall->crm_id,$record); | 681 | $wakka->setPerson($crmcall->crm_id,$record,$crmcall->client); |
| 682 | $wakka->setPerson($crmcall->crm_id,$record,""); | ||
| 708 | } | 683 | } |
| 709 | } | 684 | } |
| 710 | } | 685 | } |
| ... | @@ -1521,6 +1496,11 @@ class KPAMIListen implements IEventListener | ... | @@ -1521,6 +1496,11 @@ class KPAMIListen implements IEventListener |
| 1521 | 1496 | ||
| 1522 | $this->connectToAvailableSip($sipid, $dialline, $crmcall, $mode); | 1497 | $this->connectToAvailableSip($sipid, $dialline, $crmcall, $mode); |
| 1523 | } | 1498 | } |
| 1499 | else if($mode == "Incoming") | ||
| 1500 | { | ||
| 1501 | $newqueue=new Kqueue(); | ||
| 1502 | $newqueue->sipNotify($sipid,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,$crmcall->did); | ||
| 1503 | } | ||
| 1524 | } | 1504 | } |
| 1525 | } | 1505 | } |
| 1526 | } | 1506 | } | ... | ... |
-
Please register or sign in to post a comment