We require modification of an existing script:
We have a completed SMS gateway script which uses Clickatell ([url removed, login to view]) which requires modifcation of the delivery tracking element. The script currently uses the following HTTP/S API.
[url removed, login to view]
Please also see the Clickatell HTTP/S API documentation [url removed, login to view]
We require delivery tracking to be processed via Clickatell callback. Currently delivery is determined by the reported reduction of credits on the host Clickatell account. This is inadequate, as it can not handle messages which may be delayed. It currently reports delayed messages as 'not delivered', where in reality it may be delayed for several seconds, when eventually it will be sent, no charge to the user will be incurred (as it is already marked 'not delivered') and we lose money. We would like user message transmission to use the callback function. Exact implementation of this we are flexible on, however, suggest:
1. A message is sent. An ID number of the message (or the Clickatell message ID number) is generated and stored in the DB as a record for that message. The message has a 'status' record.
2. The delivery status is immediately set to 'pending'.
3. When the callback (intermediate or final) for the message that was sent is received from Clickatell, the message status is updated to reflect this. Clickatell has various status such as 'delivery delayed' 'routing error' etc. This message from Clickatell can also be used in displaying the message status in the user's outbox (inside the script's user area).
4. When a Clickatell callback is received confirming delivered to gateway, only then the relevant message credit charge (also provided by the callback) deducted from the users account. This way, users are accurately deducted credits which correspond to the cost for the provider.
In this way delivery notification is semi-real-time. Users can check the status of messages in an outbox page. This page can be refreshed at their leisure.
We only require modification to the existing code. No design etc. Please check the API specification documentation as it currently allows Callback. The script simply needs to be able to receive the HTTP GET and interface with the database.