JABTEST3

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  . . . . . . . . . . . .  ____________________________________________
  • From ID - Enter the ID that your have a GreenJab Listener job running for (ie, greenjabtest@gmail.com)
  • To ID - Enter the ID that you wish to send the message to
  • Message - Enter the message you wish to send

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 0
D WPFROM          S            256
D WPTO            S            256
D WPMSG           S           1024
 ********************************************************************
C     *ENTRY        PLIST
C                   PARM                    WPFROM
C                   PARM                    WPTO
C                   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