Jump to content
sleed

Tutorial - Cum sa ai propriul Server de SMS

Recommended Posts

Buna , in acest tutorial va v-oi arata cum sa instalati un server de sms pentru Linux. [Debian,Ubuntu only!]

Avem nevoie de un telefon , putin mai vechi , eu am folosit un Nokia 6610i.

Trebuie sa ne asiguram ca avem instalat toate modulele acestea :

apt-get install apache2 libapache2-mod-php5 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin make gcc sendmail sendmail-bin lynx wget curl

Ca sa instalam ,modulul de serviciu , ne trebuie sa facem urmatoarele:

adduser playsms

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 ->

wget http://downloads.sourceforge.net/project/playsms/playsms/Version%200.9.7.2/playsms-0.9.7.2.tar.gz

tar -zxvf playsms-0.9.7.2.tar.gz
il dezarhivan cu comanda aceasta ,

Intram aici :

../playsms-0.9.7.2/web

Il adaugam la serverul nostru , in cazul asta , eu folosesc apache2, // .

cp -rR * /var/www/playsms
, apoi
chown -R www-data /var/www/playsms
.

Facem o baza de date pe care o numim : playsms , sau cum vreti dumneavoastra , apoi ii dam import daca folosim phpmyadmin , la :

db/playsms.sql
.

Next configuram PLaysms :

cd /var/www/playsms
, -> ,
cp config-dist.php config.php
,

--->

nano config.php

Schimbam Pass , si/sau numele la db , daca este cazul , si nu ati pus playsms , ca mai sus .

Intram in :

cd playsms-0.9.7.2/bin

Efectuam aceste comenzi :

cp playsmsd playsmsd.php playsmsd_star
&
cp playsms /etc/default/

Intram aici :

nano /etc/init.d/rc.local

Adaugam aceasta linie , inainte de exit :

/usr/local/bin/playsmsd_start
, sa porneasca serviciul , cand aprindem pc-ul de fiecare data.

Instalam SMS Tools :

cd

wget http://smstools3.kekekasvi.com/packages/smstools3-3.1.15.tar.gz

tar -zxvf smstools3-3.1.15.tar.gz -C /usr/local/src

cd /usr/local/src/smstools3

make

make install

cd /usr/local/src/playsms-0.9.7.2

cp contrib/smstools/smsd.conf /etc/

nano /etc/smsd.conf
si cautam la linia 27 , mie imi da asa : device = /dev/ttyUSB0, voi inlocuiti cu ce scrie la usb , sa functioneze corect.

Apoi ii dam un run la aceste comenzi :

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

chown -R www-data /var/spool/sms

update-rc.d sms3 defaults

Si intram la : http://localhost/playsms , ne logam cu pass & user : admin : admin . Se poate trimite mai multe mesaje de pe acelasi numar , doar daca faceti un user nou , cu acelasi numar de telefon.Daca sunt probleme P.M.!

Tutorial made by sleed from RSTFORUMS.COM

Va multumesc ! :*

Edited by sleed
  • Upvote 2
Link to comment
Share on other sites

  • Moderators
Vezi ca nu la orice telefon merge , am incercat cu un iphone 4 si nu mi a mers nu stiu de ce ... Am sa ma apuc sa ma uit prin folderul web , la fisierele .php de la configuratii , sa incerc sa schimb una alta .. Pana atunci ... e ok

Ai incercat cu el in modul DFU?

Link to comment
Share on other sites

Varianta pentru lenesi, pana la baza de date:

apt-get install apache2 libapache2-mod-php5 mysql-server php5 php5-cli php5-cgi php-pear php-db phpmyadmin make gcc sendmail sendmail-bin lynx wget curl && adduser playsms && 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 && wget http://downloads.sourceforge.net/project/playsms/playsms/Version%200.9.7.2/playsms-0.9.7.2.tar.gz && tar -zxvf playsms-0.9.7.2.tar.gz && cd playsms-0.9.7.2/web && cp -rR * /var/www/playsms && chown -R www-data /var/www/playsms &&
Link to comment
Share on other sites

sleed : da mi un pm sa te intreb ceva, ca tu nu accepti .

Mai exact merge si pe masina virtuala ?

plus :

lsusb

Bus 001 Device 003: ID 12d1:14db Huawei Technologies Co., Ltd.

Cum verific/vad device-ul de care am eu nevoie : " device = /dev/ttyUSB0 "

Am incercat dmesg | grep -i tty ...dar degeaba .

Edited by l3tmeb3
Link to comment
Share on other sites

sleed : da mi un pm sa te intreb ceva, ca tu nu accepti .

Mai exact merge si pe masina virtuala ?

plus :

lsusb

Bus 001 Device 003: ID 12d1:14db Huawei Technologies Co., Ltd.

Cum verific/vad device-ul de care am eu nevoie : " device = /dev/ttyUSB0 "

Am incercat dmesg | grep -i tty ...dar degeaba .

Incearca cu comanda aceasta


ll /sys/class/tty/ttyUSB*

Link to comment
Share on other sites

Merge, am incercat pe ubuntu ieri. Azi l-am portat pe windows, am folosit numa' smstools3 cu cygwin, i-am facut un script php pentru trimis mesaje si am implementat js pe un button cu prompt sa trimita valorile la scriptul php. Merge grozav!

// apropo, am avut probleme cu playsms, cand trimitea, cand nu, asa ca va sfatuiesc mai simplu sa folositi un simplu phonebook cu sql si ii implementati buton de sms. Oricum se poate adapta in multe moduri. Probat cu nokia x6 pe ubuntu 12.04 si windows server 2003.

Edited by yo20063
Link to comment
Share on other sites

bajetzashu89 ai putea trimite SMS-uri personalizate sa spunem cumperi o cartela si bagi optiunea de 2000 SMS sau nelimitat si gata. Nu cred ca se poate schimba nr de telefon ca practic u programezi telefonul nu cartela. Momentan am incercat pe un Nokia C5-00 dar nu am reusit o sa incerc si pe alt telefon daca e poate merge apare doar Bus 001 Device 004: ID 0421:03a7 Nokia Mobile Phones

Link to comment
Share on other sites

@quantum :

ll /sys/class/tty/ttyUSB*

ls: cannot access /sys/class/tty/ttyUSB*: No such file or directory .

comanda e dmesg | grep tty

root@zeus:/var/spool/sms# dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 0.726177] tty tty18: hash matches
[ 5.802123] cdc_acm 2-2:1.8: ttyACM0: USB ACM device
[ 90.771604] cdc_acm 2-2:1.8: ttyACM0: USB ACM device
root@zeus:/var/spool/sms#

in cazul meu nokia 6680i = ttyACM0

Link to comment
Share on other sites

Am reusit sa instalez gammu pe ubuntu si merge din consola ca ROOT cu comanda /home/user# sudo echo "sms test" | /usr/bin/gammu --sendsms TEXT 07xxxx... cum pot sa conectez un php sa pot trimite de pe localhost

am incercat cu www-data ALL=NOPASSWD dar nimic

in php e


<?php
$output = shell_exec('sudo echo "php SMS" | /usr/bin/gammu --sendsms TEXT +407xxxx.. );
echo "<pre>$output</pre>";
?>

dar primesc No response in specified timeout. Probably phone not connected.

Link to comment
Share on other sites

pai mai tata... daca conectez un singur telefon sa zicem care e pe cosmo si doar acolo am nelimitate cum trimite si la alte retele? poti face vreo comanda care sa actiuneze pt 3 telefoane deodata? :)) serios vb. unu il pun pe orange, altu pe voda, altu pe cosmo.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...