Chapter 11. Remote Commands

XMPP includes several technologies used to send commands to other entities. These technologies enable you to remotely control servers and clients—for example, to add users to a server, configure a multiuser chat room or a pubsub node, tell another client of yours to go offline, or define the fields needed to register an account on a server or other service. In Chapter 6 and subsequent chapters, we’ve seen some of these technologies in action through the use of the Data Forms extension. In this chapter, we take that knowledge further to explore more advanced workflow applications.

Controlling Clients

Picture the situation: Alice is expecting an important message to come in through her Jabber client, but she is running late for a very important date, so she sets off in a hurry for the party. Once she arrives at the party, she logs in again with her mobile phone but realizes that she left her other client logged in. Her urgent message has probably been sent to her other client, and she needs it now! What does she do? Using a combination of XMPP technologies, she can command her other client to forward the messages to her at the party and then to go offline so that no further messages will be sent to the wrong resource.

The key piece here is the Ad-Hoc Commands protocol, defined in XEP-0050. This XMPP extension provides workflow capabilities that can be used for any structured interaction between two XMPP entities, called the requester (the entity that requests ...

Get XMPP: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.