本文整理汇总了PHP中AGI_AsteriskManager::QueueStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP AGI_AsteriskManager::QueueStatus方法的具体用法?PHP AGI_AsteriskManager::QueueStatus怎么用?PHP AGI_AsteriskManager::QueueStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AGI_AsteriskManager
的用法示例。
在下文中一共展示了AGI_AsteriskManager::QueueStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_agent_status
function get_agent_status($queue, $agent)
{
global $queue_members;
# Connect to AGI
$asm = new AGI_AsteriskManager();
$asm->connect();
# Add event handlers to retrieve the answer
$asm->add_event_handler('queuestatuscomplete', 'Aastra_asm_event_queues_Asterisk');
$asm->add_event_handler('queuemember', 'Aastra_asm_event_agents_Asterisk');
# Retrieve info
while (!$queue_members) {
$asm->QueueStatus();
$count++;
if ($count == 10) {
break;
}
}
# Get info for the given queue
$status['Logged'] = False;
$status['Paused'] = False;
foreach ($queue_members as $agent_a) {
if ($agent_a['Queue'] == $queue && $agent_a['Location'] == 'Local/' . $agent . '@from-queue/n' or $agent_a['Queue'] == $queue && $agent_a['Location'] == 'Local/' . $agent . '@from-internal/n') {
$status['Logged'] = True;
if ($agent_a['Paused'] == '1') {
$status['Paused'] = True;
}
$status['Type'] = $agent_a['Membership'];
$status['CallsTaken'] = $agent_a['CallsTaken'];
$status['LastCall'] = $agent_a['LastCall'];
break;
}
# Get Penalty
$penalty = $asm->database_get('QPENALTY', $queue . '/agents/' . $agent);
if ($penalty == '') {
$penalty = '0';
}
$status['Penalty'] = $penalty;
}
# Disconnect properly
$asm->disconnect();
# Return Status
return $status;
}
示例2: Aastra_get_queue_entries_Asterisk
function Aastra_get_queue_entries_Asterisk($queue)
{
global $queue_entries;
# Connect to AGI
$asm = new AGI_AsteriskManager();
$asm->connect();
# Add event handlers to retrieve the answer
$asm->add_event_handler('queuestatuscomplete', 'Aastra_asm_event_queues_asterisk');
$asm->add_event_handler('queueentry', 'Aastra_asm_event_entries_Asterisk');
# Retrieve info
$count = 0;
while (!$queue_entries) {
$asm->QueueStatus();
$count++;
if ($count == 10) {
break;
}
}
# Process info
$index = 0;
if (count($queue_entries) > 0) {
foreach ($queue_entries as $entry) {
if ($entry['Queue'] == $queue) {
$entries[$index] = $entry;
$index++;
}
}
}
# Disconnect properly
$asm->disconnect();
# Return Status
if (isset($entries)) {
return $entries;
} else {
return NULL;
}
}
示例3: is_agent_logged
function is_agent_logged($agent)
{
global $queue_members;
$queue_members = '';
# Transcode for device and user mode
$agent = Aastra_get_userdevice_Asterisk($agent);
# Not logged by default
$return = False;
# Connect to AGI
$asm = new AGI_AsteriskManager();
$asm->connect();
# Add event handlers to retrieve the answer
$asm->add_event_handler('queuestatuscomplete', 'asm_event_queues');
$asm->add_event_handler('queuemember', 'asm_event_agents');
# Retrieve info
while (!$queue_members) {
$asm->QueueStatus();
$count++;
if ($count == 10) {
break;
}
}
# Get info for all the queues
foreach ($queue_members as $agent_a) {
if ($agent_a['Location'] == 'Local/' . $agent . '@from-queue/n' or $agent_a['Location'] == 'Local/' . $agent . '@from-internal/n') {
$return = True;
break;
}
}
# Disconnect properly
$asm->disconnect();
# Return Status
return $return;
}