And this method pushes status updates to us,
rather than our pulling them!
Lessen the Load with Status Update Callbacks
While we set up the connection type on Clickatell, we can also specify a callback
URL. If set, the gateway will make a GET request to that URL every time the status of
a queued message changes. This reduces the load on both your server and Clickatell,
as there is no polling required. Clickatell returns apiMsgId, cliMsgId, api_id, to,
timestamp, from, status, and charge values to the callback. The URL must be
publicly accessible so that Clickatell can call it, which means it may not work in your
test environment.
Apart from setting up the callback URL in preferences for the connection, you also
need to pass "deliv_ack" and "callback" parameters in the "sendmsg" command.
Queuing the message now will keep updating you when it is accepted by the
gateway, forwarded to an upstream gateway in the mobile network, and received on
the device. We are not covering the details of callback implementation here because
they are well documented and Clickatell specific.
??? ???
Chapter 6
[ 113 ]
Callbacks are an important feature of a gateway.
Pages:
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158