O'Reilly logo

XMPP: The Definitive Guide by Remko Tronçon, Kevin Smith, Peter Saint-Andre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required