i am calling the url http://localhost/sendsms.php from firefox the error i
am getting back is :
*Sending the SMS Text message hello to the phone **97xxxxxxxxxx.
\n*
*Server: Kannel/1.4.3 *
*Date: Wed, 30 Jun 2010 10:45:12 GMT *
*Pragma: no-cache *
*Cache-Control: no-cache *
*Authorization failed for sendsms*
what to do now
*my sendsms.php goes like this*
<html>
<head>
<title>SMS Message Sender</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
include("config.inc");
include("functions.inc");
if(!empty($_POST))
{
echo 'Sending the SMS Text message <b>'.$_POST['text'].'</b> to the phone
<b>'.$_POST['to'].'</b>...<br>
\n';
*$URL =
'/cgi-bin/sendsms?username="yourpassword"&password="yourpassword"&to='.$_POST['to'].'&text='.htmlentities($_POST['text']);
*
http_send($URL,13013);
//echo "<address><a href=\"$PHP_SELF\">Back to Send SMS</a></address>\n";
//print_r($_POST);
}
?>
<h1>SMS Message Sender</h1>
<form name="sendsms" method="post" action="?">
<p>
Telephone number:
<br>
<input type="text" size="30" name="to">
</p>
<p>
Message:
<br>
<textarea cols="20" rows="5" name="text"></textarea>
</p>
<input type="submit" value="Send Message" name="submit">
<input type="reset" value="Reset">
<br>
</form>
<p>
</p>
<hr>
<table border="0" width="100%">
<tr>
<td width="50%"><address><a href="index.php">Back to
admin</a></address></td>
<td width="50%" align="right"><address>Visit the Kannel homepage at <a
href="(URL address blocked: See forums rules)">(URL address blocked: See
forums rules)</a>.</address></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>SMS Message Sender</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
On Wed, Jun 30, 2010 at 9:39 PM, Alvaro Cornejo <[email protected]>wrote:
> your url call should be someting like:
>
>
> http://127.0.0.1:13013/cgi-bin/sendsms?username=user&password=pass&to=12345678&text=test
>
> where username/password are the ones defined in SENDSMS-USER config.
>
> Post your full url.
>
> have you tried to call your url from a browser or with lynx? What did
> you get bac?
>
> If you get error, try with the simplest call you can have -- like the
> example below-- and check. If ok add one parameter each time until you
> get the error.
>
> Hope helps else post kannel logs
>
> Alvaro
>
>
>
>
> |-----------------------------------------------------------------------------------------------------------------|
> Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
> celular y Nextel
> en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via
> SMS y GPRS online
> Visitenos en www.perusms.NET www.smsglobal.com.mx y
> www.pravcom.com
>
>
>
> On Wed, Jun 30, 2010 at 10:23 AM, prashant singh
> <[email protected]> wrote:
> > i am using the yourpassword defined in sendsms group as well as in
> > config.inc file(please see the kannel.conf file in the mail).
> > i am creating the url in sendsms.php as $url where i am passing the
> > username,password,phone no,text.
> > if possible please elaborate the process of calling kannel that u
> > mentioned in previous mail.
> >
> >
> >
> > On 6/30/10, Alvaro Cornejo <[email protected]> wrote:
> >> Which "yourpassword" are you usring to send the message to kannel? You
> >> must use sendsms-user password when calling kannel.
> >>
> >> Regards
> >>
> >> Alvaro
> >>
> >>
> |-----------------------------------------------------------------------------------------------------------------|
> >> Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
> >> celular y Nextel
> >> en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via
> >> SMS y GPRS online
> >> Visitenos en www.perusms.NET www.smsglobal.com.mx y
> >> www.pravcom.com
> >>
> >>
> >>
> >> On Wed, Jun 30, 2010 at 6:07 AM, prashant singh
> >> <[email protected]> wrote:
> >>> whenever i try 2 send sms thru my script sendsms.php ,i m getting
> >>> authentication failed error. Exact trace is as follows:
> >>>
> >>> Sending the SMS Text message hello to the phone 97xxxxxxxxxx.
> >>> \n
> >>>
> >>> Server: Kannel/1.4.3
> >>>
> >>> Date: Wed, 30 Jun 2010 10:45:12 GMT
> >>>
> >>> Pragma: no-cache
> >>>
> >>> Cache-Control: no-cache
> >>>
> >>> Authorization failed for sendsms
> >>>
> >>> For Authentication while creating the URL variable in SENDSMS.PHP ,i am
> >>> passing the username and password with values as string.Here my Query
> is
> >>> that which username and password i.e.(CORE GROUP OR SENDSMS GROUP-FILES
> >>> ATTACHED:-SENDSMS.PHP AND OTHER INCLUDE FILES ARE ATTACHED) has to be
> >>> passed
> >>> in the URL?
> >>>
> >>> Apart from this i want 2 know what is another method for authentication
> >>> for
> >>> kannel gateway.
> >>>
> >>> Please Enlighten me on this.
> >>>
> >>> kannel.conf is as follows:-
> >>> # CORE
> >>> group = core
> >>> admin-port = 13000
> >>> admin-password = yourpassword
> >>> status-password = yourpassword
> >>> log-file = "/var/log/kannel/kannel.log"
> >>> log-level = 0
> >>> access-log = "/var/log/kannel/access.log"
> >>> smsbox-port = 13001
> >>> store-type = file
> >>> store-file = "/var/log/kannel/kannel.store"
> >>> store-location = "/var/log/kannel/kannel.store"
> >>>
> >>>
> >>> # SMSC Fake
> >>> group = smsc
> >>> smsc = at
> >>> device = /dev/ttyACM1
> >>> port = 13000
> >>>
> >>>
> >>>
> >>> # MODEM DEFINITIONS
> >>> group = modems
> >>> id = nokia
> >>> name = "Nokia"
> >>> detect-string = "Nokia"
> >>> init-string = "ATZ"
> >>> init-string = "AT Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
> >>>
> >>>
> >>> # SMSBOX SETUP
> >>> group = smsbox
> >>> bearerbox-host = localhost
> >>> sendsms-port = 13013
> >>> sendsms-chars = "0123456789+"
> >>> global-sender = "test"
> >>> log-file = "/var/log/kannel/smsbox.log"
> >>> log-level = 0
> >>> access-log = "/var/log/kannel/access.log"
> >>> #sendsms-url="http://localhost:13013/sendsms.php"
> >>> white-list="http://localhost:13013/sendsms.php"
> >>>
> >>>
> >>>
> >>> # SEND-SMS USERS
> >>> group = sendsms-user
> >>> username = yourpassword
> >>> password = yourpassword
> >>> concatenation = 1
> >>> max-messages = 10
> >>>
> >>>
> >>> # SMS SERVICE GET-URL EXAMPLE
> >>> group = sms-service
> >>> keyword = relay
> >>> get-url = "http://localhost:13013/sendsms.php"
> >>>
> >>>
> >>> # SMS SERVICE 'default'
> >>> group = sms-service
> >>> keyword = nop
> >>> text = "You asked nothing and I did it!"
> >>> catch-all = true # Catch all incoming messages
> >>> # regarding the keyword. If you
> >>> # define other services, remove
> >>> # this line.
> >>>
> >>>
> >>> # SMS SERVICE for receiving sms messages
> >>> # If you're about to implement service to receive sms messages.
> >>> # group = sms-service
> >>> # keyword = yourkeyword
> >>> # get-url =
> >>> http://server.domain/moodle/receivesms.php?q=%k&sender=%p&message=%a
> >>>
> >>> SENDSMS.PHP is as follows:-
> >>>
> >>> <html>
> >>> <head>
> >>> <title>SMS Message Sender</title>
> >>> </head>
> >>> <body bgcolor="#FFFFFF" text="#000000">
> >>>
> >>> <?php
> >>> include("config.inc");
> >>> include("functions.inc");
> >>>
> >>> if(!empty($_POST))
> >>> {
> >>> echo 'Sending the SMS Text message <b>'.$_POST['text'].'</b> to the
> phone
> >>> <b>'.$_POST['to'].'</b>...<br>\n';
> >>>
> >>> $URL =
> >>>
> '/cgi-bin/sendsms?username="yourpassword"&password="yourpassword"&to='.$_POST['to'].'&text='.htmlentities($_POST['text']);
> >>> http_send($URL,13013);
> >>> //echo "<address><a href=\"$PHP_SELF\">Back to Send
> SMS</a></address>\n";
> >>>
> >>> //print_r($_POST);
> >>> }
> >>> ?>
> >>>
> >>> <h1>SMS Message Sender</h1>
> >>> <form name="sendsms" method="post" action="?">
> >>> <p>
> >>> Telephone number:
> >>> <br>
> >>> <input type="text" size="30" name="to">
> >>> </p>
> >>> <p>
> >>> Message:
> >>> <br>
> >>> <textarea cols="20" rows="5" name="text"></textarea>
> >>> </p>
> >>> <input type="submit" value="Send Message" name="submit">
> >>> <input type="reset" value="Reset">
> >>> <br>
> >>> </form>
> >>>
> >>>
> >>> <p>
> >>> </p>
> >>> <hr>
> >>> <table border="0" width="100%">
> >>> <tr>
> >>> <td width="50%"><address><a href="index.php">Back to
> >>> admin</a></address></td>
> >>> <td width="50%" align="right"><address>Visit the Kannel homepage at <a
> >>> href="(URL address blocked: See forums rules)">(URL address blocked:
> See
> >>> forums rules)</a>.</address></td>
> >>> </tr>
> >>> </table>
> >>> </body>
> >>> </html>
> >>>
> >>>
> >>> <html>
> >>>
> >>>
> >>> <head>
> >>> <title>SMS Message Sender</title>
> >>>
> >>>
> >>>
> >>> </head>
> >>>
> >>>
> >>>
> >>> <body bgcolor="#FFFFFF" text="#000000">
> >>>
> >>>
> >>> INCLUDE FILE CONFIG.INC is as follows:-
> >>>
> >>> <?php
> >>> // Include file for SMS interface.
> >>>
> >>> // These variables MUST match your kannel.conf configuration
> >>>
> >>> $bearerboxhost = "localhost";
> >>> define("BEARERBOX_HOST", "localhost");
> >>>
> >>> define("SENDSMS_PORT", "13001");
> >>> define("ADMIN_PORT", "13000");
> >>> define("ADMIN_PASSWORD", "yourpassword");
> >>> define("USERNAME", "yourpassword");
> >>>
> >>> define("PASSWORD", "yourpassword");
> >>> define("GLOBAL_SENDER", "test");
> >>> ?>
> >>>
> >>> INCLUDE FILE FUNCTIONS.INC IS AS FOLLOWS:-
> >>>
> >>> <?php
> >>>
> >>> function http_send($URL,$port)
> >>> {
> >>> $connection =
> >>> fsockopen(BEARERBOX_HOST,$port,&$error_number,&$error_description,60);
> >>> if(!$connection) {
> >>> echo "<p>$error_description ($error_number)<br>\n";
> >>> echo "The SMS message was NOT sent!</p>\n";
> >>> } else {
> >>> socket_set_blocking($connection, false);
> >>> fputs($connection, "GET $URL HTTP/1.0\r\n\r\n");
> >>> while (!feof($connection)) {
> >>> $myline = fgets($connection, 128);
> >>> switch($myline)
> >>> {
> >>> case (strstr($myline, 'Content-')): break;
> >>> case (strstr($myline, 'HTTP/1')): break;
> >>> case "": break;
> >>> case "\r\n": break;
> >>> default: echo "<p>".$myline."</p>";
> >>> }
> >>> }
> >>> fclose ($connection);
> >>>
> >>> }
> >>> }
> >>>
> >>> function octstr_append_cstr($mystring)
> >>> {
> >>> for($pos=0;$pos<strlen($mystring);$pos++) {
> >>> $mystring2 .= sprintf("%%%02x",$mystring[$pos]);
> >>> }
> >>> return ($mystring2);
> >>> }
> >>> ?>
> >>>
> >>> PRASHANT SINGH
> >>>
> >>>
> >>>
> >>>
> >>
> >
> >
>