[Date Prev][Date
Next][Thread Prev][Thread Next][Date
Index][Thread Index]
Re: Re: Text messaging from web url
Alex,
Will a message not get through if > 128 characters?
If not, maybe the script should check the length of the outgoing message,
if it
is >128 then truncating it and warning the user (via log) or if you
wanted to
get fancy, split it into multiple messages!
Also, I think it would be useful if your system could return the number of
remaining credits. Maybe this could be returned with the initial
"ok" response
e.g. "ok-42" or if that is not possible perhaps have a separate
query e.g.
http://www.sendmytxt.com/app/httpsend.asp?from=07123456789&pin=1234&creditcheck
Using the first method, the existing script could check it against a
threshold
every time a message was sent and advise the user of low credits in a
number of
ways.
The second method would require a new reoccurring script and would generate
unnecessary hits on your site.
Either way it would help prevent running out of credits, which would be
somewhat annoying if an important message didn't get through!
Cheers,
Justin.
Quoting Alex Kinch <alex@xxxxxxx>:
> Quick fix to that script, nothing serious - just pulled out a
redundant bit
> of scripting.
>
> - Replaced 'hs.writelog "SMS Info", "Message reads:
" &
> Replace(Message,"&"," ")' with 'hs.writelog
"SMS Info", "Message reads: " &
> Message' as we no longer need to search for '&'s in the message
body to
> replace with a space.
>
> Alex
>
> '******************************************************************
> 'Script to send SMS messages using the sendmytxt.com service
>
> 'Call this function from your scripts or as a one-liner like this:
> 'hs.RunEx "sms.txt","SMS","RECIPIENT
NUMBER","TXTMESSAGE"
> 'e.g. hs.RunEx
"sms.txt","sms","123456789,Hello World"
>
> Function sms(Params)
>
> Dim MyMobileNum, PIN, Recipient, Message, host, page
>
> SMSinfo = Split(Params,",")
>
> Recipient = Trim(SMSinfo(0))
> ' Message = replace(SMSinfo(1)," ","&")
> Message = SMSInfo(1)
>
> PIN = "12345" 'Your sendmytxt.com PIN goes here
> MyMobileNum = "1234567890" 'The mobile number you registered
goes here
>
> host = "sendmytxt.com"
> page = "/app/httpsend.asp?"
> page = page & "from=" & MyMobileNum &
"&to=" & Recipient & "&pin=" & PIN
> page = page & "&message=" & Message
> strip_tags = false 'true
> port = 80
>
>
> Result = Trim(hs.GetURL(host, page, strip_tags, port))
>
> Select Case Result
>
> Case "0" ReturnVal = "No from number or pin
entered"
> Case "-1" Returnval = "from number not a registered
user"
> Case "-2" ReturnVal = "incorrect pin"
> Case "-3" ReturnVal = "account suspended"
> Case "-4" ReturnVal = "insufficient credits"
> Case "-5" ReturnVal = "message sending failed"
> Case "-6" ReturnVal = "format of to number not
recognised"
> Case "-7" ReturnVal = "format of from number not
recognised"
> Case "ok" ReturnVal = "message sent successfully"
>
> End Select
>
> hs.writelog "SMS Info", "Sending message to: "
& Recipient
> hs.writelog "SMS Info", "Message reads: " &
Message
> hs.writelog "SMS Info", "Service response: " &
ReturnVal
> sms = ReturnVal
> End Function
Home |
Main Index |
Thread Index
|