Eric,

That's not possible, because the process is asynchronous: 

The "Sent" message you get from the smsbox means that _kannel_ has
accepted the message for future delivery, but the "FAILED" message
comes from the SMSC when it rejects your message.

That could happen almost inmediatly or after a period of time (Kannel
could be having queued messages, the SMSC could be throttling you and
temporary rejecting some of your messages or just spending some time
responding) so kannel does not wait for it to finish, it just says
"OK, I'll send your message when I can" and that's all you get in this
phase.

So, what you'd need is to use DLR's to do that. This way, when a
message succeeds or fails at the SMSC, kannel will request an special
URL you'd pass on the original request and tell you what happened with
that particular message. It has a performance penalty, of course
(you'll get an aditional request via http for each message you send
and you'll have to deal with it, plus the inherent DLR handling from
kannel. Additionally, it's not specially easy to get right (search on
the mailing list archive and you'll know what I mean ;) ) but it's the
only way to check what happened with your messages after the smsbox
accepted them.

Check on the documentation about the specifics for the DLR's. What I
can tell you beforehand is that you must set the dlr-mask to a
suitable value (only inform the succeed/failures for example) and the
dlr-url to match your confirmation's script.

Hope it helps,

Alejandro Guerrieri

On 8/18/05, Monchanin Eric <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am currently using Kannel to send either SMS or binaries for our
> application.
> Now the problem is, that, so far, we have been sending the SMS request
> using a php function I took from the mailing list some times ago
> 
> function send_req ($string)
> {
>        require_once ('/webhome/functions/configurations/kannel.inc');
>        $request =      'http://'.$kannel['host'].':'.$kannel['port'].
>                        '/cgi-bin/sendsms'.
>                        '?user='.$kannel['user'].
>                        '&pass='.$kannel['pass'].
>                        $string;
> 
>        $result = @file( $request );
>        return 'ok';
> }
> 
> right now I send the request and consider it as successful, which is not
> necessarily right (some carriers don't accept binaries for example, or
> problems with the recipient phone number etc etc ...)
> the access.log file stores
> 2005-08-17 23:52:01 Sent SMS  for success
> 2005-08-17 22:30:53 FAILED Send SMS for failure
> 
> Is it possible to get that status during the request process (even if I
> have to modify my script to keep an http connection open or something.) ?
> Thank you for your help.
> 
> Eric
> 
> 


-- 
Alejandro Guerrieri
Magicom
http://www.magicom-bcn.net/

Reply via email to