SMS gateway with HTTP GET access on OpenWRT

   

     In my cluster so many virtual PC are working and different people connect to it wia VPN server. I want to know when and who connect. This project provide service of SMS notification. It build from available components and not expensive. I use next equipment: Router - TP-Link 703N, sd card with 2GB size, GSM modem Huawei E220, USB HUB with external power. It need to preinstall BARRIER BREAKER (14.07, r42625) on Router.

Install all needed packages.

For BB (Barrier Breaker) - 
root@OpenWrt:~#opkg update
root@OpenWrt:~#opkg install kmod-usb-storage kmod-fs-ext4 block-mount
===============================================================
For AA (Attitude Adjastment) - 
opkg update
opkg install block-mount kmod-usb-core kmod-usb2 kmod-usb-uhci kmod-usb-storage kmod-fs-ext2

For CC (Chaos Calmer) - 
opkg update
opkg install block-mount kmod-fs-ext4 kmod-usb-storage-extras
================================================================

Then mount sd card which is detected on system (check dmesg and /dev)

mount /dev/sda1 /mnt
tar -C /overlay -cvf - . | tar -C /mnt -xf -
umount /mnt
block detect > /etc/config/fstab
vi /etc/config/fstab

Edit the following in /etc/config/fstab:
Set all enabled '0'  → enabled '1'
Edit option target of your root overlay partition to show /overlay (not overlay, as it will cause broken, duplicate mounts)
Edit option target of your other partition(s) to show whatever mount point(s) you want them to have (make sure to also create the directories those mount points point to)
You'll end up with an fstab looking something like this:
config 'global' option anon_swap '0' 
 option anon_mount '0' 
 option auto_swap '1' 
 option auto_mount '1' 
 option delay_root '5' 
 option check_fs '0'
config 'mount' option target '/overlay' 
 option uuid 'c91232a0-c50a-4eae-adb9-14b4d3ce3de1' 
 option enabled '1'
config 'swap' option uuid '08b4f0a3-f7ab-4ee1-bde9-55fc2481f355' 
 option enabled '1'

Reboot the router

Install packages which need for GSM modem.
For BB

opkg install chat comgt luci-proto-3g kmod-usb-serial kmod-usb-ohci kmod-usb-serial-option kmod-usb-serial-wwan

opkg install usbutils
lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270 HSDPA/HSUPA Modem
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Install http server, php and gnokii sms utility

opkg install php5 php5-cgi php5-cli lighttpd lighttpd-mod-cgi gnokii

Change basic config in lighttpd.conf
-------------------------
server.document-root = "/sms"
server.port = 81
cgi.assign = ( ".php"  => "/usr/bin/php-cgi" )
-----------------------------

Create sms.php script file. It use gnokii app to send SMS and write to sms.log

root@OpenWrt:~# cat /sms/sms.php
<?php

$nomer=$_GET['nomer'];
$text=$_GET['text'];
$output = shell_exec("echo $text | gnokii --sendsms $nomer");

$myfile = fopen("sms.log", "a") or die("Unable to open file!");
$today = date("Y-m-d H:i:s");

$txt = "$today $nomer $text";
fwrite($myfile, "\n". $txt);
fclose($myfile);

?>

Ok. So now our server in port 81 must execute script sms.php and accept requests 

http://10.60.254.100:81/sms.php?nomer=0555550115&text=Test_messages

To inform me about user connection to VPN server it needed to insert some commands to ipup script

[root@VPN ~]# cat /etc/ppp/ip-up.local
#!/bin/sh
CURRENT_MTU="`ifconfig $1 | grep -Po '(?<=MTU:)([0-9]+)'`"
FIXED_MTU="`expr $CURRENT_MTU + 4`"
ifconfig $1 mtu $FIXED_MTU
echo "Increased MTU for $1 to $FIXED_MTU (from $CURRENT_MTU) to fix MPPE Microsoft Point-to-Point bug #330973"
reqq="tail /var/log/messages | grep ip-up | sed -E 's/[[:space:]]+/_/g' | sed -re 's:VPN.*ip-up\s*(.*):\1:'"
curl "http://10.60.254.100:81/sms.php?nomer=0555550115&text=DC_VPN_$reqq"

7 comments:

  1. This blog is so informative for providing a valuable information about multiple modem sending SMS API PHP.

    ReplyDelete
    Replies
    1. My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download Now

      >>>>> Download Full

      My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download LINK

      >>>>> Download Now

      My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download Full

      >>>>> Download LINK MN

      Delete


  2. sms gateway app

    SMS Gateway Provider - If you are confused for how to send bulk SMS? Then download the best SMS gateway apps for Android from SMS-Api-Gateway. It helps you to send bulk SMS.


    https://www.sms-api-gateway.com/en/app/

    ReplyDelete
  3. It is really helpful I really like this post. MsgClub offer easy to customize Bulk SMS services to our clients. Our customers can send unlimited SMS per day using our bulk SMS gateway provider.

    ReplyDelete
  4. My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download Now

    >>>>> Download Full

    My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download LINK

    >>>>> Download Now

    My Blog: Sms Gateway With Http Get Access On Openwrt >>>>> Download Full

    >>>>> Download LINK 2l

    ReplyDelete
  5. Thanks for given information. this is very useful for me. Visit our Website Click Here

    ReplyDelete