mob_housing_architecture&text_messaging_technology

June 24, 2008

http://staff.ipm.edu.mo/~emilywong/images/mob_housing_architecture.ai

Above the diagram shows how our product works. We’re goingt to employ the text messaging technology’ Http Post Request’. The fellowing information shows how it incorporate with PHP or other programing languages.

<%@ Import Namespace=”System.Net” %>
<%@ Import Namespace=”System.IO” %>
<script language=”C#” runat=”server”>

void Page_Load(Object Src, EventArgs E) {
myPage.Text = readHtmlPage(“http://www.txtlocal.co.uk/sendsmspost.php&#8221;);
}
private String readHtmlPage(string url)
{
String result = “”;
String strPost =
“uname=youremail@domain.com&pword=yourpass&message=hello&from=SMITHS”+
“&selectednums=447740101097&info=1”;
StreamWriter myWriter = null;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);

//add Proxy info if required
//objRequest.Proxy = WebProxy.GetDefaultProxy();
//objRequest.Proxy.Credentials = CredentialCache.DefaultCredentials; //uses logged on user
//objRequest.Proxy.Credentials = new System.Net.NetworkCredential(“UserName”, “Password”); // Alternative – specify the user and password to use

objRequest.Method = “POST”;
objRequest.ContentLength = strPost.Length;
objRequest.ContentType = “application/x-www-form-urlencoded”;
try{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception e)
{
return e.Message;
}
finally {
myWriter.Close();
}

HttpWebResponse objResponse =
(HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
return result;
}
</script>

The HTTP POST API

HTTP POST can be used in all modern programming languages including ASP, ASP.NET, c++, c#, php, VB, VB.NET, command lines, SSH & cURL. The following section outlines how to send messages using either php or ASP. We can provide examples in other languages on request, simply Contact Us at support@txtlocal.com.

Meet the simple SMS API variables

info

A flag to switch on/off debug information. The following info is returned when info is set to 1:

Responses:
TestMode= 0 for live, 1 for testing (messages don’t go to handset and credits not deducted)

MessageReceived= The received message

URLReceived= The received WAP PUSH URL (not required)

ScheduledDate= The received scheduled SMS time (not required)

Custom= The received custom ID to be passed back in receipt (not required)

From= The received SMS originator. Uses account default if blank

CreditsAvailable= Number of credits at start. You can also call http://www.txtlocal.com/getcredits.php, passing uname and pword to get a credit total.

MessageLength= Length of the message in characters

MessageCount= Number of messages (break at 160, 306, 459, 612)

NumberContacts= The number of comma separted numbers

CreditsRequired= Credits required for job (MessageCount * NumberContacts)

CreditsRemaining= Credits remaining after the job

Errors:
Error=No credit
Error=Not enough credit for send
Error=Invalid login
Error=Message Too Long (>612 characters)
Error=Message not sent. Please check your data – especially the numbers. Are they all in INTERNATIONAL format?

test

This is the test mode. If test=1 then messages will not be sent and credits will not be deducted.

address

The url on the Txtlocal server where we receive your messages. This is static and can not be changed. Always use: http://www.txtlocal.com/sendsmspost.php – preferably using HTTP(s) for your own security.

message

The text message body. This can be up to 612 characters in length. A single message is 160 characters, longer messages are 153 each (2=306,3=459,4=612). You can insert any merge data into this message from your database before submitting to txtlocal. To insert a newline character use %n.

from

The “From Address” that is displayed when the message arrives on handset. Can only be alpha numeric or space. Min 3 chars, max 11 chars.

uname

Your txtlocal.com username

pword

Your txtlocal.com password

selectednums

A comma separated list of international mobile numbers. Each number must be PURELY numeric, no + symbols or hyphens or spaces. The numbers must start with the international prefix. In UK this would be 447xxxxxxxxx. For more prefixes click here.

url

This is not mandetory. If set, you can send a WAP PUSH (mobile internet bookmark) to a mobile phone. Simply set to a valid url (eg, http://www.google.com).

custom

This is not mandetory. If set, you can record a custom ID against the the message batch, which will be passed back in the delivery receipt.

rcpurl

This is not mandetory. Alternate receipt URL. Instead of using the receipt URL in the Txtlocal Account Settings, receipts will be sent to this URL.

shed

This is not mandetory. The scheduled message date/time. In the format YYYY-MM-DD-HH-MM-SS (e.g 2008-03-28-14-56-00). Scheduled messages can be viewed and deleted via your Txtlocal online account.