Dialing A SIP URI With An “;ext=” Parameter

Home » Asterisk Users » Dialing A SIP URI With An “;ext=” Parameter
Asterisk Users 2 Comments

Hi All,

In the midst of trying to pilot a deployment of Microsoft Lync (mainly for non-voice collaboration, specifically IM) and integrate it with our Asterisk (11.6.0 if it matters) deployment and a “everything in one place” tool when people are out of the office.

I have everything on the voice side playing nice from the Lync side (Lync->Lync, Lync->Asterisk, Lync->Asterisk->PSTN) but I can’t get calls from Asterisk->Lync passing.

I think the root issue is Lync demands that the “line URI” be entered in a E.164 normalized format, and further specifies that if an extension is specified it should be entered as ;ext=. So, e.g. when I have myself set up in LYNC my Line URI is entered as “tel:+144044911100;ext=1407”.

If I try feeding that into an Asterisk DIAL() using any format I can think of (specific examples below) the call fails and the following is logged to console; it looks like Asterisk is dropping the “;ext=”…
== Using SIP RTP CoS mark 5
— Executing [1407@yyyyyyy:1] Dial(“xxxxxxxxxx”, “SIP/lync/”+14404491100”) in new stack
== Using SIP RTP CoS mark 5
— Called SIP/lync/+14404491100
— Got SIP response 485 “Ambiguous” back from
== Everyone is busy/congested at this time (1:0/0/1)
— Auto fallthrough, channel ‘ xxxxxxxxxx’ status is ‘CHANUNAVAIL’

On the other hand, if I change my line URI to a “random” and unused in Lync E.164 number without an extension and change the DIAL() to reflect that number… the call succeeds, so it seems like I’ve narrowed it down to just needing to figure out how to properly pass the extension to Lync.

The Googling I turned up didn’t seem too positive (and suggested using an Exchange Unified Messaging auto attendant and forcing the user to redial the extension once connected to the AA was the only alternative for non-DID users) but it seems like it should be relatively simple to bridge (what seems like a very small) gap.

Here are the least embarrassing variations on Dial I’ve tried

Dial(SIP/lync/+14404491100;ext=1407) <-- 485 Ambiguous response as above Dial(SIP/lync/"+14404491100;ext=1407") <-- 485 Ambiguous response as above Dial("SIP/lync/+14404491100;ext=1407") <-- 485 Ambiguous response as above Dial(SIP/lync/+14404491100/1407) <-- call 'sits there' and multiple "sip_xmit of 0x7ffab40891e0 (len 841) to returned -1: Invalid argument" logged to console Any assistance, is as always very appreciated. Thanks! Lincoln

2 thoughts on - Dialing A SIP URI With An “;ext=” Parameter

  • Ok, so now I just feel kind of stupid. After I got home I decided to play with this a little more.

    After far too long I realized that part of the issue was Asterisk parsing the ; as a beginning of a comment (hindsight=duh). A little bit more experimenting and (though I could swear I tried this before) replacing the ; with \; works.

    That is, to dial a E.164 normalized number with an extension configured as tel:+14404491100;ext=1407 with the SIP Peer for the Lync mediation server named “lync” the working dial() is


    Hope this may save someone else time down the road.

  • I am going to try a Lync server/asterisk integration, so I really appreciate!


    2014/1/21 Lincoln King-Cliby