Please click on the double arrows to expand the list and check the name of author to view all their articles. 


Filter by Authors

  • Expand/Collapse
To search by content, please type in any key words that you are searching for. The results will list any or all of the typed words.

Skype for Business and Lync Server 2013 Analog Gateways : Trunk to Trunk

The purpose of this article is to demonstrate an alternate method for installing and configuring analog gateways for use with Lync Server / Skype for Business Server. For the remainder of this article, we will reference using Skype for Business Server (SFB). The differentiating factor here is that we are not “hanging” the analog gateway off of an existing gateway or SBC to be routed to the PSTN, nor are we configuring the analog gateway to route directly to the PSTN from the fax machine.

Instead, what we will be doing is configuring the analog gateway to route calls to SFB and then have SFB match and route fax calls to another trunk that is already configured to work with Enterprise Voice users.

This deployment method utilized a SIP trunk that was already configured and working with Skype for Business Server providing Enterprise Voice to users at the main site. The SIP trunk was using a service provider specific on-premises SBC, providing SFB with the SIP trunk on premise. The problem we were up against was that this specific service provider could not add another device, only allowing one (1) CPE (Customer Premises Equipment) per SBC. In this case, SFB Mediation Server was that one (1) CPE. The remainder of this article describes the configuration tasks required to allow the analog fax devices to communicate bidirectional with the existing SFB SIP trunk service. 

The first step is adding the analog gateway to the Skype for Business topology. You can complete this task this by:

  1. Logging on to one of the existing Front End servers.

  2. Open up Topology Builder, download, and save the topology.

  3. Expand the tree down to “Shared Components”, right click “PSTN Gateways”, and add a “New PSTN gateway”:

    1. Add the IP address or FQDN of the analog gateway (if using a FQDN make sure a HOST A record has been added to DNS previously for the analog gateway)

    2. Select “Enable IPv4” and select “Use all Configured IP Addresses

    3. Trunk Name: You can leave it as is or change the Trunk name

    4. Configure the gateway listening port: 5060

    5. Select the SIP Transport protocol: TCP

    6. Configure the Associated Mediation Server:

NOTE: If you using a mediation pool, select the mediation pool FQDN, or if using collocated mediation, this will be the front end pool FQDN.  V11. Configure the Associated Mediation Server Port listening port: 5060


4. Publish the topology (this doesn’t require server restarts, and should be safe to do during normal operating hours):


Next, we will add an analog device contact object to Skype for Business Server using the Skype for Business Server Management Shell. 


  1. Open up Skype for Business Server Management Shell.

  2. Add the analog device as follows:

    1. New-CsAnalogDevice -LineUri "tel:+12345678900" -DisplayName "Analog Fax Gateway" -RegistrarPool "" -AnalogFax $True -Gateway "" -OU "CN=Users,DC=domain,DC=com"

    2. You may want to check with an Administrator to see where this contact object should be created:

      1. An example was provided above using the “Users” OU

    3. You can run a “Get-CsAnalogDevice” command to ensure the object was successfully entered

    4. Once the changes are replicated, and you sign out and back in to the Skype for Business client, you will be able to see this contact object in the client:

    5. It will show up as offline; however, you will be able to call it

Next, log into the Skype for Business Server Control Panel, access the “Voice Routing” section and add trunk configuration for the analog device:


  1. Open up Skype for Business Server Control Panel, and go to the “Voice Routing” section on the left hand side of the Control Panel, and then select “Trunk Configuration” from the options across the top:

  2.  Create a new Pool Trunk for the analog gateway by selecting “New”, “Pool Trunk”, and select the analog gateway previously added to the topology clicking “OK” at the bottom of the window:


3.  Set “Encryption Support Level” to “Optional” if you are planning on using “TCP” protocol:

     a.  If you decided to use TLS protocol, you can leave this to “Required

4.  Set “Refer Support” to “None”.

5.  All other settings can be left at their defaults:

6. Under “Associated PSTN Usages”, you can do one of the following: a. Select an existing PSTN usage that matches and routes all dialed numbers from the fax machine to an existing gateway / SIP trunk b. In this example, I used the existing “National Rule” as it will cover all fax dialing needs from fax machine to PSTN:   



Create a new usage that matches and routes all dialed numbers from the fax machine to an existing gateway / SIP trunk:

            NOTE: Create a new PSTN Usage first, then come back and assign it to this trunk configuration once it’s been committed

More Details: The key here is to create a trunk for the analog fax gateway that allows dialed fax numbers to be matched on the PSTN usage assigned to a trunk that ends up routing faxes to an existing PSTN endpoint (gateway or SIP trunk). This leads to the fax routing from the analog gateway to the SFB Mediation Server, which will end up routing across the trunk that we created above for inbound traffic. Since we added a PSTN Usage here, the SFB Mediation Server will try to match and route digits to the route added to the PSTN Usage. Ultimately, this will route the fax from the analog gateway to the PSTN endpoint listed in the PSTN Usage tied to this trunk configuration.

When adding the PSTN Usage to the trunk configuration, you can also test the number to ensure it will match the selected PSTN Usage. In short, we are routing from one trunk to another within Skype for Business.


Select OK at the top of the “New Trunk Configuration” page and then commit your changes to the trunk configuration by clicking on “Commit” and “Commit All”:


You will see the PSTN usage added to the new Trunk Configuration from the main Trunk Configuration page as follows:


To review the “National” PSTN Usage and “Route” that I used in my trunk configuration in more detail                

  1. The voice policies listed below are associated to the US_NY-Lockport-National Route:


ii.  When reviewing the US_NY-Lockport-National Route, you can see the regular expression created will match just about any national e.164 formatted number and then send it to the gateway (which in this case is the service providers Session Border Controller that routes calls to the PSTN):

      1. The regular expression used in this national route is as follows:  ^\+1(?!(900|976))(20[^04]|21[^1]|22[4589]|23[149]|24[08]|25[12346]|26[0279]|27[026]|30[^06]|31[^1]|32[0135]|33[^2358]|34[067]|35[12]|36[01]|38[56]|40[^03]|41[^168]|42[345]|43[0245]|44[023]|47[0589]|48[04]|50[^06]|51[^149]|53[0149]|54[01]|55[19]|56[12347]|57[01345]|58[056]|60[^04]|61[^13]|62[03689]|63[016]|64[16]|65[017]|66[01279]|67[018]|68[124]|70[^059]|71[^01]|72[0457]|73[1247]|74[07]|75[47]|76[02359]|77[^1678]|78[1567]|80[^079]|81[^19]|83[012]|84[3578]|85[06789]|86[02345]|87[028]|90[^025]|91[^1]|92[0589]|93[16789]|94[0179]|95[12469]|97[^4567]|98[0459]|281|458|469|520|828)[2-9]\d{6}$:


The next section will outline how the analog gateway will be configured to route fax calls bi-directionally. 

  1. Log into the Analog gateway and change the default IP address, assigning an IP address from your current network:

    1. From the left hand side of the gateway configuration window, select: Configuration -> VoIP -> Network -> IP Settings:

      1. IP Address:

      2. Prefix Length: 24

      3. Gateway:

      4. VLAN ID: 1

      5. Interface Name: O+M+C

      6. Primary and Secondary DNS Server IP Address:

NOTE: The screenshot below shows this page being in multi-interface table mode:


Configure the Proxy Set for Skype for Business Server:

  1. If you are not using collocated Mediation services and using a separate Mediation pool, configure the Proxy Set to point to the standalone mediation pool

  2. Once “OPTIONS” have been enabled, and the IP Group is applied, you should see OPTIONS requests being sent to Skype for Business, and SFB responding back with “200OK”

  3. Once the gateway is added to the Skype topology, it should also be sending OPTIONS to the gateway, and the gateway should be replying to those with “200OK”

  4. Once you see this bidirectional SIP communication, you can be assured the two are communicating successfully

From the left hand side of the gateway configuration window, select: Configuration -> VoIP -> Control Network -> IP Group Table:

  1. Proxy Set ID: 1

  2. Proxy Address:

  3. Transport Type: TCP

  4. Enable Keep Alive: Using OPTIONs:



          Next, configure the IP Group for use with Skype for Business Server

Go to Configuration -> VoIP -> Control Network -> Proxy Sets Table:


  1. Type: Server

  2. Description: Skype for Business Server 2015 pool

  3. Proxy Set ID: 1

  4. IP Profile ID: 1

  Next, configure the IP profile:          

  1. Should we want to change any fax related settings, we can come back to the IP profile and update them without affecting anything else currently configured in the gateway

  2. For example, if we decide to enable T.38 or G.711 fax instead of pass-through mode we can configure it here in the IP Profile instead of globally

  3. In AudioCodes, profiles “Trump” general / global settings

  4. Go to Configuration -> VoIP -> Coders and Profiles -> IP Profile Settings:

    1. Profile ID: 1

    2. Profile Name: SFBPool01

    3. Disconnect on Broken Connection: No

    4. Fax Signaling Method: No Fax (The gateway will not interfere with media and pass-through)

    5. Early Media: Yes

    6. Media Security Behavior: Preferable (using TLS, this can be configured to Mandatory)

  Next, configure the Hunt Groups settings:

  1. Enter your Hunt Group ID(s) configured on the previous page and define their channel select mode

  2. If you plan to route incoming calls by destination number, then select “By Destination number” for channel select mode

  3. Otherwise, select Cyclic Ascending. Go to Configuration -> VoIP -> GW and IP to IP -> Hunt Group -> Hunt Group Settings:

    1. Hunt Group ID: 1

    2. Channel Select mode: Cyclic Ascending

  Next, we will configure the route for outbound fax calls from the fax machine to Skype for Business:


  1. The intent here is to allow and route all digits to the PSTN via Skype for Business by means of the “National” PSTN Usage configured in the Analog Gateways trunk configuration

  2. Go to Configuration -> VoIP -> GW and IP to IP -> Routing -> Tel to IP Routing:

    1. Src Hunt Group ID: 1

    2. Dest. Phone Prefix: *

    3. Dest. IP Group ID: 1

  Next, we will configure the route for inbound fax calls from Skype for Business to the fax machine:

  1. When the fax machine’s number is dialed, it’s DID will eventually make it to Skype for Business by way of the SIP trunk to which it is connected

  2. Since we added the analog fax machines contact object (including Line URI and gateway IP address), Skype for Business will know to match and route calls from this number to the analog gateway, which will then match and route accordingly to the fax machine

  3. You can also create rules here based on source and destination matching if needed

  4. Go to Configuration -> VoIP -> GW and IP to IP -> Routing -> IP to Hunt Group Routing:

      1. Dest. Phone Prefix: *

      2. Hunt Group ID: 1

      3. Source IP Group ID: 1

  Next, we will configure DTMF and Dialing parameters:

  1. Go to Configuration -> VoIP -> GW and IP to IP -> DTMF and Supplementary -> DTMF and Dialing:

    1. Max Digits in Phone Num: 14

    2. 1st Tx DTMF Option: RFC 2833

  Plug in a fax machine into port 1 and begin your testing:

  1. Make an outbound PSTN call to a cell phone or another fax machine

  2. For inbound, you should be able to see the analog fax contact object and call it directly

  3. The fax machine should ring

  4. You can also use a fax test service (many available for free on the internet) to test inbound and outbound fax with your gateway:

    1. For outbound, the dialed digits should hit the analog gateway:

      1. The gateway then sends an INVITE to Skype for Business / Mediation Server with the dialed number in the request URI of the INVITE. Skype for Business / Mediation receives the INVITE down the “trunk” we created previously

      2. Those dialed digits need to match the associated “PSTN Usage” we assigned to the analog gateways trunk, which will allow it to route to the SIP trunk defined in the usage

    2. For inbound, the fax machines DID should land on the SIP trunk (in this example). So the fax machine’s DID is currently ported over to service providers Sip trunk connected to SFB:

      1. This call will hit Skype for Business / Mediation server

      2. It does a lookup and see’s the analog gateway contact object since the digits coming in matched the line URI in the analog gateway contact object

      3. Skype / Mediation server then sends the INVITE with the dialed digits to the IP address of the analog gateway

      4. The INVITE lands at the analog gateway, matches the IP to Hunt Group route and rings the fax machine in port 1

Previous Article New SharePoint Capabilities on O365
Next Article Forrester Total Economic Impact Report for Office 365
27911 Rate this article:
No rating

Please login or register to post comments.