Exchange UM and SDP 180\183

So, had a pretty funny (well, it started funny…) discovery a couple of weeks back:

I have a pretty simple environment that looks pretty much like this:

UM design

  • There’s a Lync 2013 pool.
  • There’s an Exchange 2010 UM server.
  • There’s an old QSIG PBX.
  • There’s an AudioCodes M1000 SBC to connect the above.

Users on Lync can dial users on the old PBX and vice versa via the AudioCodes SBC, voicemail works for users on both platforms; Lync and Exchange communicate directly over TLS, the old PBX and Exchange are communicating via the AudioCodes SBC over TCP, messages can be heard on the Outlook clients for both platforms, but one (apparently) critical feature is missing:
When users on the old PBX hit the “Play on Phone” button on their Outlook client to play their voicemail on their handset, the call rings, but we can’t hear any audio.
It works perfectly for Lync users, but users on the PBX’s UM dial plan can’t play their messages on the phones.

I immediately blames the SBC as there was no reason why any other call would connect, except for calls originating at the Exchange UM server.

Traces showed the following:

Trace

The gateway is doing everything you’d ask it to do, everything looks ok, but still, no audio could be heard.

Next I went to the Exchange UM server. Using Wireshark, I traced a one of the calls from the Exchange UM server to the user’s handset.
Using the Wireshark’s VoIP Calls player,  I could actually hear myself speaking on the handset, but there was nothing playing on the Exchange side.

Took me some time and some assistance from the nice guys at Microsoft to discover the following:

There’s a UCMA design limitation, where SDP can only be sent in 183 and in 200 OK.
If the “180 Ringing” contains SDP, UCMA will freak out.
My SBC was sending two provisional responses with SDP – 183 with SDP and 180 with SDP, before sending the 200 OK with SDP.
Apparently, we could send only 183 with SDP or 180 with SDP.
Sending both would cause the UCMA to get stuck and not initiate the Audio channel.

Who would have thought!

Once we suppressed the 183 packet, Exchange UM immediately started playing audio.

Advertisements

Lync 2013 and Fax machines over SIP trunk

Welcome to the world of the unknown.

There are many factors in this equation, and each one has its own influence on the final result. I found out what works for most of my implementations, using the following configurations:

  • I use a direct SIP trunk to an ITSP – walking through firewalls and dedicated routes, but no gateways along the way. I found that converting traffic from analogue to digital to analogue is usually a guarantee to break the connection.
  • My ITSP is NOT Microsoft certified. I can use either TLS or TCP SIP, as long as it works.
  • For any analogue device you’re going to connect to Lync, you’ll need an analogue translation and port. an ATA (Analogue Telephone Adapter) is a small box that knows how to do just that. I usually use AudioCodes MP series ATAs.
  • If I do use a gateway to the PSTN, I’d prefer taking all fax calls and redirect them to FXS ports on the gateway before they arrive to the Lync Mediation server. This way it stays analogue all the way. . I’d strongly recommend having these ports on your gateway as there’s always a use for an extra analogue interface. Trust me.

So Basically, in an ideal Lync implementation, you’ll have the following:

Diagram

So by now you probably have all of the above, just need to make sure it works. As soon as you have the ATA configured as an additional PSTN gateway, you can go ahead and add the analogue device.

First let’s start with adding the fax as an analogue device:

New-CsAnalogDevice -LineUri tel:+35315556789 -DisplayName "Your Fax Description" -RegistrarPool LyncFE.domain.local -AnalogFax $False -Gateway <Gateway IP or FQDN> -OU "OU=LyncDevices,DC=domain,dc=local"

Now you’re not wrong: It says -AnalogFax $False for a reason. I followed James Cussen’s interesting and very detailed post on connecting fax to Lync, and tested all options until I figured out which one works for me.

Next thing would be to configure your AudioCodes ATA. Assuming you’re comfortable with configuring its IP and DNS settings, I’ll only go through the settings relevant for the fax to work:

Configure Lync as your ATA’s next hop. Go to VoIP-> SIP Definitions-> Proxy &Registration and Choose “Use Default Proxy” and click the small arrow beneath it to enter your Mediation server’s details:

Use default Proxy

Then enter your Mediation server’s FQDN and choose TCP for protocol:

Set Proxy

For fax to go through I configure all fax coding to use G.711:

Go to VoIP-> Media-> Fax/Modem/CID Settings and configure Fax Transport Mode to ByPassEnable.
I usually disable all the other settings as a precaution, but you don’t have to do that. Set your Coder type to Alaw or Ulaw, based on your location:

Fax Settings

Next, go to VoIP-> Coders And Profiles -> Coders and set your coder to Alaw or Ulaw based on your location:

Coder profiles

On the same pane, scroll a little down to Tel Profile Settings and configure the Fax signalling Method to G.711:

Fax Signaling Method

And one more on the same pane, go to IP Profile Settings and configure Fax signalling Method to G.711:

Fax Signaling Method2

Now, configure your fax number for the ATA port you’re going to connect it to. On the following screenshot, I configured port 1 to use the number +35315556789. Remember to use the exact same number you used when ran the New-CsAnalogDevice command, as this is the exact number tat will be sent to the ATA. If the number is different – the ATA will reply with “Number can’t be found”. This is done at VoIP-> Hunt Group-> EndPoint Phone Number:

Endpoint phone number

Next, to allow outgoing faxes through Lync, we’ll need to configure where analogue traffic is going to. Go to VoIP-> Routing-> Tel to IP Routing and configure the IP and port of your Mediation server:

Tel to IP Routing

That’s about it. Fax should be going in and out.

***
AudioCodes uses an INI file to save the configuration of your ATA. Alternatively, you can upload a file with most of the configurations already done for you and only change the relevant settings.
I created an INI file with all the above configurations, all you’ll have to do is change the IP addresses and names and you can upload it to your ATA to only configure the Endpoint numbers.

Open the INI file with a text editor and search for anything that start with <Change Here = >. Replace the existing values with your values and reboot the ATA.

You can download the file here.