' *********************************************************************** ' ' * Script to send a text message to an alphanumeric pager. * ' ' * * ' ' * This script uses the IXO Telocator Alphanumeric Protocol (formerly * ' ' * known as the IXO alphanumeric protocol). This protocol dictates * ' ' * what characters must be sent (by this script) and what characters * ' ' * the paging system should return. Using the GetComPortData function * ' ' * I had it working somewhat, but not with any consistancy. So I * ' ' * rewrote it by just using the "send some characters, wait some * ' ' * seconds, send some more characters, wait some more seconds, etc." * ' ' * method. And now it works quite well. * ' ' * * ' ' * Modem Telephone Number: * ' ' * To use this script, you need to get the telephone number to * ' ' * your paging provider's modem. This is not the same phone number * ' ' * that people use to page you. Most providers will give this to * ' ' * you if you just call them and ask for it. Just tell them that * ' ' * you've got a computer program that sends alpha pages, and you * ' ' * need the modem number that the program should dial to (it is * ' ' * usually toll free). * ' ' * * ' ' * PIN Number: * ' ' * This is just the PIN number assigned by your paging company. * ' ' * * ' ' * WaitSecs Settings: * ' ' * You may need to adjust the wait times I used. Specifically, * ' ' * you may need to adjust the WaitSecs call right after dialing * ' ' * the modem. * ' ' * * ' ' * Com Port Settings: * ' ' * The parameters used when opening the com port may also need to * ' ' * be adjusted. Most paging services use even parity with 7 data * ' ' * bits and 1 stop bit. Also 1200 baud (or maybe 2400) should work * ' ' * fine. * ' ' * * ' ' * Modem Initialization String: * ' ' * All modems are different. The initialization string used here * ' ' * is pretty standard and it works fine for me. I also send the * ' ' * 'M0' command, which mutes the modem speaker. You can remove * ' ' * that if you want. See your modem's documentation for more info. * ' ' * * ' ' * - Scott Crevier, 25-Mar-2000 * ' ' * scott@crevier.org * ' ' * www.x10.crevier.org * ' ' *********************************************************************** ' sub main () Dim vModemNumber,vPinNumber Dim vMsg,vErr ' *************************************************************** ' ' * Adjust these variables to fit your needs. * ' ' *************************************************************** ' vModemNumber = "1-800-123-4567" vPinNumber = "123456" vMsg = "This is a test page. I hope Scott's script works." ' *************************************************************** ' ' * Open the com port. Bail if it fails. * ' ' *************************************************************** ' vErr = hs.OpenComPort(1,"1200,E,7,1",0,"","") hs.WaitSecs 2 If vErr <> "" Then hs.WriteLog "Alpha Page","Error opening com port. " & vErr Exit Sub End If ' *************************************************************** ' ' * Initialize the modem. * ' ' *************************************************************** ' hs.SendToComPort 1,"ATZ" & vbCr hs.WaitSecs 1 'hs.SendToComPort 1,"ATM0" & vbCr 'hs.WaitSecs 1 ' *************************************************************** ' ' * Dial your pager provider's modem. * ' ' *************************************************************** ' hs.SendToComPort 1,"ATDT" & vModemNumber & vbCr hs.WaitSecs 20 ' *************************************************************** ' ' * Send the code (M) to enter manual mode. * ' ' *************************************************************** ' hs.SendToComPort 1, "M" & vbCr hs.WaitSecs 1 ' *************************************************************** ' ' * Send the PIN number and then the message. * ' ' *************************************************************** ' hs.SendToComPort 1, vPinNumber & vbCr hs.WaitSecs 2 hs.SendToComPort 1, vMsg & vbCr hs.WaitSecs 2 ' *************************************************************** ' ' * Hang up and close the com port. * ' ' *************************************************************** ' hs.SendToComPort 1, "+++" hs.WaitSecs 1 hs.CloseComPort(1) End Sub