Thursday 28 June 2012

AudioCodes FXO to Lync Configuration

Was setting up an FXO analog port for an in-dial today, with an AudioCodes Mediant 800, has some issues with getting the FXO to make and receive calls.  After a few email with support at VExpress finally got it sorted.

The basic configuration of the Mediant 800 is much the same as all their other gateways, the FXO port needed a little tweaking that I hadn't been able find in any other documents.

The only additional configuration that was required was under "VoIP --> GW and IP to IP --> Analog Gateway --> FXO Settings" and under "VoIP --> GW and IP to IP --> Analog Gateway --> Automatic Dialing"

FXO Settings
Change the "Dialing Mode" to One Stage

Automatic Dialling
Then we had to setup the Automatic Dialling you just need to set the phone number that corresponds to the FXO line that is being configured.

So with this configuration we were seeing some issues with call quality on the Lync end.  The PSTN caller could hear with no issues at all.  It turns out that the Mediant with FXO ports needs to have the earth cable installed, once this was installed the call quality issues have gone.

Wednesday 27 June 2012

Lync Dial Plan and Phone Words

So this is something new that I came across the other day, it has been around for a while but it actually affected a client, so had to figure out a way around it.
Phone Words, according to ACMA are:

Phonewords are made up from the letters of the alphabet that appear on a telephone keypad. These letters can be used to form a word, or a part word/part number combination, which can then be dialled as a telephone number to access a particular service. One example is '1300 FLIGHT'. Every phoneword has a primary underlying phone number, or in some cases more than one number, used by the telecommunications network as an 'address' for delivering the call.
The types of numbers that are most commonly used for phonewords include those beginning with the prefixes '1300', and '1800', which are 10 digits in length, and numbers beginning with '13', which are generally six digits in length.
When you think about it its actually pretty easy to solve, but first i had to get my head around what it all meant.

My original dialplan normalisation rule for 1300 or 1800 numbers was a simple
^(1[38]00\d{6})$ --> +$1
But as soon as a phone word was over the 10 total digits in length the call would fail. As a side note the number that was found to be the issue was the RSPCA number 1300 CRUELTY (1300 278 358).

So 1st plan was to remove the $ in the normalisation rule, and change it to 
^(1[38]00\d{5}\d+) --> +$1
This worked, until the call hit the gateway and was sent out with too many digits was rejected by the carrier.

So next plan was to only send the 10 digits to the gateway, this resulted in
^(1[38]00\d{6})\d* --> +$1

This only send the first 10 digits of the normalised number to the gateway and allows for the call to proceed to the carrier.

As with all pattern matching there is always more than one way to do this, so if you have a better way, please leave a comment.

Link to ACMA phone works fact sheet:

Lync Normalisation Rules - Pattern Matching

The table below outlines some of the available regular expressions for Lync number normalisation.  

Explanation of example
Match at beginning of string
Match the digits 123 at the beginning of the string
Captures the matched sub expression
Capture what is between the parentheses into a numbered variable, starting at 1 which can be accessed as $n, eg $1
Specifies zero or more matches
Specifies one or more matches
Specifies zero or one matches
Specifies exactly n matches
Match 4 digits
Specifies at least n matches
Match at least 3 digits (with no limit to number of digits matched
Specifies at least n, but no more than m, matches.
Match at least 3 digits but no more than 6 digits
Matches any decimal digit
Match any decimal digit (at the beginning of a string)
Matches any one of the terms separated by the | (vertical bar) character
134 | 135
Match either the string 134 or the string 135
The match must occur at the end of the string
Match exactly digits 123 (and not 1234)

The Lync number normalisation is based on .NET regular expression, more details can be found on the MSDN site:

Saturday 23 June 2012

Lync Address Book Download

The Lync address book, by default is updated every night at 1:30am.  This process updated all the delta, compact and compact delta files that are located on the Lync file share under
\\<Server FQDN>\<Share Folder>\1-WebServices-1\ABFiles
The Lync client downloads the user address book (if enabled in the client policy) for the first time after user login a random time between 0 and 60 mins.

To force the address book to download at a controlled point in time you can run a registry hack to add the GalDownloadInitialDelay value
reg add HKLM\Software\Policies\Microsoft\Communicator /v GalDownloadInitialDelay /t REG_DWORD /d 0 /f
This will force the address book to download as soon as the Lync client is signed in, as long as the address book hasn't been downloaded.

To remove the previously downloaded address books you can delete the two address book files found under:
  1. GalContacts.db
  2. GalContacts.db.idx

Friday 15 June 2012


Whilst watching a Lync training video the other day, the instructor was using a very nice tool from Microsoft called STRACE.  It provided the ability to log all the HTTP/HTTPS requests that a particular application would make whist it was running.

I have used this program along with HTTPReplay a few times since to troubleshoot EWS errors in the Lync client.

So though I would try and put together some notes on how to use it.

First the programs can be downloaded from:

Once installed, the process is traceing/troubleshooting/logging is done in two (2) parts.
  1. Launch the required program to trace (in this case the Lync client) using the strace DLL.
  2. View the output of the STRACE using HTTPReplay
From a command prompt change to the directory that the STRACE program was installed.
cd "c:\Program Files (x86)\STRACE"
Launch the required application with the following command

The actual command to launch with communicator will be something like
withdll /d:STRACE.DLL "c:\Program Files (x86)\Microsoft Lync\communicator.exe"
The STRACE program will continue to log details of HTTP and HTTPS requests until you exit the program that was launched. So exit Lync and the STRACE program will complete.

This will create a file on your desktop called:
Copy this file to the install directory of the HTTPReplay program
c:\program files (x86)\httpreplay\
From a command prompt change to the HTTPRelay directory.
cd "c:\program files (x86)\httpreplay"
Launch the HTTPReplay application with the STRACE log file that was created earlier.
httpreplay.cmd STRACE_COMMUNICATOR_PID_<PID Value>_<DATE>_<GMT Time>.LOG
The will again be a file created on the desktop, this time a .html file called HTTPREPLAY.HTML.  This file will automatically open in your default web browser.
From the image above you can see the URL, and the HTML status code from the request.  In the example you can see that there are a few status codes with "500" as the value. A HTML status code of "500" is "Internal Server Error"

Clicking on the status code value will give more details of the actual error that was generated.
From the generated "500 - Internal Server Error" message we can see that the error occurred due to an account being locked out.

In this case once the account was "un-locked" in AD the users problem was resolved.

So to cover off the commands again, just because I'm lazy and don't want to have to copy and paste from a few spots in this post.

cd "c:\Program Files (x86)\STRACE"
withdll /d:STRACE.DLL "c:\Program Files (x86)\Microsoft Lync\communicator.exe"
copy the STRACE log file to "c:\program files (x86)\httpreplay\"
cd "c:\program files (x86)\httpreplay"
httpreplay.cmd STRACE_COMMUNICATOR_PID_<PID Value>_<DATE>_<GMT Time>.LOG

Tuesday 12 June 2012

NET UX Optional Transformation Rules

There are two (2) types of "transformation rules" in a NET UX gateway.
  1. Mandatory 
  2. Optional
Mandatory rules are just that "mandatory' ALL rules MUST match within the transformation rule, optional rules are optional, in that the "Input Field Type" MUST match.

The following show 4 optional "Calling Address/Number" Input field type entries, for this rule to be successful, one of the circled rules must be completed without error.
In the case of multiple matches, the last matched rule will be the one used.  This is where the sequence of the rules plays an important part.  Rules can be re-sequenced using the "Resequence" function.

The following link to the UX documentation, as some examples (the above screen shots came from the documentation).

Friday 8 June 2012

TLS Outgoing Connection Failures

Whilst checking a event viewer on a Lync Front End today I noticed.

The above message has the right host name but WRONG IP address, after checking DNS I found four (4) entries for the Edge server.  three (3) entries with IP address for the external NIC of the edge.

So I figured that the external NIC was trying to register with DNS.

From the NIC properties select "Internet protocol Version 4 (TCP/IP)

Select Advanced

Select the DNS tab, then un-tick the "Register this connection's address in DNS"

You may see the initial error message appear in the event view one (1) more time before it stops reporting.

Thursday 7 June 2012

Force Web App URL

The normal operation for a PC with a Lync client installed when the user clicks on the meeting URL, is for Lync client to be launched.  There may be times when you want to see the web options for joining a meeting. 

This is where the "?sl=1" can be very helpfull.

The normal web url for meeting is something like:
https://meet.<domain name>/<username>/<meeting id>
Just append the ?sl=1 to the end on the <meeting id>.
https://meet.<domain name>/<username>/<meeting id>?sl=1
Depending on what your the "Security > Web Service" configuration is you may see the following screen shot.

Monday 4 June 2012

Lync Service Activity Levels

An easy way to see the number of conferences, parked calls etc from the Lync management Shell is using the CmdLet:

Below is a screen shot of the output of the commad with no other paramaters.

To get the full details of the activity level for the Mediation Service you can run
Get-CsWindowsService -Name RTCMEDSRV | Select-Object -ExpandProperty ActivityLevel
This will give the below output.

There is bound to be a better way to get the details, but i found this today and thought it might be useful.

Sunday 3 June 2012

Lync 2010 Install Power Shell Script

Came across this the other day, a nice PS script that installs on the Lync pre-reqs on the required server role.

Lync MVP Pat Richard has written the script over at

The script and all its previous version can be found  
To run the script you must have the PowerShell execution policy to RemoteSigned or Unrestricted
[Update] The Set-ExecutionPolicy command must be run from the Windows PowerShell that has been "Run As Administrator" otherwise the command will fail

Set-ExecutionPolicy -ExecutionPolicy {RemoteSigned | Unrestricted}

Lync Forwarded Calls

So image this, you have an inbound call to your MS Lync client, that has SimRing, or CFA enabled, but you never receive the calls.  The "out-of-the-box" invite message that Lync sends doesn't have a REFERRED-BY header in the Invite.

This has been addressed by MS with Lync CU3, but there is still more to be done, on each mediation server that you have in your environment, the "MediationServerSvc.exe.config" file needs to be updated.
<?xml version="1.0" encoding="utf-8"?>
                <add key="<FQDN or IP Address of Gateway>.ReferredBySupported" value="true"/>
    <generatePublisherEvidence enabled="false"/>
The file is located under:

C:\Program Files\Microsoft Lync Server 2010\Mediation Server\MediationServerSvc.exe.config

Saturday 2 June 2012

Exchange connection down

So when this error occurs to check the status of Exchange Web Services (EWS) launch outlook and try to schedule a meeting, if you can see the calendar availability of people you are trying to schedule a meeting with the EWS is ok

So this will tell you if you have a try Exchange connection error, if you are able to see other peoples schedule through outlook, I would suggest you run a trace using STRACE and HTTPReplay to see if any error are being presented via the EWS.

I have a blog post about using STRACE and HTTPReplay here:

1st Post

So the first post to the new blog. Hopefully will be used for lots of technical things for Cisco UC and Microsoft Lync

Landis Attendant Console Install

Attempting to setup a test tenant with access to Landis Attendant Console, and was getting errors around granting access to the tenant. The ...