In Lync 2013, if you setup a DDI for a lync contact and call it from a external number, the sip request that a MSPL script sees is that it's being sent to the E164 formatted DDI e.g.
To: <sip:+6491234567@xxx.com;user=phone>
I'm trying to find out what lync client it's being sent to.
The best I've figured out is to use the QueryCategory method to pull out contact card email address and assume that putting a "sip:" on the front will get me the sip address. I know this is not a good assumation as the sip address can be different to the email address.
e.g.
toContactCardInfo = QueryCategory(toUserUri, 0, "contactCard", 0);
Which gives me:
<contactCard xmlns=""http://schemas.microsoft.com/2006/09/sip/contactcard"" >
<identity >
<name >
<displayName >
Lync User</displayName>
</name>
<email >
lync.user@xxx.com</email>
</identity>
</contactCard>
Is there any other way to get the sip address from the "to" uri?
I'm thinking that QueryCategory may work for me but I'm finding the MSDN documentation hard to figure out what that would give me the sip address from the ContainerNumber and Instance parameters for any of the allowed Category names ("userProperties", "workingHours", "dndState", "routing" or "contactCard").