Lync Server 2010 & Mitel Direct SIP Connectivity

I recently performed a direct SIP trunk integration between a Mitel SX3300 PBX and Microsoft Lync Server 2010. Mitel have published a technical reference for direct SIP connectivity with Lync Server 2010, however this predominantly focuses on the configuration of the SIP trunk from the Mitel side as you would probably expect and the technical reference does not go into detail about what configuration is required in Lync Server 2010 in order to establish connectivity. The following information focuses on the Lync Server 2010 configuration for direct SIP connectivity and does not discuss the Mitel SIP or ASR rules required when placing calls through the 3300 gateways, this information focuses obtain the configuration of PSTN gateways in Lync Server 2010 for Mitel integration only.

1. Obtain Mitel technical reference SIPCoE 11-4940-00161 from the Mitel portal if you have an authorised account or from your PBX vendor. Alternatively you can view the configuration PDF file from here. Although this information is written specifically for MCD 4.2, the SIP trunk integration will work with lower software revisions, you will however notice some of the SIP configuration options detailed in the PDF will not be available in lower revisions.

2. Once the Mitel side of the SIP trunk has bee configured, connect to your Lync Server 2010 front end and open the topology builder. Once the topology builder has opened ensure that you have the mediation server role installed within your topology as this will be required when configuring Lync users for enterprise voice. If this feature is not installed, proceed and install the mediation server role before continuing onto step two.

3. Once the mediation server role is installed, navigate back to the topology builder and expand the “Mediation Pools” container. You should now see the FQDN of the server that holds the mediation role. Right click this object and select “Edit Properties” to invoke the properties window. Within the properties window check the “Enable TCP port” option and then continue to set the TCP listening port to 5060 as for the Mitel SIP trunk side the target TCP port for connectivity is 5060, so we need to ensure our mediation server is listening for requests on this port. An import thing to note here is that if you have any trusted applications, such as RCC integration or Cisco CUPS that already utilise port 5060 you will need to change the mediation server listening port and the destination TCP port of the Mitel SIP trunk to ensure the integration works correctly. If you are in this scenario I recommend setting the mediation server listening port to 5068 and also setting the target TCP port on the Mitel SIP trunk to 5068. The following screenshot illustrates the mediation server role configuration that is required.

Mediation Server Listening Ports 300x47 Lync Server 2010 & Mitel Direct SIP Connectivity

Once the port has been set, continue and publish the topology to the CMS. Once the publishing has completed, either restart your front end server or restart the mediation server service. This is required so that the new mediation server port is enabled and listening for connections on the front end server. To confirm this, open a new command prompt window and type “netstat /an” and press return and you should now see the server listening for connections on port 5060 or port 5068 depending on your scenario.

4. Once the mediation server is now listening on the correct port, the required PSTN gateway can be added to the topology. In the topology builder right click the “PSTN Gateways” container and select “New IP/PSTN Gateway”. In the gateway dialog box enter the IP address or FQDN of the Mitel PBX you are establishing the SIP trunk to and then proceed to set the listening port to 5060 and the transport protocol to TCP. For reference the Mitel side of the SIP trunk will only accept inbound connections on TCP port 5060. Once this has been completed, click OK and return to the topology builder and then publish the topology. The following screenshot details the PSTN gateway configuration.

New PSTN Gateway 300x186 Lync Server 2010 & Mitel Direct SIP Connectivity

5. In the topology builder window expand the “Mediation Pools” container, right click the FQDN of your mediation server and select “Edit Properties” to invoke the properties window. You should now see the IP address or FQDN of your Mitel PBX as a PSTN gateway that can be associated with the mediation server. Highlight the created PSTN gateway in the unassociated gateways field and then click “Add” and click OK. Following this, continue and publish the topology before continuing to the next step.

6. Open the Lync Control Panel and navigate to Voice Routing -> Trunk Configuration and then click New -> Pool Trunk, when prompted select the PSTN gateway you have just created. For the direct SIP connectivity to work with Mitel systems we need to disable RCTP and refer support as Mitel does not support this functionality, you will note this is detailed in the Mitel technical reference on the final page of the document. Mitel do recommend enabling media bypass, however in Lync Server 2010 to achieve media bypass enablement with refer support and RCTP functionality disabled we need to perform some specific steps. Proceed and uncheck the “Enable refer support” and “Enable Media Bypass” boxes in the pool trunk window and then click OK. When back in the main trunk configuration window click “Commit” and then select to commit all changes. The following screenshot illustrates the aforementioned configuration.

Media Bypass Configuration Lync Server 2010 & Mitel Direct SIP Connectivity

7. Once the gateway has been added in the trunk configuration open the Lync Server Management Shell and run the following PowerShell commands to disable RCTP functionality. In the below example my PSTN gateway is called mitel.domain.local, please replace this FQDN with your own Mitel system when running the following commands.

Set-CsTrunkConfiguration -Identity PstnGateway:mitel.domain.local -RCTPActiveCalls $false -RTCPCallsonHold $false

Set-CsTrunkConfiguration -Identity PstnGateway:mitel.domain.local -EnableSessionTimer $true

8. Once the PowerShell commands have been executed return to the Lync Control Panel and navigate to Voice Routing -> Trunk Configuration. Select to edit your pool trunk PSTN gateway and in the configuration window check “Enable Media Bypass” and then click OK.  When back in the main trunk configuration window click “Commit” and then select to commit all changes.

The configuration of the SIP trunk is now complete, once a dial plan, voice policy, PSTN usage and route have been configured you should now be able to call between Mitel and Lync users and also pass calls to the PSTN once the Mitel ASR rules have been configured.

Lync Server 2010 – Client Recording Location

I recently had a requirement to store Lync 2010 recordings on a UNC path for a customer. Natively in Lync 2010, setting the recording location directly through the client to either a UNC path or a mapped drive is not supported, and there is a good reason as to why this is the case. When a Lync 2010 recording is invoked the data is streamed to the recording location and when the recording is stopped it is then processed and viewable in both the the Lync Recording Manager and as a WMV file if selected. If for example there was an interuption to network connectivity on the local client, this would impact the recording itself. If you do try and select a mapped drive as a recording location in the Lync 2010 client, the following error will be displayed.

Lync Recording Mapped Drive 300x104 Lync Server 2010   Client Recording Location

If you have a particular requirement to place Lync recordings onto a mapped drive, the following work around can be performed. This work around utilises a HKEY_CURRENT_USER registry modification that is executed every time a user logs onto a workstation, the registry key itself sets the “RecordingRootDirectory1″ value to be the mapped drive or UNC path that you require. In order achieve this, the following actions need to be performed.

1. Download the LyncRecordingLocation registry file from here.

2. Open the registry file in notepad and amend the “RecordingRootDirectory1″=”S:\\LyncRecordings\\” entry to read a mapped drive or UNC location of your choice and then save the file.

3. Connect to a domain controller in your infrastructure and then open the Group Policy Management Console. From here, create a new GPO named “Lync Recording Location” for example, and then right click the newly created object and select edit.

4. When the GPO Editor opens navigate to the following location, User Configuration -> Policies -> Windows Settings ->Scripts, as illustrated below.

Group Policy Object 300x123 Lync Server 2010   Client Recording Location

5. In the Scripts action pane, double click Logon to configure the script. When the Logon dialog box opens click Add which will invoke the “Add a script” dialog box. In the “Script Name” field type the following without quotes, “Regedit.exe”. In the parameters field enter the following without quotes “/s LyncRecordingLocation.reg”. See below for an illustration of this and once both of these fields have been populated click OK.

Logon Script Dialogue Box 270x300 Lync Server 2010   Client Recording Location

6. To complete the creation of the script, click the “Show Files” button and in the policies folder that then displays copy and then paste the LyncRecordingLocation.reg file into this area and close the window. Click Apply and the OK on the Logon Properties dialog box and then exit the Group Policy Management Editor.

7. Back in the Group Policy Management Console, locate an Organisational Unit (OU) where your Lync 2010 users reside, right click the OU and then select “Link an existing GPO” and then select the Lync Recording Location GPO that you have created. This could also be filtered to a specific Active Directory group that requires recordings to be stored centrally, choose which ever option is suitable for your environment.

8. Have your Lync 2010 users log off their workstations and back on again. Open the Lync 2010 client, select Options -> File Saving, and ensure that the Lync Recordings Save To dialog box is now showing the mapped drive or UNC path you set in the registry file, as illustrated below.

Lync Recordings Save To 300x45 Lync Server 2010   Client Recording Location

That’s it, the process is now complete.

Lync Server 2010 – Deleting User Contacts Via SQL

I recently experienced an issue at a customer whereby they had used the very helpful LyncAddContacts VBS script from the EXPTA blog, however this process had gone slightly wrong for the customer and they wanted to delete all contacts that had been pushed out to users and start again. Unfortunately the handy dbimpexp.exe tool does not allow you to explicitly delete contacts from users in bulk or individually. To get around this issue I utilised the following Microsoft SQL query against the Lync RTC database in order to delete a users contacts in their entirety. Please use the following information with caution, the query listed below modifies tables in the RTC database and should be used at your own discretion.

1. Using the Microsoft SQL Management Studio tools connect LyncServerName\RTC using an account that has full CSAdministrator rights.

2. When connected, under databases right click “RTC” and select “New Query”.

3. In the new query entry fieldtype the following:

DECLARE @RC int
DECLARE @_Owner nvarchar(4000)
EXECUTE @RC = [rtc].[dbo].[ImpDeleteContactGroups2] “user@sipdomain.co.uk
GO

4. Under the Execute command detailed above change the users SIP address to be the desired one. To run this for multiple people at once, add more Execute lines for each person and then click Execute in the tool bar to run the script
 
5. Once the query has run, log into the Lync 2010 client as the user(s) and ensure their contacts list is now blank.
 
That’s it, the process is complete.

AudioCodes Mediant 1000 MSBG – Audio Quality Issue

So it’s been a long time since I last posted an article on the site, Microsoft Lync Server 2010 has been keeping me busy to say the least. During a recent deployment I experienced an issue with audio quality for both inbound and outbound calls when utilising an AudioCodes Mediant 1000 MSBG gateway running firmware version 6.2. The best way I can describe the problem was that when the call was answered it sounded like the person on the other end was stood next to a jet engine, there was a lost of noise and loss on the connection. When running  a syslog on the mediant, in debug level five, and reproducing the issue I could see the following events:

SRTP Error – failed decrypting RTCP packet: authentication failure (2) [Code:3700e] [CID:30]
SRTP Error – failed decrypting RTCP packet: wrong SSRC (11)
SRTP_PCK_DROP_AUTH:1  [Code:5004] [CID:30]
ErrMgs=9 Invalid RTP version (= 0)

When initially looking at these errors I was thinking either a coders or certificate issue could be causing the problem. This was actually incorrect, after some investigation it turned out that my TDM Bus Settings were not configured with the correct LAW attributes. To resolve the issue I performed the following:

1. Log in to the AudioCodes Mediant 1000 MSBG device.

2. On the left hand side of the screen select the “Full” radio button.

3. Ensure you have select the configuration tab and expand the “VoIP” container.

4. Expand the “TDM” container and then select “TDM Bus Settings”.

5. In the TDM Bus Settings page, if you are located in Europe set the “PCM LAW Select” value to “ALaw”. If you are based in the United States this should be set to “ULaw”.

6. Set the TDM Bus Clock Source value to “Network” and click submit in the bottom right hand corner of the screen.

7. At the top of the screen click the “Burn” button to save the configuration to flash and then reset the gateway.

That’s it, your poor quality audio issue should now be resolved.