Created
December 7, 2019 01:12
-
-
Save ambiorixg12/4906f3653feb6de6f26089e6973642a0 to your computer and use it in GitHub Desktop.
FreePBX queue gosub and agi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/asterisk/globals_custom.conf | |
QAGI=/var/www/html/sound.php | |
QGOSUB=subCreateTicket,s,1 | |
/*AGI - Will setup an AGI script to be executed on the calling party's channel once they are connected to a queue member. */ | |
#!/usr/bin/php -q | |
<?php | |
include ("/var/www/html/phpagi-2.20/phpagi.php"); | |
$agi = new AGI(); | |
$agi->answer(); | |
//$agi->stream_file("im-sorry"); | |
$dstatus=$agi->get_variable("EXTEN"); | |
$agent=$agi->get_variable("MEMBERINTERFACE"); | |
$agi->verbose($dstatus['data']); | |
$agent= str_replace('/','',stristr(stristr($agent['data'], '@', true),'/')); | |
$agi->verbose($agent); | |
$agi->exec("sayalpha","$agent"); | |
?> | |
/* macro - Will run a macro on the called party's channel (the queue member) once the parties are connected. */ | |
[subCreateTicket] | |
exten=>s,1,Wait(1) | |
same=>n,Noop(${MEMBERINTERFACE}/ ${QAGENT}) | |
same=>n,Playback(demo-thanks) | |
same =>n,Return() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment