Inter Trunk Routing Deep Dive

In our previous three posts about understanding voice routing we investigated outbound dialing from both the Dialing Behavior, Routing & Authorization levels and In-Bound Routing. In this post we are going to explore Inter-Trunk routing or as Microsoft now refers to it as Basic Session Management.

PRE-POST-UPDATE: So good friend Ken Lasko has stolen a little of my thunder in his recent blog post.  Don’t want anyone thinking I just ripped off his content.  We will do much of the same work however we will dive a little deeper into the guts and see exactly what is happening here.


Unlike the other series we are going to have to setup a specific scenario that we want investigate in order to be able to fully understand what is happening here.  So I have created the following setup in my environment.


We have four phone numbers that I have carved out of my DID block to play with.  2820 to 2823.  A quick description of each of the gateways, trunks, etc.

  • Gateway is an AudioCodes Gateway with PRI  (GW-PSTN)
  • Lync 2013 Mediation Server is within the ( domain. (Lync)
  • Gateway is an I3 Call Center System (GW-CIC)
  • Gateway is a Lync 2013 Standard Edition Server in a different Active Directory Forest ( domain). (GW-LAB)

My goal is to get four digit dialing from the PSTN ( to the Lync 2013 Standard Edition Server (  Likewise, I want to be able to outbound dial from my Lync 2013 Standard Edition Server and reach CIC, the other Lync Server Domain and the PSTN.  I decided to use a Lync Server as my third “gateway” so I could use CLS/Snooper and output familiar looking logs.

For the purposes of this example I’ll refer to each component as the GW name listed above in red to make everything easy to keep track of.

Configuration – Inbound Routing from PSTN

We will start by looking first at the inbound routing process for inter-trunk routing.  You will discover this configuration can get confusing very quickly.

Topology Builder Changes

We need to ensure that PSTN Gateways exist in Lync for each of the three Gateways.  We do this via topology builder.  There is nothing special or unique about this configuration.  In all three of my gateways I have decided to use port 5060 and all gateways are configured as TCP to make tracing easier.

Control Panel Changes

This is where the most complicated part of the configuration must take place.  Inter-trunk routing is based on the idea that after going through the call flow process, we match another route and route the call down that path.  The trick becomes authorization.  For a normal Lync user this is done via the voice policy and PSTN usages.  For inter-trunk routing this is done via the Trunk Configuration and PSTN Usages.

So the first thing we must do is create routes for our calls.  So we know that we want 2821 to route to GW-CIC and 282[2-3] to route to GW-LAB.  That leads me to create these two routes:


NOTE: You can see my route to Test CIC has both 2820 and 2821.  I’m doing this on purpose to reinforce the routing process in Lync.  Remember, that 2820 is currently assigned to a user in my Lync environment.

The second item I need to do is create PSTN Usages that will contain these routes.  So I create two of those:


I have two usages, named Inter-Trunk Route to BLM Lab and Inter-Trunk Route to CIC.  You will also notice by the very blank space to the right that these PSTN usages are NOT assigned to any voice policies at this time.  For the purposes of in-bound routing there is absolutely no need to associate these PSTN usages to a voice policy.

The last step is authorization.  Remember, before I said that inter-trunk routing authorization is done at the trunk configuration level.  So I go to my Trunk Configuration for PSTN-GW (  If you do not have a trunk configuration for this gateway you must create a new pool-level trunk config and select this gateway.


That is it!  For the purposes of inbound routing there is absolutely no need to assign these PSTN usages to either of the GW-CIC or the GW-LAB trunks in Lync.  You might be asking yourself, why is this, well let’s go to the logs and see what we get.

1. We get the normal inbound four digit number.


2. We normalize our four digit number into E164


3. Now we get a new retargeting event


4. Then we get a new event of creating an outbound routing object.


5. Then we see it apply an inter-trunk rule


6. Now we see the trunk is selected


7. And lastly we see the route is selected.


So now that we see what is happening on the Lync Server, what do we get on the GW-LAB servers for incoming messaging?  If we do a quick trace there we can see this:

So the inbound call is coming in as E614.


This makes sense because we normalized the number to E164 back in Lync.  That number was determined to be used for inter-trunk routing because of our PSTN usage applied to the GW-PSTN.  But remember, our scenario needs us to send four digits to GW-LAB.  So in order to accomplish this, we need to go back to our Lync server and create a new PSTN Trunk for GW-LAB.

So here you can our new trunk and rules:


So we run the trace again:

pic22 pic23

And now we are sending the four digits to GW-LAB as we needed.  So although the documentation is a little thin around this (meaning there is next to none) it is very possible to front end all of your PSTN traffic with Lync.  We will do a part two on this for cover the other parts of the scenario, outbound routing and such.  But frankly, that part isn’t all that difficult.


16 thoughts on “Inter Trunk Routing Deep Dive

  • June 10, 2013 at 4:05 pm

    Sorry for stealing your thunder, Richard!

    One of the first places I looked for info on inter-trunk routing was your blog. Didn’t notice it was listed as “upcoming” until after I posted.

    Nice look at the details behind inter-trunk routing. It NOW makes sense that I would only apply the usages to the inbound trunk, rather than the outbound one. Not sure why I thought it was needed on the exiting trunk as well. Now, I gotta go update my post.


  • June 10, 2013 at 7:59 pm

    Ken – no worries – I was kind of joking on the stealing the thunder part. Just wanted to make sure to reference/acknowledge you had your post.

    • June 10, 2013 at 8:01 pm

      …and I’ve done the same on my post as well.

      Great minds think alike, eh?


  • July 29, 2013 at 8:02 pm

    When attempting to Troubleshoot dropped calls that passed thru an inter-trunk route; will the monitoring server show data or do you have to run trace until end users report more dropped calls?

  • July 30, 2013 at 9:50 pm

    Thanks dear this good article.

    I have a doubt… how work for vice-versa from PBX to LYNC to PSTN ???

  • August 26, 2013 at 2:15 pm

    Hi there would you mind letting me know which webhost you’re utilizing? I’ve loaded your blog in 3 completely different browsers and I must say this blog loads a lot quicker then most. Can you recommend a good hosting provider at a reasonable price? Kudos, I appreciate it!

  • Pingback:Inter Trunk Routing Deep Dive

  • Pingback:Understanding Voice Routing | Dialing Behaviors

  • Pingback:Understanding Voice Routing | Routing & Authorization

  • Pingback:Understanding Voice Routing | Inbound Routing | Mastering Lync

  • Pingback:Транзитные звонки в Lync Server 2013 | ILYA Sazonov: ITPro

  • February 3, 2015 at 3:19 pm

    Hi. Excellent post – and yes, I’m just now finding this since it was posted 1.5 years ago. Was there ever a part 2 written? I’m interested in all of the call flows in your diagram and how they differ. Thanks.

  • March 9, 2015 at 7:35 am

    Have you tested if there is a differences if the mediation server is standalone or consolidated?

  • June 23, 2015 at 11:32 am


    Is it possible to get the call sent back out the same trunk it came in on?

    I have a bunch of DDI that mostly terminate on to Lync, but some still need to go to a Mitel system during the migration.

    I would like to send every thing to Lync, then any thing Lync does not pick up send back out the same trunk it was received on, where it will hit a SONUS SBC and get pushed to Mitel.

    This way I can reduce my rule from filtering specific numbers to saying “send all to Lync” .. “if not found send back to Sonus” … if coming from Lync and an internal extension send to Mitel. I know its not tidy but it will make the migration simpler. As basically were every the DDI is configured it will eventually reach it with out any policy changes.

    • July 2, 2015 at 1:07 pm

      Yes you can send calls back out the same trunk. I wondered this myself way back when, and it worked like a charm.


  • April 5, 2017 at 7:26 am

    We faced an issue of looping calls coming from a number that is not added in Unassigned number range or to any object. Is this caused by inter trunk routing?


Leave a Reply to Peter Frederiksen Cancel reply

Your email address will not be published. Required fields are marked *