Hi there!

> How the X-Kannel header can be used for sms-services? Are similar to HTTP
> headers, which will used by Kannel to format SM. If possible, can somebody
> show me the sample code of its usage.

X-Kannel headers are common HTTP headers

here it goes a example in _perl_ on how to send a sms via post method:

-------- start perl code --------------------------------

sub send_sms {
        my $to = shift;
        my $msg = shift;

        $ua = new LWP::UserAgent;
        $ua->agent('Kannel/0.1 ' . $ua->agent);

        my $h = new HTTP::Headers
                                'X-Kannel-From'         => $GW_FROM,
                                'X-Kannel-To'           => $to,
                                'X-Kannel-Username' => $GW_USERNAME,
                                'X-Kannel-Password' => $GW_PASSWORD,
                                'X-Kannel-DLR-URL'      => $GW_DLR_URL,
                                'X-Kannel-DLR-Mask' => $GW_DLR_MASK;

        my $req = HTTP::Request->new(POST,
"http://$GW_HOST:$GW_PORT/cgi-bin/sendsms";, $h);

        $req->content_type('application/octet-stream');
        $req->content($msg);
        $res = $ua->request($req);

        die $res->message() unless $res->is_success();

        return 1;
}

---------- end  perl code --------------------------

hope this help!
best regards,

Valter Santos


----- Original Message -----
From: "Shridhar Raju" <[EMAIL PROTECTED]>
To: "Kannel Users" <[EMAIL PROTECTED]>
Sent: Saturday, December 29, 2001 1:49 PM
Subject: X-Kannel Headers


> Hi,
>
> How the X-Kannel header can be used for sms-services? Are similar to HTTP
> headers, which will used by Kannel to format SM. If possible, can somebody
> show me the sample code of its usage.
>
> Thanks in advance.
>
> Shridhar Raju
>
>
>
>


Reply via email to