Venues use Jabber for instant messaging between AG users. Non-user entities like devices and services could be equipped with a Jabber responder, too. Imagine instrumentation that sends reports to a dedicated Venue (e.g., Fusion), or a multi-stage compute job that reports progress to a Venue (and directly to the person who submitted it, of course).

# This script creates a jabber client, connects to a chat room,
# sends a message, and disconnects. Applications could use this
# to send text to an Access Grid venue.

import sys
import logging
import getpass

from AccessGrid.Jabber.JabberClient import JabberClient,log
from AccessGrid import Log

jabberId = sys.argv[1]
message = ' '.join(sys.argv[2:])
jabberPwd = getpass.getpass('Password:')

# set up jabber server stuff
# note: modify these to suit the server and chatroom
jabberHost = ''
jabberPort = 5223
room = 'Argonne-National-Laboratory('
conferenceHost = ''

# set up logging to avoid underlying modules spewing to screen
log = Log.GetLogger(Log.Bajjer)

# create the jabber client and connect
jabber = JabberClient()
jabber.Connect(jabberHost, jabberPort)

# set user info and login
name = jabberId
jabber.SetUserInfo(name,jabberId, jabberPwd, 'resource')

# join chat room, send message, and exit
jabber.SetChatRoom(room, conferenceHost)

# silence error from bajjer


This example takes the jabber username on the command line, followed by the words of the message you want to send. The script takes all the trailing words and composes a single message from them. It will prompt for the password when run.

python jabberId All the words of the message you want to send

Suggested Further Work

  • Modify to take a Venue URL, retrieve the Jabber room details, and send the message
  • Build Jabber bots to report items of interest to Venue chats
  • Build a web-based Jabber client using the AccessGrid JabberClient module (or using Bajjer directly) to enable mobile clients and web users to Jabber into Venues

login or register to post comments