Thursday, March 31, 2011

Strip “+” from RequestURI - Lync 2010

Recently I ran to interesting case – a colleague from another organization uses SIP Trunk provider who does not “like” E.164 number format, thus had problem with outbound calls and Lync user Caller ID presentation. While stripping “+” is now made easy with the new “Trunk Configuration” feature in Lync…


***Note the simple RegEx. Because Lync uses E.164 format, the number will always begin with “+” and we remove 1 “digit”, thus the number sent in TO header to the trunk/gateway will be non-RFC 3966 compliant.

...the problem was that while we sent non -RFC 3966 compliant TO header, FROM header still contains "+": FROM: "Drago Totev"<sip:+14785550001@fe.drago.local;user=phone>;epid=754CB7883F;tag=48b2223f97, and since the provider cannot handle it, as a result, the called party sees "Anonymous" as Caller ID.

Fortunately, Lync Management Shell cmdlet “Set-CsTrunkConfiguration” can resolve this issue.

First, we run “Get-CsTrunkConfiguration”. In this example, because I have not created new trunk, only the default – Identity “Global” is presented.


***Note the parameter “RemovePlusFromUri” is currently set to “False”. It is important to understand the fact setting this to “True” will force Lync to convert ANY E.164 in the RequestURI header to non-RFC 3966 compliant.

In the case above, we run “Set-CsTrunkConfiguration -Identity "Global" -RemovePlusFromUri $true”


Now my FROM header is non-RFC 3966 compliant.

FROM: "Drago Totev"<sip:14785550001@fe.drago.local;user=phone>;epid=754CB7883F;tag=4

4 comments:

Anonymous said...

thanks for posting this!

eythimeethi said...

thanks for sharing this. was useful to me

Unknown said...

This is extremely useful. my CUCM admin has asked me to strip the + from the FROM: teluri ... I don't think that it's a good idea ... but, I am glad that it appears that I can do this via your blog. Thank you for sharing.
greg

chamjisky said...

hi
i also need to strip + from the begining but its not working.
i have created same rule from gui as you shown and also applied the command and verified it.
but still in my sip/invite and other messages contain +

From: ;tag=b8fb4f86d2;epid=7eebc61da2
To:

any idea why ?
i am running lync 2010 with latest CU