You misunderstood what I was saying - the contents of the custom file are not included; I ran the debug as you requested and it did not show the extension in the buttons_custom.cfg file.
What I was saying is that the script definitely contains the code to call it (ie I have the current version), and the file definately exists, but the button does not appear.
How do I debug why buttons_custom.cfg file can't be loaded?
echo
if [ -f buttons_custom.cfg ]; then
cat buttons_custom.cfg
else
echo "there is no buttons_custom.cfg file"
echo "there is no buttons_custom.cfg file"
echo "there is no buttons_custom.cfg file"
echo "there is no buttons_custom.cfg file"
echo "there is no buttons_custom.cfg file"
echo "there is no buttons_custom.cfg file"
fi
But there is - here's the directory listing. I must be missing something simple.
-rw-r--r-- 1 root root 91 Aug 25 01:07 buttons_custom.cfg
root@pbx:/usr/local/fop2 $
OK I found if I changed the script to use the full path /usr/local/fop2/buttons_custom.cfg, the autoconfig freepbx script will now call the file correctly.
But I don't have any groups for users . . . that's what I keep saying.
Really! I have never defined a group for users. It's just the default settings. I can't figure out how to post a screenshot of my freepbx fop2 admin screen shot where it shows no groups are configured . . . but I have one to prove it if you want
Do not look at the fop2admin screen, but at the output from autoconfig-users-freepbx.sh script, that way you know for sure if you have groups assigned or not, look for the user=xxx lines, the 4th parameter is the group.
In any case, if your button config shows when you run autoconfig-buttons-freepbx.sh and you do not see it in the fop2 screen (after reloading fop2, if you change your button config you must reload fop2 server and also relogin to the web client), it is probably there is something missing or incorrect in the button definitions themselves, from what I read about your sample, it is correct, so it should show. It is mandatory to set the type, the type must be valid (type=extension), and you also must put the extension, context and label values. If one of them is missing , the button will not show.
Also, be sure you are using the registered version so you are not bitten by the 15 buttons limit of the free version.
I gave up trying to get this working, but I am upgrading to the new version and thought I'd try again.
Does the AMI manager user and secret need to be the same on the external server for it to work? In other words, how does it query the external server for status?
Passwords can differt, there is no reason to make them the same, you can specify any password, host, user, port, etc.
Making this work is not hard at all, but fop2 restrictions might come into play for displaying the buttons ON THE WEB BROWSER, not so when running the autoconfiguration script as I suggested above.
If you see the buttons when running the autoconfig script, but not on the browser, then your limitation is for buttons groups assigned to users, as custom buttons will not be placed into groups.
The new version will work the same as the old one, just try to catch me on the live help and I will guide you on making it work.
I have FOP2 registered and set up to monitor two servers and because I am using FreePBX, I have to define buttons for these users manually using the "server=" value.
When I run autoconfig-users-freepbx.sh, it does show that it is parsing the buttons_custom.cfg file, but the custom buttons do not show in FOP. I originally tried with no groups set in FreePBX, then I tried setting up a group ("ALL") and manually joining that button to it using a "group=ALL" value, but it still does not show up. I have ensured that the user I am logging into FOP2 as, is able to see that group.
The test extension in buttons_custom.cfg looks like the following:
[SIP/${XXXX}]
type=extension
extension=${XXXX}
context=from-internal
label=${LABEL}
server=${HOST_IP}
With an optionally added "group=ALL" for after I tried creating a group to see if that would help.
Any information as to why I can't get these buttons to show up would be appreciated.
There are 2 things to check. That the include of the custom button config file has a full path (if you run fop2 from the init script, an #include buttons_custom.cfg will probably fail, while #include /usr/local/fop2/buttons_custom.cfg will work).
The other thing to check is still the groups. If you want to see custom buttons, your fop2 user should not have ANY groups clicked on the fop2 users page in Fop2admin. You have to check that by running:
/usr/local/fop2/autoconfig-users-freepbx.sh
you should have something like
user=100:100:all
if you have
user=100:100:all:somegroup
you will face issues unless somegroup includes the buttons for the custom config file, and as somegroup is autogenerated, *it will not contain anything!*.
I got it working now, however how I did it was not what I expected. It looks like when you set FOP2 to connect to multiple servers, if you build the extensions as a mirror on both servers, FOP2 picks up hints from whichever is actually registered/active. There is no need to create any custom buttons using the "server=" value what so ever.
The added advantage is I can also use display groups without it affecting the visibility of the buttons. I don't know if this will work for others, but this might help people who are having issues with the FreePBX admin module and monitoring multiple servers.
You cannot have a button for SIP/100 on server A and another button for SIP/100 on server B. FOP2 will group activity for SIP/100 no matter the server it is located.
This is why you cannot monitor DAHDI trunks on multiple servers for examples, let alone DAHDI extensions. Well, you can, but you cannot do that discretely.
Comments
Problem with buttons_custom.cfg is that if you define groups for users, they won't show up as they will not appear in the group definitions.
To see if the file is being incuded or not, just run
/usr/local/fop2/autoconfig-buttons-freepbx.sh
and eximine the output, does it show?
I don't have any groups for users at all, so that's not an issue.
It's not being included. Yet, here's the last few lines of the script.
echo
if [ -f buttons_custom.cfg ]; then
cat buttons_custom.cfg
fi
And the /usr/local/fop2 folder I have it stored in ls - output
-rw-r--r-- 1 asterisk asterisk 91 Aug 25 01:07 buttons_custom.cfg
/usr/local/fop2/autoconfig-buttons-freepbx.sh
look at the output, is the contents of your custom file displayed? If it is , then the file IS being include, if it is not then no.
What I was saying is that the script definitely contains the code to call it (ie I have the current version), and the file definately exists, but the button does not appear.
How do I debug why buttons_custom.cfg file can't be loaded?
then execute it and look at the output.
But there is - here's the directory listing. I must be missing something simple.
-rw-r--r-- 1 root root 36 Aug 24 00:03 autobuttons.cfg
-rw-r--r-- 1 asterisk asterisk 36 Jun 23 13:35 autobuttons.cfg.~1~
-rwxr-x--x 1 root root 7889 Aug 26 00:19 autoconfig-buttons-freepbx.sh
-rwxr-x--x 1 asterisk asterisk 7588 Jun 23 13:35 autoconfig-buttons-freepbx.sh.~1~
-rwxr-x--x 1 root root 3032 Aug 24 00:03 autoconfig-users-freepbx.sh
-rwxr-x--x 1 asterisk asterisk 2444 Jun 23 13:35 autoconfig-users-freepbx.sh.~1~
-rw-r--r-- 1 root root 74974 Jun 23 18:31 borrame.log
-rw-r--r-- 1 root root 1032 Aug 24 00:03 buttons.cfg.sample
-rw-r--r-- 1 asterisk asterisk 1032 Jun 23 13:35 buttons.cfg.sample.~1~
-rw-r--r-- 1 root root 91 Aug 25 01:07 buttons_custom.cfg
-rw-r--r-- 1 root root 122 Aug 24 00:03 extensions_override_freepbx.conf
-rw-r--r-- 1 asterisk asterisk 6569 Jun 23 13:35 extensions_override_freepbx.conf~
-rw-r--r-- 1 asterisk asterisk 3001 Jun 23 13:35 FOP2Callbacks.pm
-rw-r--r-- 1 root root 3001 Aug 24 00:03 FOP2Callbacks.pm.sample
-rw-r--r-- 1 asterisk asterisk 5184 Jul 25 15:55 fop2.cfg
-rw-r--r-- 1 root root 6200 Aug 24 00:03 fop2.cfg.new
-rw-r--r-- 1 root root 77 Aug 24 00:03 fop2.lic
-rw-r--r-- 1 root root 77 Jun 23 13:51 fop2.lic.~1~
-rwxr-x--x 1 root root 8410474 Aug 24 00:03 fop2_server
-rw-r--r-- 1 root root 7168 Aug 25 23:35 fop2settings.db
-rwxr-x--x 1 root root 8219 Aug 24 00:03 generate_override_contexts.pl
-rw-r--r-- 1 root root 5230 Aug 24 00:00 NEWFOPmezFEJ
-rwxr-xr-x 1 root root 6934 Aug 24 00:03 recording_fop2.pl
-rwxr-xr-x 1 root root 6271 Aug 24 00:03 tovoicemail.pl
root@pbx:/usr/local/fop2 $
OK I found if I changed the script to use the full path /usr/local/fop2/buttons_custom.cfg, the autoconfig freepbx script will now call the file correctly.
Except it still doesn't show up in the panel.
What's my next step?
Really! I have never defined a group for users. It's just the default settings. I can't figure out how to post a screenshot of my freepbx fop2 admin screen shot where it shows no groups are configured . . . but I have one to prove it if you want
In any case, if your button config shows when you run autoconfig-buttons-freepbx.sh and you do not see it in the fop2 screen (after reloading fop2, if you change your button config you must reload fop2 server and also relogin to the web client), it is probably there is something missing or incorrect in the button definitions themselves, from what I read about your sample, it is correct, so it should show. It is mandatory to set the type, the type must be valid (type=extension), and you also must put the extension, context and label values. If one of them is missing , the button will not show.
Also, be sure you are using the registered version so you are not bitten by the 15 buttons limit of the free version.
Does the AMI manager user and secret need to be the same on the external server for it to work? In other words, how does it query the external server for status?
Passwords can differt, there is no reason to make them the same, you can specify any password, host, user, port, etc.
Making this work is not hard at all, but fop2 restrictions might come into play for displaying the buttons ON THE WEB BROWSER, not so when running the autoconfiguration script as I suggested above.
If you see the buttons when running the autoconfig script, but not on the browser, then your limitation is for buttons groups assigned to users, as custom buttons will not be placed into groups.
The new version will work the same as the old one, just try to catch me on the live help and I will guide you on making it work.
I am having a similar issue.
I have FOP2 registered and set up to monitor two servers and because I am using FreePBX, I have to define buttons for these users manually using the "server=" value.
When I run autoconfig-users-freepbx.sh, it does show that it is parsing the buttons_custom.cfg file, but the custom buttons do not show in FOP. I originally tried with no groups set in FreePBX, then I tried setting up a group ("ALL") and manually joining that button to it using a "group=ALL" value, but it still does not show up. I have ensured that the user I am logging into FOP2 as, is able to see that group.
The test extension in buttons_custom.cfg looks like the following:
[SIP/${XXXX}]
type=extension
extension=${XXXX}
context=from-internal
label=${LABEL}
server=${HOST_IP}
With an optionally added "group=ALL" for after I tried creating a group to see if that would help.
Any information as to why I can't get these buttons to show up would be appreciated.
Thank you,
There are 2 things to check. That the include of the custom button config file has a full path (if you run fop2 from the init script, an #include buttons_custom.cfg will probably fail, while #include /usr/local/fop2/buttons_custom.cfg will work).
The other thing to check is still the groups. If you want to see custom buttons, your fop2 user should not have ANY groups clicked on the fop2 users page in Fop2admin. You have to check that by running:
/usr/local/fop2/autoconfig-users-freepbx.sh
you should have something like
user=100:100:all
if you have
user=100:100:all:somegroup
you will face issues unless somegroup includes the buttons for the custom config file, and as somegroup is autogenerated, *it will not contain anything!*.
I got it working now, however how I did it was not what I expected. It looks like when you set FOP2 to connect to multiple servers, if you build the extensions as a mirror on both servers, FOP2 picks up hints from whichever is actually registered/active. There is no need to create any custom buttons using the "server=" value what so ever.
The added advantage is I can also use display groups without it affecting the visibility of the buttons. I don't know if this will work for others, but this might help people who are having issues with the FreePBX admin module and monitoring multiple servers.
Thanks,
FOP2 does not discretely monitor same device name across multiple servers. It was mentioned many times in the forum:
View Post 495
You cannot have a button for SIP/100 on server A and another button for SIP/100 on server B. FOP2 will group activity for SIP/100 no matter the server it is located.
This is why you cannot monitor DAHDI trunks on multiple servers for examples, let alone DAHDI extensions. Well, you can, but you cannot do that discretely.
Best regards,