The GreenJab Command

GreenJab is a very powerful and useful utility that allows your IBM i (System i, iSeries, AS/400) to communicate with Jabber and XMPP servers such as Google Talk (GTalk) and Jabber.org.

GreenJab can be used to communicate between your IBM i and your smartphone, browser, or any device with a chat client installed.

GreenJab works by "listening" for communications to or from a specific ID that you start a job for. That ID can be a GMail (Google) email address for user with Google Talk, or an ID set up with another Jabber/XMPP server such as those at Jabber.org.

The first thing we need to to is start the GreenJab listener job. This is done with the GreenJab command. In this case we created a special ID on Google Talk named greenjabtest@gmail.com:

                       Start GreenJab Listener (GREENJAB)      
            
Type choices, press Enter.
User ID  . . . . . . . . . . . . greenjabtest@gmail.com______
Password . . . . . . . . . . . . ____________________________
                                                 
                           Additional Parameters                               
 
XMPP Server  . . . . . . . . . .   'talk.google.com'
Server Port  . . . . . . . . . .   5222          Number
Wait Time  . . . . . . . . . . .   5             Number
Ping Time Frequency  . . . . . .   600           Number
Timeout  . . . . . . . . . . . .   30            Number
Job Timeout  . . . . . . . . . .   0             Number
Max Connection Retries . . . . .   0             Number
Connection Retry Wait  . . . . .   0             Number
Chat Status  . . . . . . . . . .   'Available on GreenJab!'
Chat Resource  . . . . . . . . .   'GreenJab'
Job Key  . . . . . . . . . . . .
Bind to Local IP . . . . . . . .
Local Port . . . . . . . . . . .                 Number
Stream File Code Page  . . . . .   819           Number
Conversion CCSID . . . . . . . .   819           Number
Google Cloud Print . . . . . . .   *NO           *YES, *NO
Debug  . . . . . . . . . . . . .   *NO           *YES, *NO
Debug File . . . . . . . . . . .
  • User ID - Enter the user id of the account to start the listener job for
  • Password - Enter the password associated with the account for the user id
  • XMPP Server - Enter the server you wish to connect to. For example, Google Talk would be talk.google.com. Jabber would be jabber.org.
  • Server Port - Enter the port of the server to connect to. Most XMPP servers default to 5222.
  • Wait Time - Enter the time to wait between attempts to read data from the server. The default is 5 seconds.
  • Ping Time Frequency - Enter the frequency to send PING commands to the server. The default is 600 seconds.
  • Timeout - Enter the timeout value for communications.
  • Job Timeout - Enter the number of seconds for the GreenJab job to automatically end. The default is zero, which means never time out and end the listening job.
  • Max Connection Retries - Enter the number of retries to attempt if a connection is lost. The default is zero.
  • Connection Retry Wait Time - Enter the time to wait between connection retries. The default is zero.
  • Chat Status - Enter the status you wish to appear on the account when you are signed on.
  • Chat Resource - This is normally left blank as the resource is generated by the client/server communications. But, if for some reason you find that you may have some "orphan" resources out there you can set the resource to one of those, sign on, then end the job so the resource is freed.
  • Job Key - This is a unique key that can be specified if you wish to run more than one job for the same ID. If left blank, the default is the User ID.
  • Bind to Local IP - Specify the IP address, if any, you wish to bind the communications to.
  • Local Port - Enter the port you wish to bind the communications to. If this is left as blank and a local IP address is specified, the system will determine the port to use.
  • Stream File Code Page - Enter the value to use for stream file code page (for creating any IFS files, for example the debug file).
  • Conversion CCSID - enter the CCSID to use for EBCDIC to ASCII conversions.
  • Google Cloud Print - Specify *YES to subscribe to receive messages when Google Cloud Print jobs are processed (not functional at yet).
  • Debug - Specify if you wish debug to be turned on or not.
  • Debug File - Specify the debug file to use. If left blank and Debug is set to *YES, the system will generate a debug file name of /tmp/<userid>greenjabdebug.txt where "<userid>" is the userid specified

Once the job successfully starts, you should see any chat client that is set up to communicate with the user id specified change to "active" and if the status value is used, the status should be changed as well:

Once the GreenJab listener job successfully starts, you can now use an application on your IBM i to communicate with the chat client, or even use the chat client to send messages to your IBM i!