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.


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 http://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.


          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.


          Comments (9)

          1. Anonymous says:


            I have followed your steps to configure 3CX phone with snom One PBX, but my phone says Not Connected.

            I have repeated them few times but the result is the same. Bot PBX and 3CX phone are running on the same VM Windows 2008R2.

            Here is the content of the 3CX phone debug:

            "DX:Null Renderer invalid COM object

            DX:Sample Grabber invalid COM object

            DX:MP3 writer initialized

            DX:MP3 encoder initialized

            DX:FFDshow not present

            Translation file OK

            Translation file OK

            Attempting to connect

            Phone got as local port 50747

            Jabra not connected

            RTP engine OK

            SIP engine OK

            Failed to initialize sound mic devices, no audio will be delivered

            Sound ring device OK

            Sound speaker device ok"

            I have tried as an IP, becaise both devices are on the same VM, but no luck. Firewall is disabled on VM.

            Any help would be greatly appreciated.

          2. KENT says:

            No comments yet? This is a great article!

            Thank you so much!

          3. massoud44 says:

            Great post, I setup 2 Lync forest, mediation on forest 1, points to the mediation of forest 2, and mediation of forest 2 points to mediation on forest 1, this will make a poor mans SIP trunk.

          4. Peter Van Gils says:

            Looks like snom One is no longer available for download 🙁
            Are there alternative download locations, or alternative products to get the same functionality?

          5. Koen says:

            Thank you very much, nice article!

          6. Anonymous says:

            How to setup a software PBX to test the PSTN features of Lync Server – Premier Field Engineering – Site Home – TechNet Blogs

          7. ucpartners says:

            Thank you for sharing your valuable information.this information very useful for online learners
  ">3cx phone system ip pbx

          8. rentaphonesystem says:

            Thank you for sharing your valuable information.this information very useful for online learners
  ">3cx phone for windows

          9. Silvestre says:

            Even after two years this post is still helping people around the world.Really helped me

          Skip to main content