View Single Post
  #10  
Old 3rd November 2010, 13:35
letsharehowto letsharehowto is offline
Junior Member
 
Join Date: Dec 2009
Location: Sai gon - Viet Nam
Posts: 12
Thanks: 0
Thanked 12 Times in 8 Posts
Default SMS Gateway with Ubuntu server 10.10, playsms and smstools3.

Today I will tell you howto setup box which run SMS Gateway with Ubuntu server 10.10, playsms and smstools3.

My box:

-Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz, 2 cores
-Memory: 2G

My cell phone:

- http://www.amazon.com/Motorola-SLVR-.../dp/B000ELOPZ6
- And this phone works good too: http://www.amazon.com/Motorola-V3-Un.../dp/B0009FCAJA

We have 4 steps:

-Setup Ubuntu server 10.10 box.
-Install Playsms.
-Install Smstools3.
-Config Playsms.

1/- Setup Ubuntu server 10.10 box:

-Create new box with Ubuntu server 10.10. If you don't know, this link will help you: http://www.howtoforge.com/perfect-se...at-ispconfig-3

-When box get dhcp IP address, press Cancel (remember do quickly), then input IP manual. In my case, my IP is: 192.168.1.66. Netmask: 255.255.255.0. Gateway: 192.168.1.1. Name server address: 192.168.1.1.

-When box ask Host name, I choose: cat.mouse. (We use Sendmail to send email to remind us when box recieves sms. And if you don't want Ubuntu startup slows down at Starting Mail Transport Agent (MTA) sendmail you have to choose long hostname, example: "cat.mouse". If you choose short name: "catmouse", box boot up, box shutdown and box remind you when sms come is very slow.)

-When box ask software to install, only choose OpenSSH.

Finish install, reboot box.

Logon and active root account:

Code:
sudo passwd root
Logout then login with root and later do everything with root too.

Upgrade box:

Code:
apt-get update && apt-get upgrade -y
Reboot box:

Code:
reboot
2/- Install Playsms:

Logon with root and install some softwares:

Code:
apt-get install -y apache2 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin libapache2-mod-php5 gcc sendmail
When box ask password, I choose 111111 for all.

( http://picasaweb.google.com/letshare...tu1010Playsms# )
Add playsms user:

Code:
adduser playsms
Create playSMS web root, spool and log and set ownership to user www-data:

Code:
mkdir -p /var/www/playsms
mkdir -p /var/spool/playsms
mkdir -p /var/log/playsms
chown -R www-data /var/www/playsms
chown -R www-data /var/spool/playsms
chown -R www-data /var/log/playsms
Download Playsms:

Code:
wget http://biznetnetworks.dl.sourceforge.net/project/playsms/playsms/Version%200.9.5.1/playsms-0.9.5.1.tar.gz
Unzip:

Code:
tar -zxvf playsms-0.9.5.1.tar.gz -C /usr/local/src
Copy files and directories inside 'web' directory to playSMS web root and set ownership again to user www-data:

Code:
cd /usr/local/src/playsms-0.9.5.1/web
cp -rR * /var/www/playsms
chown -R www-data /var/www/playsms
Setup database:

Code:
mysqladmin -u root -p create playsms
When box ask password, type: 111111 then press Enter.

Code:
mysql -u root -p playsms < /usr/local/src/playsms-0.9.5.1/db/playsms.sql
When box ask password, type: 111111 then press Enter.

Copy config-dist.php to config.php and edit config.php:

Code:
cd /var/www/playsms
cp config-dist.php config.php
Fill required field with coutious in config.php file:

Code:
nano config.php
Please find rootpassword (on line 8) and replace with 111111 then save and exit.

Enter bin directory, copy playsms, playsmsd, playsmsd.php, playsmsd_start to directory default:

Code:
cd /usr/local/src/playsms-0.9.5.1/bin
cp playsmsd playsmsd.php playsmsd_start /usr/local/bin/
cp playsms /etc/default/
Make playsmsd_start will start automatically on boot:

Code:
nano /etc/init.d/rc.local
Add bellow quote into the bottom of the file (before exit if theres exit command) then save and exit:

Quote:
/usr/local/bin/playsmsd_start
3/- Install Smstools3:

Download Smstools3:

Code:
wget http://smstools3.kekekasvi.com/packages/smstools3-3.1.14.tar.gz
Unzip:

Code:
tar -zxvf smstools3-3.1.14.tar.gz -C /usr/local/src
Installing smstools3:

Code:
cd /usr/local/src/smstools3
make
make install
Back to playSMS source directory, copy smsd.conf from contrib/smstools/ to /etc:

Code:
cd /usr/local/src/playsms-0.9.5.1
cp contrib/smstools/smsd.conf /etc/
Plug cellphone into box. Make sure everything clean and stick together. When you plug phone into box, phone be charging too. Make sure Ubuntu recognize cellphone:

Code:
lsusb
In my case, quote like this:

Quote:
Bus 008 Device 002: ID 22b8:4902 Motorola PCS Triplet GSM Phone (AT)
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Findown where usb port cellphone use:

Code:
ls /dev/tty*
In my case, quote like this:

Quote:
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyACM0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyS0
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58 /dev/ttyS1
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59 /dev/ttyS2
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6 /dev/ttyS3
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
Config smsd.conf:

Code:
nano /etc/smsd.conf
Please find ttyUSB0 (on line 27) and replace with ttyACM0 then save and exit.

Create some important directories for smstools3:

Code:
mkdir -p /var/spool/sms/checked
mkdir -p /var/spool/sms/failed
mkdir -p /var/spool/sms/incoming
mkdir -p /var/spool/sms/outgoing
mkdir -p /var/spool/sms/sent
mkdir -p /var/log/sms
Change permissions on some directories so that web server user can write files on it:

Code:
chown -R www-data /var/spool/sms
To get smstools3 running automatically on every boot, type this command:

Code:
update-rc.d sms3 defaults
Reboot box:

Code:
reboot
4/- Config Playsms:

On client open web browser, at address type:

Login using default administrator user:

( http://picasaweb.google.com/letshare...97544327981986 )

username: admin
password: admin

( http://picasaweb.google.com/letshare...97526305094706 )

Then click Gateway, click Manage smstools, click (click here to active)

( http://picasaweb.google.com/letshare...97476944974002 )

Everything keep default.

Logon server and reboot box:

reboot

Now you can send and recived sms with Playsms. Good luck!

Thanks:

http://www.howtoforge.com
http://www.ubuntu.com
http://playsms.org
http://smstools3.kekekasvi.com

PS:
- I do everything with real computer not "cloud" computer.
- When I send sms, box wait from 3 to 10 second then sms will be send.
- When I recived sms, box wait from 3 to 10 second then sms will be recived.
- For more information you can visit this link: http://tech.groups.yahoo.com/group/playsms-devel/

More picture at: http://picasaweb.google.com/116366725840175897341
Attached Files
File Type: txt Everything I do on server.txt (60.9 KB, 821 views)
Reply With Quote