SfB Server 2015: SIP/2.0 503 Service Unavailable

While working on a PSTN integration with Skype for Business Server 2015, we notice that the inbound calls were being rejected immediately with SIP/2.0 503 Service Unavailable:

TL_INFO(TF_PROTOCOL) [festd\festd]6984.23A4::03/06/2017-22:56:29.167.0000245B (S4,SipMessage.DataLoggingHelper:sipmessage.cs(801)) [4223311279]
>>>>>>>>>>>>Outgoing SipMessage c=[<SipTcpConnection_1ACDDA8>], 172.20.20.40:5068->172.20.15.39:56945
SIP/2.0 503 Service Unavailable
FROM: “Joule Adams”<sip:09920156101;phone-context=PrivateUnknown@recore.lab;user=phone>;tag=f0d14b5566;epid=8CE36BBBAB
TO: <sip:+449920207101@172.20.20.40;user=phone>;tag=9837f16c5d;epid=14123C3787
CSEQ: 12538 INVITE
CALL-ID: 49bfd2ea-8753-4651-a8aa-d7b48d066d93
VIA: SIP/2.0/TCP 172.20.15.39:56945;branch=z9hG4bKdab2e468
CONTENT-LENGTH: 0
SERVER: RTCC/6.0.0.0 MediationServer

The related SIP messages didn’t had any information why the Mediation Service immediately rejected the call.

However, in the Trace tab we found an error related to this call:

TL_ERROR(TF_COMPONENT) [festd\festd]6984.5B3C::03/06/2017-22:56:29.075.00002454 (MediationServer,ProxyCall.ProcessGatewayCallStateChanged:proxycall.cs(1446)) [25728949]
25728949Exception: System.MissingMethodException: Method not found: ‘Boolean Microsoft.Rtc.Internal.Collaboration.Media.SdpMediaDescription.ValidateMediaDescription()’.
at Microsoft.RTC.MediationServerCore.ProxySdpProcessor.InternalTryParseSdp[TGlobalDescription,TMediaDescription](SdpContentDescription cd, ProxyOfferAnswerInfo& offerAnswer, String& parsingError)
at Microsoft.RTC.MediationServerCore.ProxySdpProcessor.TryParseOffer(SdpContentDescription offer, Boolean bypassOffer)
at Microsoft.RTC.MediationServerCore.ProxyCall.ProcessGatewayCallStateChanged(Object sender, CallChangeEventArgs args)NULL

TL_INFO(TF_PROTOCOL) [festd\festd]6984.5B3C::03/06/2017-22:56:29.168.0000245C (MediationServer,ProxyCall.TerminateSession:proxycall.cs(3822)) [25728949]
25728949Terminating Proxy side call with session state: Idle, sip-response: 503, ms-diag: 10014, ms-diag reason: An internal exception received while processing the incoming request.NULL

This happened because the Enterprise Voice and Dialin Conferencing features were added after the Front End server update:

Then we update these components with the Skype for Business Server 2015 Update Installer:

Finally the inbound call will work without issues:

Lync/SfB Server: Create a custom announcement for Unanswered Calls

We were asked if we could customize the sound/tone for unanswered calls when the called user isn’t voice mail enabled.

Usually the mobile networks will play a announcement like “Sorry, the person you tried to call isn’t available please try again later”.

In Lync/SfB Server we cannot change the default tone, however, we can use an announcement and the unassigned numbers to configure a workaround.

The first step is to get a WAV file with the custom announcement and import it to the Lync/SfB Server with the following cmdlet:

$a = Get-Content “C:\UCLobby\Unanswered.wav” -ReadCount 0 -Encoding Byte
Import-CsAnnouncementFile -Parent ApplicationServer:pool.gears.lab -FileName “UnansweredCall.wav” -Content $a
New-CsAnnouncement -Parent ApplicationServer:pool.gears.lab -Name “Unanswered Call Announcement” -AudioFilePrompt “UnansweredCall.wav”

Then we need to associate a number, this doesn’t need to be a valid number, if can be a dummy number as long that it’s a number that can be assigned to a Unassigned Numbers.
In the lab we use +449920145999 and assign a announcement to it:

New-CsUnassignedNumber -Identity “UnansweredCallAnnouncement” -NumberRangeStart “+449920135999” -NumberRangeEnd “+449920145999” -AnnouncementName “Unanswered Call Announcement” -AnnouncementService ApplicationServer:pool.gears.lab

Finally, we can forward the unanswered calls to +449920145999.  We can do it in the Lync/SfB client Options > Call Forwarding:

Select New Number or Contact:

Then we add the number we specify in the New-CsUnassignedNumber:

Now all unanswered calls will be forwarded to the configured announcement:

Please note that it’s also possible to configure the unanswered calls forward setting on the server side using the SEFAUtil:

Configure simultaneous ring, delegate-ringing and call-forwarding settings on behalf of a Lync Server 2010 user
https://blogs.technet.microsoft.com/meacoex/2011/04/23/configure-simultaneous-ring-delegate-ringing-and-call-forwarding-settings-on-behalf-of-a-lync-server-2010-user/

Missed call notification when the call is blocked by CallerIDBlock MSPL Script

After deploying the CallerIDBlock script, some users mentioned that they received a Missed Call Notification in their mailbox.

During our troubleshooting process, we found out that this was happening because the priority of the CallerIDBlock was low:

Get-CsServerApplication | ft -AutoSize
https://technet.microsoft.com/en-us/library/gg425948.aspx

In this example, the CallerIDBlock has priority 12, while DefaultRouting has 8. The Missed Call Notification is generated by the DefaultRouting, which means that if we want to disable the Missed Call Notification for the blocked number, we need to change CallerIDBlock priority to 8. By doing so, it will run before the DefaultRouting:

Set-CsServerApplication -Identity Service:Registrar:festd2013.gears.lab/CallerIDBlock -Priority 8

We can check if the priority was changed by running again:

Get-CsServerApplication | ft -AutoSize

Since an error event is logged when the priority is changed, we need to restart the services on all Front Ends:

Log Name: Lync Server
Source: LS Inbound Routing
Date: 31/03/2016 13:14:03
Event ID: 45038
Task Category: (1037)
Level: Error
Keywords: Classic
User: N/A
Computer: FESTD2013.gears.lab
Description:
Failed to start Call Notification Queuing Engine.

Failed to start Call Notification Queuing Engine. Exception Message: Object reference not set to an instance of an object..
Cause: Unexpected failure.
Resolution:
Try to re-start the service. If problem persists, contact product support.

After the services restart, everything will go back to normal and we won’t get any Missed Call Notification for blocked numbers.

Blocking Calls on Lync Server and Skype for Business Based on Caller ID

Update 2016/04/01 – To avoid Missed call notifications check Missed call notification when the call is blocked by CallerIDBlock MSPL Script

Last week a customer asked how we can block calls in Lync Server. After some searching, I found the following post:

VoIPNorm’s UC Blog – Blocking Calls in Lync Based on Caller ID

Unfortunately, the comments refer that the script worked only on Lync Server 2010, but not on Lync Server 2013.

With the help of both the above blog script and the MSPL scripting reference, the script was rewritten to support Lync Server 2013 and Skype for Business Server 2015. The script is available in the TechNet Gallery for download:

MSPL: Blocking Calls on Lync Server/Skype for Business 2015 Based on CallerID
https://gallery.technet.microsoft.com/MSPL-Blocking-Calls-on-e6d52de9

In the script, we only need to replace <Lync Share Path> to the proper setting. On a Standard Pool this can be a local path, but on Enterprise Pool it makes more sense to use Lync Share. The reason for this is because all Front Ends must reach both the script and blocked number list files when we enable the script.

Create a new folder in Lync Server Share. In this new folder put the script file (CallerIDBlock.am) and the block list file (BlockedTelephoneNumbers.txt).

calleridblock01

Insert one line per blocked number in the BlockedTelephoneNumbers.txt file. The number must be exactly what the PSTN Gateway is sending to Lync Server. In this case, our gateway doesn’t send the “+”:

Phone,Action
01234567890,block
01234567891,block
01234567892,block

The next step is to add the script as a Lync Server Application. This can be done by entering the following cmdlet in Lync PowerShell:

New-CsServerApplication -Identity “Service:Registrar:<Lync/SfB Front End Pool>/CallerIDBlock” -Uri https://uclobby.com/2014/07/31/CallerIDBlock -Critical $false -ScriptName “\\<Lync/SfB Share Path>\CallerIDBlock\CallerIDBlock.am”

 calleridblock02

Now we need to Enable the new application. We could do it while we add it to Lync/SfB Server, but I prefer to enable it after.

Set-CsServerApplication -Identity “Service:Registrar:<Lync/SfB Front End Pool>/CallerIDBlock” -Enabled $true

Or in Lync Control Panel->Topology->ServerApplication:

 calleridblock03

Shortly afterwards Lync Server Event Viewer can be checked for the following message:

calleridblock04
Note: Check all Front Ends for this message.

When installing the Lync Server 2013 SDK, we can use AppLogger (located in “C:\Program Files\Microsoft Lync Server 2013\SDK\Bin”) to debug MSPL Scripts.

If the number isn’t present in the BlockedTelephoneNumbers.txt file, the message should look like this:

CallerIDBlock processing request:
From – 01234567890;phone-context=uk.*****.co.uk
To – +449876543210
Allowed by CallerIDBlock

After adding the line 01234567890,block to the BlockedTelephoneNumbers.txt file, the call is rejected and the message changes:

CallerIDBlock processing request:
From – 01234567890;phone-context=uk.*****.co.uk
To – +449876543210
Rejected by CallerIDBlock

If the phone-context is received, the script will only use the number before “;”.

 

AudioCodes 420HD and Lync Address Book Service

After January 2014 firmware release, the Audiocodes 420HD got a nice feature — Lync Address Book service query. Before this update we could add a LDAP as Corporate Directory source, but this was based on Active Directory information and not on Lync Address Book service. Also, we couldn’t see the user presence information on searched contact.

In UC_2.0.3.16 firmware version, a new option was added as “Corporate Directory” source — Lync Contacts. This means that we can use Address Book service to search Lync Contacts on AudioCodes 420HD phones.

AudioCodesABS03

AudioCodesABS02

To configure Lync Contacts as Corporate Directory source we need to access the phone web interface and then go to Configuration -> Advanced Applications -> Contacts:

AudioCodesABS01

Let’s use this cool feature, first by accessing the Directory List using the open book on the main screen:

AudioCodesABS06

Then by selecting Corporate Directory:

AudioCodesABS04

Use the numeric keypad as search input:

AudioCodesABS05

As we can see, users with “da” within the name will be showed with their presence status. The full moon icon on its left indicates that the user is Available; the half filled circle indicates that the user is Away/Busy.

This is a nice feature for those who use AudioCodes phones with Lync Server. I still wish to see Better Together over Ethernet feature on these phones.

AudioCodes 420HD – Failed to validate server

AudioCodes 420HD can be a good replacement for Lync Phone Editions, at least regarding its price. However, don’t expect to have all the features that exist in the Lync Phone Editions. In addition, AudioCodes has already promised to enable Better Together over Ethernet to 420HD, 430HD and 440HD in a future firmware release.

The provisioning of these phones is different, but I strongly recommend that you prepare the same requirements as needed by Lync Phone Edition Phones. Jeff Schertz has a great article on how to configure the requirements:

Configuring Lync Server for Phone Edition Devices
http://blog.schertz.name/2010/12/configuring-lync-server-for-phone-edition-devices/

Now that we have configured the requirements, let’s go back to the phone. 420HD supports two methods of authentication, one by using Sign-in address:

AC420HDServer07

Another by using Phone Extension:

AC420HDServer09

To change the Sign-in method, we use the option Switch sign-in method that is available in the Sign in menu:

AC420HDServer08

After setting the method and trying to sign in, I got the error saying that Failed to validate server:

AC420HDServer01

In this case, I thought that it had to do with certificates and that the phone didn’t trust Lync Server certificate issued by the internal CA.

The phone firmware version was updated to 2.0.1.44.21:

AC420HDServer02

We can install the internal root CA in the phone. The first step is to go to Configuration>Security>Security:

AC420HDServer05

In this page we can see that the CA certificate is empty:

AC420HDServer03

To load the certificate, select Choose File, then select the proper certificate (*.cer). After selecting we need to Load the certificate.

AC420HDServer04

Almost done. Just reboot the phone and try to sign in again:

AC420HDServer06

EnableFastFailoverTimer in Lync Server 2013 Trunk Configuration

New stuff has been added to Lync Server 2013 but some things aren’t visible right away. On the Lync administrator side the interface didn’t change much – Control Panel and Topology are almost the same, and PowerShell is still black. “Under the hood”, we will find out that things are quite different – new settings, new roles that can be collocated, new features and PowerShell with a lot of new cmlets.

This post will talk about a “new setting” added to Trunk configuration in Lync Server 2013, EnableFastFailoverTimer. This parameter can have two settings, “True” or “False”, and when enabled the gateway must respond in 10 seconds or the call will be routed to a different gateway.

I can understand that this setting is enabled by default, since it’s common to have more than one VoIP Gateway giving Redundancy to PSTN Calls, but nevertheless it would be nice to change the 10 seconds value.

If a call isn’t completed, we will get the following error in Lync Server event viewer:

Event 46046, LS Outbound Routing

Call Number: +351999999999
Phone Usage: Long Distance
Route: ToVoIPGateway

Cause: All gateways available for this call are marked as down.
Verify that these gateways are up and can respond to calls.

The event is obvious, there is no gateway available to complete the call. Sometimes, however, this can occur if the gateway takes too long to complete the call and EnableFastFailoverTimer is enabled, for instance. Usually we can hear a dialing tone more quickly calling to a fixed phone than to a mobile phone.

When we deploy Enterprise Voice this must be taken into consideration. So, if we have only one VoIP gateway in our topology you can disable this feature since the call must go through that gateway anyway. Also, if we have gateways that take too long to respond we need to disable this.

There are two ways to disable it, the first being the Control Panel way (don’t forget to commit changes):

TrunkConfiguration01

and the second being the Lync Server Management Shell way:

Set-CsTrunkConfiguration -Identity Global -EnableFastFailoverTimer $False

TrunkConfiguration02

Remember that some Trunk Configuration parameters are only available through Lync Server Management Shell. You can find them here:

Lync 2013: Set-CsTrunkConfiguration
http://technet.microsoft.com/en-us/library/gg398238.aspx