Ashwin Parmar
Ashwin Parmar

Reputation: 3045

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

I have configured one Dialplan for Incoming context.

I have following in /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....

call-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.

?>

Upvotes: 0

Views: 3707

Answers (1)

arheops
arheops

Reputation: 15247

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.

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). If it return caller channel, you can get other channel by reading variable BRIDGEDPEER.

You can get list of all variables in channel by issue

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

Upvotes: 1

Related Questions