Hello all!
This is a combination question / tutorial for how to monitor extensions on multiple servers (since the way we have it set up is almost certainly not ideal). My colleague and I set out today to try to get FOP2 to be able to monitor extensions on other FreePBX servers. Referring to the documentation at http://www.fop2.com/documentation-confi ... ngMultiple showed that it should be as simple as adding additional parameters in /usr/local/fop2/fop2.cfg, specifically:
manager_host = manager_port = manager_user = manager_secret =
for each other server you want to monitor. However, it's not quite that easy. While that does connect you to the AMI of the other server (assuming you use remote_mgr as the manager_user; we couldn't get it to work with admin), it doesn't make any buttons for you to monitor. The script /usr/local/fop2/autoconfig-buttons-freepbx.sh won't make the buttons either, even if you define buttons in /usr/local/fop2/buttons_custom.cfg (which gets run at the end of /usr/local/fop2/autoconfig-buttons-freepbx.sh if it exists)... or rather, it will (maybe, still not sure on that), but you can't see it because it's not part of any groups, and since users see what they see on FOP2 based on what groups they're allowed to view, it will never show up for anyone. So you need to make it part of a group, which gets done in /usr/local/fop2/autoconfig-users-freepbx.sh.
Basically, you can see what happens when you run /usr/local/fop2/autoconfig-users-freepbx.sh (or /usr/local/fop2/autoconfig-buttons-freepbx.sh for that matter); it just generates a bunch of text from God knows where (it's all detailed in the script itself but there was no way I could read it all). Presumably, when you restart FOP2 with
service fop2 restart
it runs /usr/local/fop2/fop2.cfg, which in turn runs /usr/local/fop2/autoconfig-users-freepbx.sh, which in turn runs /usr/local/fop2/autobuttons.cfg, which all that does is run /usr/local/fop2/autoconfig-buttons-freepbx.sh, which basically generates a ton of specially formatted text and sends it off somewhere, somehow. So at this point all we knew was that, based on the text output of /usr/local/fop2/autoconfig-users-freepbx.sh, groups were probably defined there. So in our case, what we did was defined a group manually at the end of that script and then manually defined a user at the end of that script that belonged to that group. Basically, in /usr/local/fop2/autoconfig-users-freepbx.sh:
[original_script] Lots of scripting [/original_script] group=allLocalAndRemote:[Put all the extensions you'd like to monitor here, both local and remote, in the format of SIP/1234] user=[extension]:[password]:[FOP2permissions]:allLocalAndRemote
So yours might look like:
[original_script] Lots of scripting [/original_script] group=allLocalAndRemote:SIP/1234, SIP1235, SIP/1236, SIP/2001 user=1235:5321:all:allLocalAndRemote
where 1235 is your extention and 2001 is an extension on a remote server. So what this does is it makes the remote extension 2001 part of the allLocalAndRemote group (along with all those other extensions including yours) and then the next line specifically defines you as a user with the ability to view the allLocalAndRemote group. Now of course /usr/local/fop2/buttons_custom.cfg has to have your button(s) defined like so:
[SIP/2001] type=extension extension=2001 context=from-internal label=remote-extension-name privacy=none server=ip-of-remote-server
and some of those fields are probably just wrong, like maybe context=from-internal, but it works well enough that the button actually shows up for whoever you defined as a user at the end of /usr/local/fop2/autoconfig-users-freepbx.sh (in the example, it was 1235).
So that's how we got it done, and while we know that cannot possibly be the right way to do it, we couldn't find a better way (yet). If anyone knows of a better way, please please let us know here.