RE: sendsms HTTP 202 status response
"Angel Fradejas" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
>everything is OK execpt using some "user-friendly" languages, such as php. for example, putting the whole >sendsms URL >into include() function produces the following warnings: > >Warning: main(http://xxx:13013/cgi-bin/sendsms? >user=test&pass=testing&to=xxx&from=xxx&udhtext=test&smsc=xxx) [function.main]: failed to create stream: >HTTP >request failed! HTTP/1.0 202 Foo in /var/www/xxx/test.php on line 100 > >Warning: main() [function.main]: Failed opening 'http://xxx:13013/cgi-bin/sendsms? >user=test&pass=testing&to=xxx&from=xxx&&text=test&smsc=xxx for inclusion >(include_path='.:/usr/local/lib/php') in /var/www/xxx/test.php on line 100 > >if require() is used instead of include(), GET request is passed (SMS is sent), but script will die (due to >require() semantics). > >shouldn't be repsonse changed into "normal", i.e. 200? > This is PHP fault, it does show that warning for include() or even file() function if status code is not 200. But a 202 status is also a valid success code, and more accurate in our case. You'll have to use another http client for php (Snoopy is a good one for example) or turn warnings off when you include() or file() that url. You don't know in advance if the message will be delivered (mobile terminal switched off for example, and validity expires). When a proper bearerbox/smsbox ack/nack handling is implemented, we will be able to return failure status codes for some conditions, for example, smsc not found and such. But still will have to return 202 when the message is delivered to the provider. Angel Fradejas Mediafusión España, S.A. [email protected] www.mediafusion.es Tel. +34 91 252 32 00 Fax +34 91 572 27 08