Well after finding that I could launch fop2_server in debug mode, I was able to watch some commands and look over existing plugins to come up with this... I could not get it to upload through web interface though so I just placed it in plugins folder.
This works with FreePBX generated hints for Ext/Queue toggle keys. (*45<exten>*<queue>). I make no guarantees outside of my setup :geek: I will share for others through, maybe can use as is, modify for your setup or use it for inspiration to take over the world.
All of these I placed a folder called queuehintfpbx inside of /var/www/html/fop2/admin/plugins then in the FOP2 Manager went to Plugins and enabled it. Not sure if necessary, but seemed so, I reloaded FOP2 service.
queuehintfpbx.pl
# file: queuehintfpbx.pl
# For Queue Add
$AMI_Event_Handler{'queuehintfpbx'}{'QUEUEMEMBERADDED'} = sub {
my $event = shift;
my @allreturn = ();
my $return = '';
my $exten = ${$event}{'Location'};
my $queue = ${$event}{'Queue'};
$exten =~ s/[^0-9]//g;
$return = "Action: Command\r\n";
$return .= "Command: devstate change Custom:QUEUE$exten*$queue INUSE\r\n";
$return .= "\r\n";
push @allreturn, $return;
return @allreturn;
};
#For Queue Remove
$AMI_Event_Handler{'queuehintfpbx'}{'QUEUEMEMBERREMOVED'} = sub {
my $event = shift;
my @allreturn = ();
my $return = '';
my $exten = ${$event}{'Location'};
my $queue = ${$event}{'Queue'};
$exten =~ s/[^0-9]//g;
$return = "Action: Command\r\n";
$return .= "Command: devstate change Custom:QUEUE$exten*$queue NOT_INUSE\r\n";
$return .= "\r\n";
push @allreturn, $return;
return @allreturn;
};
queuehintfpbx.js
plugins['queuehintfpbx'] = (function() {
return {
loadLang: function(values) {
},
setLang: function() {
},
init: function() {
}
}
}());
plugin.xml
<plugin>
<rawname>queuehintfpbx</rawname>
<name>Queue Hint Update Integration</name>
<version>0.9.8</version>
<description>Queue Add/Remove Hint Updates for Queues</description>
<description-es_ES></description-es_ES>
<engine>freepbx</engine>
<changelog>
*0.9.8* Initial Release
</changelog>
</plugin>
I have an empty queuehintfpbx.css file and an empty lang folder.