« Back to APIs

Get Contact DN

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Team,
 
Is there any way to get a contacts DN?  If I view the raw XMPP it looks like that info is available but I don't see anything available in the API.  I'd like to be able to list out each contacts phone numbers and determine which DN is associated with the primary voice presnce.  Ideally I'd like to be able to determine line status for every DN a contact owns, but I'll take what I can get.

Hi David,

As part of the presence packet, you will be able to get this info, but in a crude XML format, which you might have to parse yourself.

in Jabber IM/CAXL SDK: client.event("presenceReceived").bind(function(evt){console.log(evt.data.xml());});

results in

<presence xmlns="http://jabber.org/protocol/httpbind" from="shjayago@alpha-cup.cisco.com/composed" to="shjayago@alpha-cup.cisco.com"><c hash="sha-1" node="http://cisco.com/cup/caps" ver="L0mwOaX6n8VnczsxLk2dMU2QzAg=" xmlns="http://jabber.org/protocol/caps"/><priority>127</priority>
<presence entity="sip:shjayago@alpha-cup.cisco.com" xmlns="urn:ietf:params:xml:ns:pidf"><person id="shjayago" xmlns="urn:cisco:params:xml:ns:pidf:rpid"><preferred-phone>BUSINESS</preferred-phone><activities><available/><phone-status>available</phone-status><im-status>available</im-status></activities></person><display-name xmlns="urn:ietf:params:xml:ns:pidf:cipid">Shankar Ganesh Jayagopi</display-name>
<tuple id="4463933f-129e-1d36-27f8-0e235d8fc6ea-9a86b77b-4875-98cd-ed2c-a507345c2e54" xmlns="urn:ietf:params:xml:ns:pidf"> <status> <basic>open</basic> </status> <sc:servcaps xmlns:sc="urn:ietf:params:xml:ns:pidf:servcaps"> <sc:audio>true</sc:audio> </sc:servcaps> <contact priority="0.8">sip:81384655@10.53.40.14:5060;dpkid=9a86b77b-4875-98cd-ed2c-a507345c2e54;npkid=4463933f-129e-1d36-27f8-0e235d8fc6ea</contact> <model>unknown</model> <deviceID>0022905C69E3</deviceID> <timestamp>2012-04-25T17:45:05Z</timestamp> </tuple> <tuple id="Jabbersampleclient" xmlns="urn:ietf:params:xml:ns:pidf"><status><basic>open</basic></status><servcaps xmlns="urn:ietf:params:xml:ns:pidf:servcaps"><type>text/plain</type><type>application/x-cisco-cupc+xml</type><text>true</text></servcaps></tuple>
</presence></presence>

Note 1: evt.data is an object of type jabberwerx.Presence, which has handy functions like getStatus etc.
Note 2: If there are multiple DNs for a contact, you should be able to see them all in the presence packet.

thanks
Shankar