Good afternoon, evening or night, it all depends on the time of day in which you happened to read my article.
Continuation of the article
VoIP Server for a small company (FreePBX 14, Asterisk 15, Ubuntu 16.04) part 1.There is a need to link FreePBX and Samba 4, since we have Zentyal 5.0 everything will be described for it, I think it will not be difficult to adapt to your needs.
')
Let's start:
The integration mechanism is already built into FreePBX, but to activate it, it is necessary that PHP-LDAP support be installed in the system, so we put the dependency:
sudo apt install php5.6-ldap -y
Then we overload Apache and proceed directly to the configuration.
Go to the web interface FreePBX 14, Admin> User Manager> Directories tab

As we can see, we already have a “FreePBX Internal Directory” - this is the local FreePBX user base.
We are also interested in "Microsoft Active Directory". I already have an integration, so I'll show you the main points:

For myself, I chose updates every half hour. If you need to update immediately, I advise you to do it from the console:
fwconsole userman
I think it’s easy for anyone to configure the connection, but they look like this for me:

So, as I decided not to create manual Extensions, set up so that they are created automatically from the telephoneNumber attribute, you can set your option, here at discretion:

I did not change the user settings except the extreme attribute:

Also we will limit the groups that have access:

The integration is over, but then you can tweak for yourself.
If everything is done correctly, you will see the following:

Then you can assign rights to FreePBX, default actions, etc. to groups.
Extensions was also created, for my example it looks like this:

In fact, everything is simple, the main thing is the ability to read documentation.
PS In the management console Zentyal 5.0 there is no possibility to specify a phone number, for this we use the
LDAP Account Manager :
