简体   繁体   English

如何使用AGI从呼叫队列(星号拨号计划)中获取接收者详细信息?

[英]How to get Receiver details from Call Queue (Asterisk Dialplan) using AGI?

I have configured one Dialplan for Incoming context. 我已经为传入上下文配置了一个Dialplan。

I have following in /etc/asterisk/extensions.conf 我在/etc/asterisk/extensions.conf中有以下内容

[incoming]
switch => Realtime

exten => _X.,1,NoOp(Incoming Call Received)
exten => _X.,n,Festival(Welcome to Asterisk)
exten => _X.,n,Answer()

;call-answer.php will be called when Member Connected to Queue
exten => _X.,n,Queue(my_queue,t,,,1000,call-answer.php)
exten => _X.,n,Hangup()

I would like to get Caller Information who has ANSWERED Queue and get Called Queue Member information like extension id etc.... 我想获取具有ANSWERED队列的呼叫者信息,并获取诸如分机ID等的被叫队列成员信息。

call-answer.php 呼叫-answer.php

#!/usr/bin/env php
<?php
set_time_limit(60);
error_reporting(0);
ini_set('display_errors', 0);

require_once ('phpagi.php');
$agi = new AGI();
$agi->verbose("AGI Started after ANSWERED QUEUE",3);
$src_extension = $agi->request['agi_callerid'];
$dst_extension = $agi->request['agi_extension'];

// I want to get CALL ANSWERED QUEUE MEMBER EXTENSION NUMBER HERE.

?>

This one line have error(no priority) 这一行有错误(无优先级)

exten => _X.,Festival(Welcome to Asterisk)

You can get info about who answered in QueueLog, no need agi for that. 您可以在QueueLog中获取有关谁回答的信息,而无需agi。

http://www.voip-info.org/wiki/view/Asterisk+log+queue_log http://www.voip-info.org/wiki/view/Asterisk+log+queue_log

Also function CHANNEL(name) for sure will show you agent in macro or other side(caller). 还可以使用CHANNEL(name)函数来确保在宏或另一端(调用方)向您显示代理。 If it return caller channel, you can get other channel by reading variable BRIDGEDPEER. 如果返回呼叫者频道,则可以通过读取变量BRIDGEDPEER获得其他频道。

You can get list of all variables in channel by issue 您可以按问题获取频道中所有变量的列表

$agi->exec("Dumpchan","");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM