× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello All,

I decided to create a quick bare bones example to demonstrate sending,
receiving and routing of SMS messages on the iSeries. I also decided to
removed all the business logic from the RPG program to keep it simple. There
are three basic parts to the entire system:

1. Inbound SMS routing. This is a feature of the SMS gateway software that
allows you to define a rule set. If the SMS message text matches the rule
you define, a program will be called with parameters that you specify.
2. An RPG program. (I decided to exclude any unrelated logic; however, this
of course would be where your business logic would exist)
3. A CL program that sends a reply to the sender.

I uploaded a screenshot of the rule/routing screen here:
http://www.icebreak4rpg.com/temp/SMSRule.jpg

*The screenshot:* The rule states that if the inbound message starts with
the message text "Info" and a " " (space), SMSDEMO/EXAMP01 will be executed
with TEXT as a program parameter.

*The RPG program: *The program is very basic. It simply accepts two
parameters. By default the SMS rule will send the user's telephone number as
the first parameter and all other parameters will be sent in the order that
you specified them in the rule. Notice in the screenshot I defined TEXT as
160A and as the first parameter after the default phone number. (160 chars
is the entire message)

CODE:
D main PR extpgm('EXAMP01')
D telNo 30A
D msgTxt 160A
D SndSms PR extpgm('SMSDEMO/SNDSMS')
D telNo2 30A
D msgTxt2 160A
*-------------------------------------------------------
D main PI
D para1 30A
D para2 160A
/free
callp(e) SNDSMS (telNo:msgTxt);
return;
/end-free

*The CL Program: *The CL program is called inside the rpg program using the
callp command. Here I will display a message to my 5250 to visually see that
the CL command gets called and send the message.

CODE:

Pgm Parm(&Phone &Text)
Dcl &Phone *Char Len(30)
Dcl &Text *Char Len(160)

SNDPGMMSG MSG('Sending ' *BCAT &Text) TOUSR(ZDIMAL#M) MSGTYPE(*COMP)
Sms/SndSmsMsg Text(&Text) Phone(&Phone)

EndPgm
I hope this gives you a good understanding of how it works. The software we
use is called BlueSeries SMS by System & Method.
http://www.system-method.com/BS/sms.htm

There also also many other parts to BlueSeries SMS such as system monitoring
and system administration. This allows you to receive system messages on
your cellular phone and reply to the message and execute system commands
from your cell phone. But that is a discussion for another email ;).

Best Regards,
Milan Zdimal


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.