Microsoft Teams and Skype for Business News and Thoughts

Tom Arbuthnot MVP
Tom Arbuthnot MCSM Communications

This site uses cookies

Find this blog useful? Please take a second to share, thanks!

Strip Lync Calling Extension (;ext=ZZZZ) on Outbound calls via Sonus Gateway

Published 28/04/2014 - 7 Comments

Quick post for reference really

Lync users are usually setup with their number in the format “tel:+XXXXXXXYYYY;ext=ZZZZ”

Often, YYYY and ZZZ match and are set mainly for PIN sign in on Lync phones.

On a Lync setup I noticed calls were going out with the calling party set as “+XXXXXXXYYYYZZZZ”, obviously incorrect. No matter how I messed with the rules ZZZZ kept getting appended. I could “hack it” by Stripping to “XXXXXXX” and having the extension appended, but it wasn’t right.

I didn’t initially realise that the Sonus has a specific “Type” match for “ext=ZZZZ” on it’s translation rules called “Calling Extension”. Adding a rule to catch and strip this quickly removed the issue. In this example we actually wanted the calls to go out anonymous.





Sonus have documented the process nicely here:

Tom Arbuthnot

Tom Arbuthnot

Principal Solutions Architect at Modality Systems
Tom Arbuthnot is Principal Solutions Architect at Unified Communications specialist Modality Systems. He is a Microsoft Certified Master and MVP, blogger, has a regular podcast with UCToday at and is a regular speaker at events including Microsoft TechEd and Ignite. He co-runs The Microsoft UC User Group London.


Lasse Wedø - 28/04/2014 Reply

Yes, Sonus has really powerful ways of editing “things” with your call. Calling, called, diversion headers, call forking and more. Which is why I recommend all advanced customers to get at least one. I’m in the middle of a fairly advanced setup myself.

But for those who do not have one, this can (in 2013) be done within the calling rules of Lync. Edit the “calling number translation rule”.
Match by (^\+\d+*)(\s*\S)*$ and translate to $1

Should fix the same thing.

    Tom Arbuthnot - 29/04/2014 Reply

    Nice tip Lasse, thanks for the commment

Damien Margaritis - 30/04/2014 Reply

Something of interest: on older versions of Sonus(NET) firmware the logic did not behave like this. If you had an entry to grab, for example, the first 10 digits from the calling address/number field, the extension would be stripped off without having to worry about the calling extension field.

I don’t recall the exact version when they started to treat the extension as a separate field to manipulate, but when updating SBC’s to that version or above the change in logic can cause a bit of pain… Something to keep in mind if updating a gateway from a very old release.

There was also a change at some point that changed what .* would match. It used to match “something but not nothing” but was changed to “something OR nothing”. This also had an effect on routing logic.

Graham Cropley - 17/07/2014 Reply

Thanks Tom, I had this issue, and was trying to understand why Calling Address/Number rules didn’t strip the ext=1234. Thanks for posting.

    Tom Arbuthnot - 18/07/2014 Reply

    Glad it was useful :-) Thanks for the comment

Leave a Reply:


Weekly Email Update 
of all the key 
Microsoft Teams and Skype for Business News
every Tuesday

No Spam ever, I promise - Tom