Monday, February 22, 2021

Text Messaging from Manage 2000?

Recently, while thinking about system administrator notifications, I was chagrined to realize that SUB.TEXT.OUTPUT did NOT have a Text Message method. So I started to do a little research into Text Messaging and some more about using Unibasic Extensions to interact with REST services.

Now, there are a couple of different approaches to launching text messages programmatically:

1. Send an email to the phoneNbr@carrierGateway where the carrierGateway is a destination which converts emails to text messages for that particular carrier.

2. Send REST requests to third party services like Twilio and Nexmo which by-pass the carrier gateway. 

So if it is no bother to 'know' what carrier the phone number you are text messaging belongs to then option 1 is fine.  If on the other hand you want to text message phones which may change carriers at anytime without letting you know then it might be worthwhile to go with option 2.

To begin with I added the PHONE.CARRIERS table to 8.1 sp5 which can hold the gateway suffix for each carrier.  This can be used directly in an application to build the email destination and then the EMAIL method can be used to 'email' a text message to a phone. There is a new prompt in CONTACTS to hold the carrier.

I also added a property for Carrier to the EMAIL method. So, alternatively you can call SUB.TEXT.OUTPUT with Method=Email, To=phoneNbr and Carrier=carrierCode to send 'text messages' via carrier gateways.

Option 2 is complicated by the fact that each Text Messaging service provider uses a different interface. Yes, they are all REST, but some use Basic Authentication tokens while others pass credentials in the form variables.  They each use their own nomenclature for various variables in the request.

So I have attempted to make a pluggable interface with a new table named TEXTING.SERVICES. This table lets you configure the URL, Basic Authentication token, and map form variables from literals or properties of SUB.TEXT.OUTPUT.  We'll see how flexible it turns out to be.



At any rate, there is a new method for SUB.TEXT.OUTPUT in 8.1 sp5 named TEXTMSG which requires a property 'Service' to select the interface table from TEXTING.SERVICES. 


Next level up will be how to incorporate Text Messaging as a destination in the ECA system!

(More details of REST service programming using the UniBasic Extensions next time.)