|Edit HTML page to store details of SMS in Database||Search|
|SMS & MMS Technical Forum » NowSMS Support - SMS Issues (Product Support Only) » Archive through April 08, 2009 » Edit HTML page to store details of SMS in Database||« Previous || Next »|
Post Number: 5
I want to modify html pages to store details of sms in database.Is it possible to do it?
If possible then where I will put that function in HTML page "Send Text Message.htm".
|Des - NowSMS Support
Post Number: 660
But I probably wouldn't do it that way for a couple of reasons.
One reason is because it would only catch messages submitted via that particular web form.
My suggestion would be that you take a look at the SMS Accounting callback interface.
With the accounting callback interface, you can configure a URL that gets called every time a user submits a message. This callback receives all of the details about any submitted messages. And you can use this callback to determine whether or not to allow the message to be sent.
The following link explains the basics of the SMS Accounting callbacks:
However, that link is about 6 years old, and doesn't describe all of the information included in the callbacks. Back then, the content of the SMS message was not included in the callback ... but it has been included now for several years.
The following link talks about a new accounting feature that is used to control SMS message routing:
... while the information about the SMS message routing information is not relevant to your question, I point out this link because it explains all of the parameters passed to the SMS accounting callbacks in current NowSMS releases, you can see an example of what the callback looks like.
Basically, when a message is submitted, the first callback that you get contains "PreAuth=Yes", like this:
In that callback, you have the option to reject the message. If you don't need that capability, ignore this callback.
When NowSMS accepts the message, it issues another callback:
That second callback is the one that you'd be looking for to record this information.
Initially, you will want your script to only process messages if "Type=SMSSend". Ignore any other "Type=" values and simply return a blank OK response.
Also, ignore any callbacks when "PreAuth=Yes" ... or at least don't record these callbacks to your database. This is just NowSMS asking for permission to accept the message ... a second callback without the "PreAuth=Yes" flag will occur when NowSMS accepts the message.