Detecting routed to sip address in a MSPL script from an incomming ddi number

243 views Asked by At

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:[email protected];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 >
[email protected]</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").

1

There are 1 answers

0
Shane Powell On

For those in the same boat, I finially settled on using the 'P-Asserted-Identity' sip header to determine who the phone call is being routed to/from. The only problem is that it doesn't show up in the inital invites (as that would be for the From side anyway), but in the 180 ringing response.