The JABTEST3 sample includes a command, named JABTEST3, and a processing program named JABTEST3 that does the work.
Send Message to Jabber Client (JABTEST3) Type choices, press Enter.From ID . . . . . . . . . . . . ____________________________________________To ID . . . . . . . . . . . . . ____________________________________________Message . . . . . . . . . . . . ____________________________________________And example of the command is as follows:
JABTEST3 FROMID(greenjabtest@gmail.com)
TOID(bvstone@bvstools.com)
MSG('This is a test from GreenJab. We''re testing the JABTEST3 program.')
The result is a message is sent to user bvstone@bvstools.com as shown here:
CMD PROMPT('Send Message to Jabber Client')PARM KWD(FROMID) TYPE(*CHAR) LEN(256) MIN(1) + CASE(*MIXED) PROMPT('From ID')PARM KWD(TOID) TYPE(*CHAR) LEN(256) MIN(1) + CASE(*MIXED) PROMPT('To ID')PARM KWD(MSG) TYPE(*CHAR) LEN(1024) MIN(1) + CASE(*MIXED) PROMPT('Message') H DFTACTGRP(*NO) BNDDIR('GREENJAB') **************************************************************** * * This sample is used to show how you can send a message to someone on a * chat service * This program is actually called from command JABTEST3. That makes it easier * to pass larger parameters. * * Steps to test: * 1. Use the GREENJAB command to start a listener job for the fromID * 2. Call the JABTEST3 command, making sure the from ID is the same as the one * use to start the GREENJAB listener job * 3. The message should appear on the chat client for the "to" user. * 4. Send the message **QUIT** to end the GreenJab listener job. * **************************************************************** * Imports **************************************************************** /COPY QCOPYSRC,P.GREENJAB ****************************************************************D RC S 10i 0D WPFROM S 256D WPTO S 256D WPMSG S 1024 ********************************************************************C *ENTRY PLISTC PARM WPFROMC PARM WPTOC PARM WPMSG /free // set the from ID, this should be the same ID used in the GREENJAB command // to start the listener job #gj_setFromID(WPFROM); if (#gj_isActive > 0); //Sent the message to the user RC = #gj_enqMsg(WPTO:WPMSG); endif; *INLR = *ON; /end-free