Commit 73af6fb2 authored by Kulya's avatar Kulya 😊

Status of peer from lastms

parent 49080ff4
...@@ -187,7 +187,7 @@ class AloVoiceActions ...@@ -187,7 +187,7 @@ class AloVoiceActions
$doCmds = $this->runAsteriskAction([ $doCmds = $this->runAsteriskAction([
'dnds' => new \PAMI\Message\Action\CommandAction('database show DND'), 'dnds' => new \PAMI\Message\Action\CommandAction('database show DND'),
'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/useragent,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact,peers/peer/lastms,peers/peer/lastms'), 'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers 1=1 peers/peer/cid_num,peers/peer/useragent,peers/peer/secret,peers/peer/lastms,peers/peer/fullcontact'),
// 'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers'), // 'peers' => new \PAMI\Message\Action\CommandAction('data get /asterisk/channel/sip/peers'),
'channels' => new \PAMI\Message\Action\CoreShowChannelsAction(), 'channels' => new \PAMI\Message\Action\CoreShowChannelsAction(),
'queues' => new \PAMI\Message\Action\QueueStatusAction(), 'queues' => new \PAMI\Message\Action\QueueStatusAction(),
...@@ -461,7 +461,8 @@ class AloVoiceActions ...@@ -461,7 +461,8 @@ class AloVoiceActions
if(in_array($arPeer["cid_num"],$dndPeers)){ if(in_array($arPeer["cid_num"],$dndPeers)){
$agStatus = 'dnd'; $agStatus = 'dnd';
} }
elseif(!empty($arPeer["lastms"])){ // elseif(!empty($arPeer["lastms"])){
elseif(!empty($arPeer["lastms"]) && $arPeer["lastms"]>0 && $arPeer["lastms"]<60000){
$agStatus = 'free'; $agStatus = 'free';
} }
} }
......
...@@ -2856,7 +2856,8 @@ CFU='; ...@@ -2856,7 +2856,8 @@ CFU=';
$leadContactLoadRes = BxRest::call("crm.contact.get",array( $leadContactLoadRes = BxRest::call("crm.contact.get",array(
'id' => $arLead['CONTACT_ID'] 'id' => $arLead['CONTACT_ID']
)); ));
self::eLog($leadContactLoadRes["result"]['IM'],"--== leadsLoadResult CONTACT Loeaded RES:"); $arIM = (!empty($leadContactLoadRes["result"]['IM'])) ? $leadContactLoadRes["result"]['IM'] : false;
self::eLog($arIM,"--== leadsLoadResult CONTACT Loeaded RES:");
if($leadContactLoadRes["result"]["HAS_IMOL"]){ if($leadContactLoadRes["result"]["HAS_IMOL"]){
if(!empty($leadContactLoadRes["result"]["IM"])){ if(!empty($leadContactLoadRes["result"]["IM"])){
foreach($leadContactLoadRes["result"]["IM"] as $ims){ foreach($leadContactLoadRes["result"]["IM"] as $ims){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment