Duplicate Phone Numbers in Skype for Business

Recently we had a couple of instances where users were having duplicate phone numbers in Skype for Business. They were unable to receive calls and you would get a “fast busy” tone.

In the UCCAPI logs as well as SfB monitoring logs we get a 485 ambiguous error.

As we do not use extensions in our deployment, it should have been impossible to provision a user with a currently assigned number.

Running the following command in Skype for Business Management Shell:

Get-CsAdPrincipal -LDAPFilter ‘|(msrtcsip-line=tel:+441473212345*)(msrtcsip-privateline=tel:+441473212345*)’

This returned only one user. The recently provisioned user.

Tried using the Get-CsPhoneNumberAssignment script by Pat Richard (https://www.ucunleashed.com/4085) and the Get-LyncNumberAssignment script by Tom Arbuthnot, however, both came up with only one user.

When we removed the number from the user, and dialed +441473212345, we got a voicemail recording for a user who had left the business.

Searched our directories for this user – but his account had been deprovisioned – more than 6 months ago.

So we turned to SQL to see if we could identify what was going on.

The SfB deployment itself consists of 2 standard edition FE pools across two sites. Each site had a local domain controller.

  • Connect to the RTCLOCAL instance of the Front-End.
  • Run the following SQL query: SELECT * FROM [rtc].[dbo].[ResourcePhone] WHERE [PhoneNum] Like ‘%1473212345%’

This provides an output with headings similar to the below:

  • Resolve ResourceId to name using the following SQL query:
  • SELECT * FROM [rtc].[dbo].[Resource] WHERE [ResourceId] = 460
  • Once you have identified the account you wish to remove from the table, run the following SQL query:
  • EXECUTE rtc.dbo.DeletedResource ‘test.user1@bishopal.com’

Once the user was removed from SQL, the newly provisioned user was able to make use of the assigned phone number.