cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1461
Views
1
Helpful
9
Replies

Presences of contacts not in contact list

phuongthanhvo
Level 1
Level 1

Hi all,

I am currently using Smack sdk to develop jabber client to login to Cisco Jabber server and facing a difficulty of getting presences of contacts (internal contacts, not federated contacts) in search result. If searched contacts are not in my contact list (not in roster). Could you please give me some idea or direction to achieve this feature? I am appreciated any help.

Thanks,

Phuong Vo

1 Accepted Solution

Accepted Solutions

The QuickContactController is defined in the jabberwerx.cisco.js file, so make sure this file is include in your web page via <script> tab, e.g.:

    <script type='text/javascript' src='../../jabberwerx.js'></script>
    <script type='text/javascript' src='../../jabberwerx.cisco.js'></script>

And is actually able to be loaded (you can check your browser's debug page - e.g. F12 in FF - 'Network' tab and refresh the page to make sure jabberwervx.cisco.js is actually loading)

View solution in original post

9 Replies 9

dstaudt
Cisco Employee
Cisco Employee

I believe you can establish a mutual presence session with an arbitrary user via the jabberwerx.RosterController.subscribe() or jabberwerx.controllers.quickContact.subscribe() methods.  Note, if the user is not already on the roster, the default behaviour is for the target user's client to be notified of a presence subscription request, which must be manually or automatically approved/denied before any presence is provided.  However, it is common that enterprise IM&Presence server admins enable automatic presence subscription approval for all users, in which case it should just work without the approval steps.

npetrele
Cisco Employee
Cisco Employee

The Cisco Jabber server can handle presence queries, but you're using Smack SDK, which is a third party Java SDK.  You'd have to ask this question of the Ignite Real Time (I think that's the name) people.  That API probably has its own approach to querying the presence of people not in your personal roster, maybe equivalent to the quick contact approach described by David. 

Hi Nick,

Since there is the only one choice for me to work with Cisco Jabber server is using CAXL library, so we did enable BOSH server. I run the demo, it worked fine. So I was going to implement for getting contacts' presence that are not in contact list. Base on The CAXL Book :: Chapter 4 - Contacts and Presence document I need to have a QuickContactController object as implement below:

                    var client = new jabberwerx.Client('basic chat');

                    ...

                     var quickcontacts = new jabberwerx.cisco.QuickContactController(client);     //throws exception here

                     //connect to server using username, password and arguments specified above

                     client.connect(jabberwerx.$("#username").val() + "@" + demoConfig.domain,

                                jabberwerx.$("#password").val(), arg);

However, it always throws exception on creating QuickContactController object with message "Cannot read property 'QuickContactController' of undefined". Can you point me out what I did wrong?

Thanks,

Phuong Vo

The QuickContactController is defined in the jabberwerx.cisco.js file, so make sure this file is include in your web page via <script> tab, e.g.:

    <script type='text/javascript' src='../../jabberwerx.js'></script>
    <script type='text/javascript' src='../../jabberwerx.cisco.js'></script>

And is actually able to be loaded (you can check your browser's debug page - e.g. F12 in FF - 'Network' tab and refresh the page to make sure jabberwervx.cisco.js is actually loading)

Thanks for your help. This feature works by using CAXL library! Now I don't know how to use this library to my project since it is java base. Thank you for all of you guys help.

Phuong Vo

Hi Nick,

I got it, I need to add the reference to jabberwerx.js to basicChat.html

<script type="text/javascript" src="caxl/jabberwerx.js"></script>

Thanks,

Phuong Vo

phuongthanhvo
Level 1
Level 1

Thanks dstaudt and Nicholas Petreley.

For dstaudt's suggession I have to use CAXL library which is an AJAX library but we are base code is in java.

In the mean time I try to post question how to query presences to Ignite Real Time (but most of the time, the answer comes back couple years later!).

Does Cisco have similar CAXL library in java? Please let me know!

Again, thank you very much for your helps.


Phuong Vo

Cisco does not provide a custom Java XMPP stack.

Smack does seem to have the ability to do quite low-level XMPP protocol functions, so keep in mind that the basic operation you are looking for is based on the XMPP Subscribe mechanism:

https://xmpp.org/rfcs/rfc6121.html#sub-request

Hi dstaudt,


I have response on " does Smack API support query presences of non-contact list?" as following:


"... there is no such thing as „presence queries“ in XMPP. I’ve worked with Smack API for 4 years and I never saw anything like that."


And my question is presences of contacts NOT IN CONTACT LIST (NOT ROSTER CONTACT), meaning the contacts are not subscribed. If contacts are subscribed, I all ready know their presences.

I see the Cisco Jabber desktop and mobile clients have this feature (presences of contacts not in contact list), do you know what SDK that they use? We bought Cisco Jabber server, I hope that we can have that SDK.


Thanks,

Phuong Vo