How to setup a software PBX to test the PSTN features of Lync Server

Written by Joe Lefort, Senior Microsoft Premier Field Engineer. In my last article, Why You Need To Understand NAT When Setting Up Lync or OCS,  I talked a fair bit about the edge and NAT. I thought this article would be all about the STUN and TURN mechanisms mentioned in that post, but other shinier lights got in the way. Those lights are: bringing the PSTN to a Lync Server 2010 lab .

Just like adding the edge to Microsoft Lync, adding PSTN connectivity ups the complexity pretty substantially. I expect that like me, you probably don't want or can't afford to put real PSTN connectivity in your lab. Having the ability to test and monkey with something that looks like the PSTN sure makes the lab a better place for you to work things out.

In this post I will (more or less) walk you through the process of adding an IPPBX and a softphone to your lab. From there you can then do all the magic associated with Enterprise Voice and Dial-In Conferencing, which is a big part of the Lync feature set.

DISCLAIMER: I am not endorsing either of the products (3cx softphone or snomONE) that I am using here. These are simply tools that let me test the PSTN magic in a closed loop, and just happen to be what I used for my lab. Your mileage may vary.

Prerequisites

PBX Preparation

  • Build up a Virtual Machine with Windows Server 2008 (R2). Mine is a vanilla install, updated only to the latest patches / revision level.
  • Install snomONE from the downloaded media, then connect to it via https://localhost. (note: snomONE is not an IIS hosted service, it uses a proprietary web server). By default the logon Username is admin and the password is blank. You probably want to change the password, unless your lab is a trusted free-for-all. Do this in the admin section, settings tab.

smom ONE - System Settings

Lync Server Updates

From within the Lync Server topology builder:

  • Collocate the mediation server functionality on the Lync FE pool and change the TCP listening port to 5060 for the mediation server. This is the port snomONE expects to be listening by default. If you don’t do this, when you try to dial a Lync user you will get a constant ringthrough sound on the softphone, but no actual receipt on the Lync side. You will be able to tell that this is an issue ONLY from the snom logs as it will have SIP requests to the mediation server but no responses.

Mediation Server Settings 

  • Add the snomONE server as a PSTN gateway:

Add the snomONE server as a PSTN gateway 

  • Associate the PSTN gateway with the Mediation Server from within the Front End pool properties

Associate the PSTN gateway with the Mediation Server  

  • Publish the Lync Topology and follow the 'next steps' guidance, which will be to run the local setup on the Front End pool members.

PBX Configuration

  • Log on to the snomONE website and open up the settings tab. Name your PBX domain, set a timezone, country code and area code (this will make your log sniffing way easier, trust me on this one).

snomONE settings tab

  • Open the accounts tab, edit a couple of the existing snomONE accounts to be your PSTN accounts.
  • The Account Number(s) field is a two part number, comprised of the extension (this will be used by the softphone) and the 10 digit phone number (the DID).
  • Put descriptive detail in the First Name, Last Name and Position fields .
  • The password is also a value that will be used by the softphone. Record something memorable there.
  • Don't forget to save your changes!

snomONE accounts 

Create a trunk between the PBX and the Lync Mediation Server

  • On the snomONE website, click the Trunks tab
  • Under New Trunk, provide a descriptive name for the trunk to Lync. select SIP Gateway and click Create.

snomONE Trunks tab                                                

  • In the Current Trunks Area, double click the Trunk name you just created to open it up for editing
  • Change the Trunk destination to Microsoft OCS
  • Set the domain to the Lync SIP domain
  • Set the Proxy Address to the Lync Medaition Server IP with a transport value of TCP
  • Set the Rewrite global Number to E.164 (without leading +)
  • Save your changes

snom1 Trunk to Lync

 

Create a dial plan on the PBX

  • Click the Dial Plans tab, then choose Edit on the Standard Dialplan entry
  • On the first entry in the list (100 Unassigned), enter a Preference and select the Trunk you just created
  • Enter the dial patterns PBX users will enter to connect with Lync. In my case I use 4 digit dial for simulating 'internal' user calls and 10 digit dial for external user calls.

snomONE dial plans

 

Configure the softphone

At this point, the PBX is set up, but you probably want to make a few calls, so you will need to set up a softphone. To do this:

  • Install the softphone to a machine in your lab. Preferably one that you can hook up a headset or speakers and microphone to.
  • Once installed, right click on the softphone screen to expose the configuration area. Select Accounts

3CX softphone

  • Click New and configure the PBX based account
  • You can enter anything you would like in the Account Name and Caller ID fields.
  • The externsion ID and password MUST match the details from the PBX account set up earlier
  • The IP of the PBX MUST match that of the PBX.
  • Save your changes

softphone account settings

 

Final Validation:

If everything on the softphone matches up to what you configured on the PBX, you should see "On Hook" in the softphone. If so, you are ready to configure all the Lync bits for Enterprise Voice and Dial-in Conferencing. If not, go back through your steps, you missed something somewhere. If it makes you feel any better, everyone bongoes something the first time. (Go ahead, prove me wrong!)

3CXPhone - Final Validation

 

Additional Notes

Both the PBX and the softphone have logging / debugging capabilities. Find these, use these, love these.

Summary

This walkthrough allowed you to set up a 3rd party PBX and softphone that will then allow you to test the PSTN-based features of Lync Server 2010 in a purely closed loop lab environment. If you want / need to get your head around voice on Lync, this should probably help you get there.

As per usual, comments are appreciated.

Cheers!