#!/usr/bin/php
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
//übergabeparameter aus smstools3
$sms_type = $argv[1];
$sms_file = $argv[2];
$sms_file_content = file_get_contents($sms_file);
$i = strpos($sms_file_content, "\n\n");
$sms_headers_part = substr($sms_file_content, 0, $i);
$sms_message_body = substr($sms_file_content, $i + 2);
$sms_header_lines = split("\n", $sms_headers_part);
$sms_headers = array();
foreach ($sms_header_lines as $header)
{
$i = strpos($header, ":");
if ($i !== false)
$sms_headers[substr($header, 0, $i)] = substr($header, $i + 2);
}
// select and get all header informations
$h_vonhandy = $sms_headers["From"];
$h_toa = $sms_headers["From_TOA"];
$h_smsc = $sms_headers["From_SMSC"];
$h_sent = $sms_headers["Sent"];
$h_received = $sms_headers["Received"];
$h_subject = $sms_headers["Subject"];
$h_modem = $sms_headers["Modem"];
$h_imsi = $sms_headers["IMSI"];
$h_report = $sms_headers["Report"];
$h_alfabet = $sms_headers["Alphabet"];
$h_length = $sms_headers["Length"];
// your code 2 follow
?>
Just consuming about 3-4 Watt. Extremely comfortable. Store incoming SMS in an integrated mysql-database. Web-interface (Online/offline) is no problem. It s complete a standalone system. Maybe solar driven later on. Internet connection by wire is possible but not nessecary. Endless possibilities.. 4 Africa, Asia, Latin America. Built your own SMSbased Services...m-health application, education application ...whatsoever.
Translate
Samstag, 11. Januar 2014
Getting ALL! SMS parameters from smstools - by eventhandler activated script
Labels:
affordable,
cheap,
community,
inbound,
inboundsms,
international,
mobile,
obilephone,
phone,
pi,
private,
raspberry,
raspberry pi,
server,
service,
sms,
smstools,
smstools3,
web
Abonnieren
Kommentare zum Post (Atom)
Keine Kommentare:
Kommentar veröffentlichen