XMPP Commands Phonebook & Journal

Hallo zusammen,

ich habe mich in den letzten Tagen etwas ins Thema XMPP eingearbeitet und versucht eine eigene Schnittstelle zwischen mobydick und unserer ERP Software, auf Basis von VB.net, zu entwickeln. Das Starten von Anrufen und das Empfangen von eingehenden Anrufen klappt auch soweit wunderbar und ich denke, dass ich das Konzept soweit verstanden habe.

Leider habe ich im Entwickler-Handbuch keinen Weg gefunden wie ich folgendes per XMPP lösen kann:

  • Phonebook Einträge erzeugen
  • Phonebook Einträge löschen
  • Abruf des gesamten Journals mit Angabe eines Zeitintervals

Ich weiß, dass all diese Funktionen in der REST API möglich sind, dachte aber eigentlich, dass die XMPP API alles kann, was auch die REST API kann. Oder ist es richtig, dass ich in diesem Fall mit beiden “Welten” arbeiten muss?

Vielen Dank für die Hilfe

Gruß,
Lars

Hi Lars,

Our documentation is a little bit outdated. Yes, it’s possible to create and to delete the phonebook entries. You can manage the user’s private and global phonebook (version >=7.10.00). If you want to be able to manage the global phonebook, your user need to have “Phonebook manager” permission defined in web-ui. I specified two command which creates and deletes the entry from the private phonebook for user “max.muster”. For the global phonebook entries you should leave phonebookType and phonebookName empty like phonebookType="" phonebookName=""


<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook">
   <PhonebookEntry eventId="" eventType="CREATE" phonebookType="identity" phonebookName="max.muster">
      <type>undef</type>
      <id>0</id>
      <firstname>Max</firstname>
      <surname>Muster</surname>
      <phone>11332211</phone>
      <fax/>
      <mobile/>
      <homephone/>
      <email/>
      <displayname>Max Muster</displayname>
      <organisation/>
      <notes/>
   </PhonebookEntry>
</cmd>


<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook">
   <PhonebookEntry eventId="" eventType="DELETE" phonebookType="identity" phonebookName="max.muster">
      <type>028phonebook</type>
      <id>5</id>
      <firstname>Max</firstname>
      <surname>Muster</surname>
      <phone>11332211</phone>
      <fax/>
      <mobile/>
      <homephone/>
      <email/>
      <displayname>Max Muster</displayname>
      <organisation/>
      <notes/>
   </PhonebookEntry>
</cmd>

Unfortunately it’s not possible to select a range from the journal. It’s possible to select last N entries for specified user (docu link). We plan to deprecate journal API and introduce better one. I will write your request as reminder to improve this part.

Kind regards,
Stefan

Hi Stefan,

thanks for the quick reply. You mentioned that the documentation is a little bit outdated. Is there a way to get a full list of all available commands?

regards,
Lars

Hi,

Not at the moment. We have only internal developer specification. I will talk with responsible person for documentation in our company to refine it

Kind regards,
Stefan

Hi Stefan,

another question which I didn’t found within the documentation.

My application receives IQ query from mobyDick. Something like “xmpp:ping”. Do I have to response on these pings to avoid a disconnect due to a timeout functionality?

If yes, is there an example how a response should look like?

Regards,
Lars

Hi Lars,

Which programming language do you use? Do you use some library? Ping is usually supported by the third part libraries. More information you can find in official xmpp documentation ping XEP

Kind regards,
Stefan

Hi Stefan,

thanks for the info. I’m coding in VB.net and I’m using the sharp.xmpp library. It seems that I only need to send a response query containing the Id of the initial ping request to keep my connection alive.

Hi Lars,

Yes, that’s correct. Maybe you can enable Ping extension and maybe it does job for you. sharp.xmpp ping extension

It would be very nice if you share your work on our github repo.

Regards,
Stefan

Hi Stefan,

I’ve got a new question. Is it possible that the FindAll command in the module “Phonebook” is broken?

I received the following log entry within the Openfire log:

2016.07.14 10:45:20 net.pascom.ahab.server.CommandIQHandler - Invalid Command: 
<iq type="get" id="4" from="kempa@mobydick/e569f985"> 
<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook"> 
<FindAll/> 
</cmd> 
</iq>

Or is there anything wrong with my command?

Hi Lars,

FindAll command is deprecated. You can use command Find

Attributes:

  • name - username of the user for private phonebook or empty for global phonebook
  • type - ‘identity’ - private phonebook, ‘’ - global phonebook, ‘all’ - private + global phonebooks
  • query (optional) - only results which contain the query will be returned
  • letter (optional) - returns the entries with given starting letter
  • offset (optional) - starting position in the result set
  • limit (optional) - number of entries

Find all phonebook entries in global and private phonebook for user max.muster filtered by the query


<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook">
    <Find name='max.muster' type='all' query='my-query' />
</cmd>

Find private phonebook entries for user max.muster matching the query and range from 50 to 150


<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook">
    <Find name='max.muster' type='identity' query='my-query' offset='50' limit='100' />
</cmd>

Find 100 global phonebook entries starting with letter b


<cmd xmlns="http://www.pascom.net/mobydick" module="phonebook">
    <Find name='' type='' letter='b' limit='100' />
</cmd>

Regards,
Stefan

Hi Stefan,

that’s great, thanks.

And again two more questions:

  1. Is it possible to query the DeviceList of other users? As far as I know I get the List within the ClientInfo result, but I think I can’t trigger this for a different user, right?

  2. Earlier you posted the two commands to CREATE and DELETE a phonebook entry. What would be the command to Update/Edit an existing one?

Regards,
Lars

Edit:

  1. Is it possible to get more then 100 Journal entrys, I tried the offset command from phonebook without success

Hi Lars,

  1. Since version 7.11.04 action FindUserInfo is available

<cmd xmlns="http://www.pascom.net/mobydick" module="xmppuser">
    <FindUserInfo jid='max.muster'/>
</cmd>

  • attribute jid is optional. If it’s empty it will return UserInfo of the sender. If you send jid which is different to sender’s jid, sender needs supervisor permission. More info available here and here
  1. Event type should be UPDATE and all parameters should be set. It’s not possible to update only for example phone number.

Kind regards,
Stefan