Hi there, I think my answer above is really elaborated and I don't understand exactly what kind of help do you need, but let me try once more.
Let's say that you own a webserver with the domain
www.mosms.com which supports PHP and also you have your Database. At the root you can create a php file (e.g. mo-sms.php) with my sample code to save the MO SMS to you database (The code needs some kind of string sanitization for the incoming parameters to avoid SQL Injections!!!!)
<?php
$id=$_POST["id"];
$from=$_POST["from"];
$to=$_POST["to"];
.....
$conn = mysqli_connect("localhost","root","","json") or die("Error " . mysqli_error($connection));
$sql = "INSERT INTO MO(id,from,to,...) values($id,$from,$to...);
if ($conn->query($sql) === TRUE) {
echo "data stored successfully";
} else {
echo "error occured for SMS ".$id;
}
?>
The above is a SAMPLE CODE and like I said you need to sanitize the string (use prepared statements maybe?) and of course capture most, if not all, the available parameters.
id (unique identifier for the sms),
from (Sender),
to (receiver usually a mobile phone number),
origin-connector (very important! the connector that the message come from),
priority,
coding (need to know if the message that arrived is in GSM-7 or UCS2),
validity, content (the actual message),
binary (the actual message in HEX, usefull when you have to do with encodings)
Now move to your Jasmin Gateway. You need to create a MO SMS connector. Example follows:
jcli : httpccm -a
Adding a new Httpcc: (ok: save, ko: exit)
> url https://www.mosms.com/mo-sms.php
> method POST
> cid myhttpconnector
> ok
Successfully added Httpcc [HttpConnector] with cid:myhttpconnector
After that you need to create a MOroute to route all SMS from to the above connector. For simplicity I use the DefaultRoute so I will send all the SMS to my previously creted connector, thus to the Database.
jcli : morouter -a
Adding a new MO Route: (ok: save, ko: exit)
> type DefaultRoute
jasmin.routing.Routes.DefaultRoute arguments:
connector
> connector http(
myhttpconnector)
> ok
Successfully added MORoute [DefaultRoute] with order:0
Now everytime a MO message arrives the MORoute redirects it to connector "
myhttpconnector". Now the connector generates a POST request to your webserver (e.g.
https://www.mosms.com/mo-sms.php with body "id=36265862h&from=Sender&to=
4429236402&content=This%20is%20a%20test%20message..."). The webserver will grab the information with the help of the php script and save them to DB.