The topic of unified communications is becoming increasingly relevant now. Remote interaction between users goes beyond simple voice communication or e-mail exchange. The solution from Microsoft - Lync Server 2013 offers the user various types of such interactions - from exchanging short messages to organizing video conferencing.
This article will discuss the integration of the so-called “Lync-phone” from Aastra into the existing infrastructure of MS Lync 2013 server. The purpose of this integration is to provide another convenient service for the user - a desk telephone fully integrated with his account in Lync 2013, which , at the same time, is a domain user.
Two terminals from the manufacturer Aastra - models Aastra 6725ip and Aastra 6721ip will be considered. Outwardly, both devices look very similar, the difference is that the older model, the 6725ip, has a USB port for connecting to your work computer, thus, full integration with the Lync client running on it is achieved, you can receive calls as a headset. and raising the tube at the terminal. The 6721ip terminal does not have a USB cable; accordingly, it is advisable to use it in common access areas - reception, meeting rooms, etc., where making a basic call is sufficient. On the 6721ip model, a number of functions will not be available, such as: voice mail, calendar, call log.

As mentioned above, these terminals are Lync-phone and have a sticker “Optimized for Microsoft Lync”, as well as a number of models from other manufacturers. They are not classic SIP-terminals, that is, they can not be connected to the usual IP-PBX due to the fact that they do not contain in their firmware (firmware) the classic G.711 / G.729 codecs. In fact, the firmware of this terminal is a lync-client, and accordingly, it contains the proprietary RT-Audio codec, which uses MS Lync Server 2013 for voice encoding. For the same reason, it is impossible to connect a regular SIP terminal to MS Lync server.
')
One of the features of this type of terminal is that it has almost no settings on it - it receives the entire configuration from the MS Lync server. In fact, the user can change only the time / date format, as well as the language (most of the world languages, including Russian, are already present in the firmware, even if your MS Lync server is not localized). Therefore, directly connecting the terminal to the staffing network is as simple as possible and is described in the official manual, which can be obtained from aastra.com. It actually comes down to explaining how to connect a USB cable to a computer and enter your username and password. But from the administrator’s side, things are not at all so simple and trivial, which will be discussed in this article.
Description of the laboratory setup
As a laboratory setup, we will use virtual servers deployed under vmWare ESXi 5.1.
MS Lync 2013 Server Front End is deployed on a virtual machine with 4 CPUs, 4 GB of memory. The operating system used is Windows 2012 Server Enterprise. The test lab setup used the free Evaluation version of MS Lync 2013 Server, which works 180 days fully functional. It is available for download from the Microsoft site after filling out a small questionnaire.
As you know, for the operation of MS Lync 2013 Server, you need to have a domain controller, a server of certificates and a DNS server in the corporate network. All these roles are simultaneously deployed on another virtual server, with the same characteristics as the server for Lync, and Windows 2012 Server Enterprise is also used as the OS.
This article will not address issues of starting the Lync 2013 server and its binding, we will assume that we already have all the necessary infrastructure described above, and the Lync 2013 soft clients can interact with each other. The task is to integrate the Aastra 6725ip and Aastra 6721ip terminals into this installation, which are also available in our demo laboratory Treolan, one each.
Also, the HP 4510S laptop with Windows 7 Enterprise is used as a terminal for setting up and running the Lync 2013 soft client (the Lync 2013 Basic soft client will not run on a Windows version lower than 7, since it is part of MS Office 2013).

Configuring the role of the DHCP server
In my opinion, the main difficulty in introducing lync-terminals into the existing infrastructure is such an unclear, at first glance, operation as the need for advanced configuration of the DHCP server. The fact is that, as previously mentioned, the terminals are not user-configurable in principle, in its settings you cannot find the menu item for entering the IP address or the SIP-registrar address, ports for which they are to interact, and other settings inherent in regular SIP terminal
Also, they do not have a web interface setting. All this information must be delivered to the terminal via DHCP options. If with classic DHCP options such as IP, mask, gateway, DNS, there are usually no issues (perhaps your network already has a DHCP server distributing these options), then in this case, via DHCP, you also need to inform lync terminals Lync server address and address where to get the certificate (CA). To do this, you need to use options 43 and 120. But if there are no problems with option 43, then from 120 it is more and more difficult as it needs to be filled in a binary format. The developers of MS Lync decided to simplify this task to the Lync server administrators and made the DHCPUtil.exe utility and the DHCPConfigScript.bat script, which can be found in the C: \ Program Files \ Common Files \ Microsoft Lync Server 2013 folder if you installed the default server. Move these two files to our DHCP server at any place. This utility and script only configure options 43 and 120. The rest of the options are configured in the standard way, after running the DHCP-server role. In my case, on the same server where AD DS, AD CS and DNS roles are installed.
Run the DHCP server configuration utility (in the Start 2012 Windows button menu) and right-click on IPv4 create a new Scope:

We set the range from which the addresses will be given to the telephones:

Set the default gateway and in the following (not reduced window) DNS server address:

Check options:

Next, you need to configure options 43 and 120 using DHCPUtil.exe. The only thing I could not find information about anywhere is that to run DHCPUtil.exe you need two files from Visual Studio, that is, if the server on which you are deploying the DHCP role did not have Visual Studio, running the utility will result to an error. Moreover, if you start it right away from PowerShell, nothing will happen at all, and when you start it from the GUI you will get a warning about the absence of the necessary msvcp110.dll and msvcr110.dll files. You can take these files from the server on which your MS Lync Server 2013 is installed (because when it was installed, Visual Studio was installed) from the C: \ windows \ system32 folder and place them in the same folder on your DHCP server.
Run the DHCPUtil.exe utility in PowerShell with the following keys:
.\DHCPUtil.exe –SipServer lyncserver.demolab.net –RunConfigScript
In the –SipServer key, specify the FQDN of our MS Lync 2013 server
The –RunConfigScript key runs the actual script (the second .bat file), which will do all the necessary manipulations and change the options we need in the DHCP server.
The result of the utility is as follows:

Go to the DHCP settings, right-click to make a refresh:

Make sure that all the necessary options are in place:

This completes the DHCP server settings.
User settings in MS Lync Server for connecting terminals
Settings for users are made as usual in MS Lync Server 2013 Control Panel, section USERS:

Going to the user's properties with the Edit -> Show details button, we will make sure that the user has the “Enterprise voice” option in the Telephony section - this is a necessary property of the user to use his telephone set. The "Enterprise voice" functionality in the paid version is licensed separately. You should also give this user an additional numeric number in the Line URI. For example, like this: tel: 555.
The next mandatory moment of connecting the terminal to the user profile is setting the PIN. This is done with the Action button on the corresponding user, then Set Pin ...:

It was the turn of the direct inclusion of the terminals. If the terminals are not new out of the box, then it is better to reset them to the factory settings. Resetting to factory settings may be useful in the future. There are two options for resetting - Factory reset and Hard reset.
Factory reset - reset up to the factory firmware (full), performed by pressing and holding the keys 4 and 6 before feeding to the power terminal. After powering up, wait a few seconds until the corresponding inscription appears on the terminal screen, after which you can release the keys and follow the prompts on the screen.
Hard reset - keys * and # - reset user data only (numbers, pin).
After these steps, you can go directly to connecting the Aastra 6725ip terminal to our laptop running the Lync client using a USB cable, as written in the brief guide on the vendor's website (www.aastra.com). That is, turn on the power (optionally using a power supply or via PoE), connect the USB cable to the computer, as it will be shown to us on the terminal screen:

After a connection is detected, a request to enter credentials appears on the computer screen. Then the process of entering the terminal system begins:

This is how the terminal screen looks after the logged in:

Everything, now it is possible to make calls. In the lower left part of the Lync client's main window on your computer, you can change the main audio device - you can change the headset to Aastra 6725ip.
For the 6721ip terminal, which does not have a USB port, the connection steps are slightly different. Log in to the system by entering your PIN and internal phone number.
In the welcome window, select "No", since in this case we will not have an accessible computer:

Enter your phone number and then PIN:
The installation of the terminals Aastra 6725ip and Aastra 6721ip is completed on this.
Terminal software update after installation
The firmware for the terminals is constantly being improved, so it makes sense when you first start up to work, immediately update the firmware of the device to the latest version. You can get the firmware on the Microsoft website (and not the manufacturer of the device), because in fact, as noted earlier, the firmware is a client of Lync.
At the time of this writing, fresh software for Aastra terminals could be obtained from the link:
http://www.microsoft.com/ru-ru/download/details.aspx?id=18390
The update is a UCUpdates.exe file. Here on the site there is quite detailed installation instructions.
This exe file is an archive, it contains the UCUpdates.cab cab file, it should be placed on our Lync Server 2013 in any folder, for example C: \ Aastra \ UCUpdates.cab
Next, go to the Lync Server Management Shell command line and run the following command:
Import-CsDeviceUpdate -Identity "WebServer:lyncserver.demolab.net" -FileName C:\Aastra\UCUpdates.cab
- in my case, after WebServer, the Identity of my server goes, so here you need to substitute the necessary address.
After that, in the Lync Server 2013 Control Panel, in the Clients -> Device Update section, we will see available updates:

Such a large number of updates due to the fact that in one UCUpdates.cab file there are updates for both 6721ip, 6725ip of all three Hardware Revisions,
that is, in this case we see six lines. If we extend the scroll to the right, we will see the designations of these revisions in the last column:

Next on the necessary revision (and you can at all at once) choose Action -> Approve, after which the phones should reboot themselves after a while and update their firmware. Or you can speed up the process of rebooting or even hard reset the device. In any case, it should take some time until it updates the firmware.
The hardware revision release version of your terminal can be viewed from the bottom of the terminal on a sticker with bar codes:

In this case, version A (HWREV: A).
Software upgrades are best done during off-hours. This process can lead to the simultaneous downloading by the terminals of the firmware and their mass rebooting, which, in turn, can lead to an excessive load on your network infrastructure in case of a large number of terminals.