有什么方法可以获取current_size
大于 0 的队列。
我想获得current_size
大于 0 的队列,我在系统中有数百个队列,所以我只想获得特定的队列。
这就是我所做的。我得到的队列为current_size
0。
function get_inprocess_queue_calls(){
if(!$this->input->is_ajax_request()){
exit('Direct access of script is not allowed');
}
require_once 'twilio/Twilio.php';
$twilio_result=$this->broswer_call_model->twilio_credentials();
$client = new Services_Twilio($twilio_result->twilio_accountId, $twilio_result->twilio_authtoken);
$queues = $client->account->queues->getIterator(0, 50,array("Status" => "in-progress"));
$i=0;
$data='';
foreach ($queues as $queue) {
if($queue->current_size>0){
$f_name = $queue->friendly_name;
if($f_name!=''){
$nameArr = array();
$nameArr = @explode('_', $f_name);
$leadId = $nameArr[3];
$from_number = $nameArr[0];
if(strpos($from_number, '+')!== false){
$lead_name = '';
if($leadId!=0){
$lead_record = $this->broswer_call_model->get_lead_details($leadId,$this->teamId,$this->leadTable);
if($lead_record!=0){
$lead_name = $lead_record->first_name.' '.$lead_record->last_name;
}
}
$fun_param1 = "'".$queue->friendly_name."'";
$fun_param2 = "'".$queue->sid."'";
$data.='<tr>
<td style="text-align: center;">'.$lead_name.'</td>
<td style="text-align: center;">'.$from_number.'</td>
<td style="text-align: center;">'.$queue->average_wait_time.'</td>
<td onclick="ConnectLead('.$fun_param1.','.$fun_param2.')" style="cursor:pointer; color:#0066FF; text-align: center;">Connect</td>
</tr>';
}
}
$i++;
}
}
echo json_encode(array('show_status'=>$i,'data'=>$data));
}
我想做的就像
$queues = $client->account->queues->getIterator(0, 50,array("Status" => "in-progress"));
或者喜欢
$queues = $client->account->queues->getIterator(0, 50,array("Current Size" => "> 0"));
任何帮助将非常感激
谢谢