***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:+firstname.lastname@example.org;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:email@example.com;user=phone>;epid=754CB7883F;tag=4