Easy Guardian provides alarms by texting system administrators If you would like to monitor you server 24h/24h this is the right tool for you! It brings together NMAP and Net-SNMP in a small silent Linux embedded box. Visit: http://www.easyguardian.com
Learn how to perform changes in the XML export script for ASP .NET and other applications
The XML transformation script is an action activated by uncommenting the following lines from Event Handler.
#Save messages in XML format #if [ "$1" = "RECEIVED" ]; then #/etc/sms/scripts/sms2xml $1 $2 $3 #fi
To activate/deactivate the module you have always to remember to remove/add the # sharp character.
This code represent the call on action "RECEIVED" to the sms2xml script. The code inside the script is reported below:
#run this script only when a message was received. if [ "$1" != "RECEIVED" ]; then exit; fi; #Extract data from the SMS file FROM=`/etc/procmail/formail -zx From: < $2` TEXT=`/etc/procmail/formail -I "" <$2 | sed -e"1d"` #Save as XML #for some reason the mktemp-command creates two instances of the file if #I add the .xml-extension to the FILENAME-variable.
FILENAME=`mktemp /mnt/flash/root/xml/smsXXXXXX` BACKENDSWF="/mnt/flash/root/xml/sms.xml" echo "" >$FILENAME.xml echo "" >>$FILENAME.xml echo "" >>$FILENAME.xml echo " $FROM" >>$FILENAME.xml echo " $TEXT" >>$FILENAME.xml echo "" >>$FILENAME.xml #Delete the original file without the .xml-extension rm $FILENAME
As you can see this script performs an "export" of data from the original SMS format file and saves it in a simple XML document. In some cases you need to change the XML format to accomplish to rules of other software and for an easier integration in software environments.
XML custom script for ASP .NET integration
In this example we are going to create a simple web page that takes data from the XML file sms.xml and shows it in a DataList element. We used Microsoft™ Visual Web Developer, a really interesting tool that provides a simple way for ASP .NET development. You are free to download it and use it to try the example in the ZIP archive containing the source example.
The VWD environment provides a really good support to XML but as many other programs it take informations from node attributes instead of content of nodes. To override this issue we provide you a simple script that exports informations in the correct XML format:
Run this script only when a message was received. if [ "$1" != "RECEIVED" ]; then exit; fi; #Extract data from the SMS file FROM=`/etc/procmail/formail -zx From: < $2` TEXT=`/etc/procmail/formail -I "" <$2 | sed -e"1d"` #Save as XML #for some reason the mktemp-command creates two instances of the file if I #add the .xml-extension to the FILENAME-variable. FILENAME=`mktemp /mnt/flash/root/xml/smsXXXXXX` BACKENDSWF="/mnt/flash/root/xml/sms.xml" echo "" >$FILENAME.xml echo "" >>$FILENAME.xml echo " " >>$FILENAME.xml echo "" >>$FILENAME.xml #Delete the original file without the .xml-extension rm $FILENAME
As you can see all informations are now assigned to the relative attribute in the tag, so that you can simply assign to the file a datasource inside your ASP .NET project.
# #Enable this to activate custom events # if [ "$1" = "RECEIVED" ]; then /mnt/flash/root/source/custom/custom_rx "$2" fi #
As you can see, in this if clause the RECEIVED event is selected. The events you can select are: SENT, RECEIVED, FAILED or REPORT
The SMS FoxBox Software is developed by KDEV (http://www.kdev.it), a Davide Cantaluppi company on Acme Systems FOX GM Hardware
For further info contact us by mail
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
providing us the FoxBox model you need and your company details.