mysql query execution error in loop (Kannel + Sqlbox)

38 views Asked by At

I am installing kannel with the DLR function, and for that I have to put different parameters in the url.

I accidentally put an unsupported parameter and since then I keep getting this error in a loop, which makes me not to save the DLR correctly:

enter image description here

The loop goes super fast, sending approximately 500 errors per second.
The url is as follows (obviously I have already changed it but when I made the mistake, I put %L in one of the parameters):

http://192.168.252.222:13013/cgi-bin/sendsms?username=tester&password=foobar&to=678171665&text=prueba+de+sms+klk&dlr-mask=31&dlr-url=http%3A%2F%2F192.168.252.222%2Fkannel%2Fdlr.php%3Fdlr-type%3D%25A%26mwi%3D%25d%26from%3D%25P%26to%3D%25p%26text%3D%25a%26momt%3D%25d%26udh%3D%25u%26message-sent%3D%25b%26time%3D%25t%26smsc%3D%25i%26service%3D%25n%26account%3Do%26id%3D%25I%26sms-type%3D%25f%26mclass%3D%25m%26mwi%3D%25M%26coding%3D%25c%26validity%3D%25v%26deferred%3D%25V%26charset%3D%25C%26boxc%3D%25x%26binfo%3D%25B%26meta-data%3D%25D%26foreign-id%3D%25F

the php file is this: (I made it with chat gpt, if someone sends me another php file better done I would appreciate it):

<?php

// Configuración de la conexión a la base de datos
$dbhost = "localhost";
$dbuser = "kannel";
$dbpass = "kannel";
$dbname = "kannel";

// Conectarse a la base de datos
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
if (!$conn) {
    die("Conexión fallida: " . mysqli_connect_error());
}

// Recoger los datos del DLR de Kannel
$momt = $_GET["momt"];
$sender = $_GET["from"];
$receiver = $_GET["to"];
$udhdata = $_GET["udh"];
$msgdata = $_GET["message-sent"];
$time = $_GET["time"];
$smsc_id = $_GET["smsc"];
$service = $_GET["service"];
$account = $_GET["account"];
$id = $_GET["id"];
$sms_type = $_GET["sms-type"];
$mclass = $_GET["mclass"];
$mwi = $_GET["mwi"];
$coding = $_GET["coding"];
$compress = $_GET["compress"];
$validity = $_GET["validity"];
$deferred = $_GET["deferred"];
$dlr_mask = $_GET["dlr-mask"];
$dlr_url = $_GET["dlr-url"];
$pid = $_GET["pid"];
$alt_dcs = $_GET["alt-dcs"];
$rpi = $_GET["rpi"];
$charset = $_GET["charset"];
$boxc_id = $_GET["boxc"];
$binfo = $_GET["binfo"];
$meta_data = $_GET["meta-data"];
$priority = $_GET["priority"];
$foreign_id = $_GET["foreign-id"];

// Insertar los datos en la tabla "send_sms"
$sql = "INSERT INTO send_sms (sql_id, momt, sender, receiver, udhdata, msgdata, time, smsc_id, service, account, id, sms_type, mclass, mwi, coding, compress, validity, deferred, dlr_mask, dlr_url, pid, alt$
VALUES (NULL, '$momt', '$sender', '$receiver', '$udhdata', '$msgdata', '$time', '$smsc_id', '$service', '$account', '$id', '$sms_type', '$mclass', '$mwi', '$coding', '$compress', '$validity', '$deferred', $
if (mysqli_query($conn, $sql)) {
    echo "Datos insertados correctamente.";
} else {
    echo "Error al insertar datos: " . mysqli_error($conn);
    mysqli_close($conn)
}

// Cerrar la conexión a la base de datos
mysqli_close($conn);

?>

I have already tried restarting the service, rebooting the machine, of course I have changed the url and resent the request.

I have also tried deleting the mysql process queue but it spawns again every time I delete it.

enter image description here

0

There are 0 answers