Install Gammu in Centos 7 and Postgresql Database

Gammu SMS gateway in Centos

1. Fist install software depedency from gammu with type command below

# yum groupinstall “Development Tools”
# yum install alsa-lib mesa-libGLU-devel freetype-devel libmng-devel libpng-devel
# yum install libXt-devel libXft-devel libXrandr-devel libXcirsor-devel libXi-devel libXinerama-devel
# yum install postgres-devel
2. After install software depedency from gammu, we need install cmake for compile gammu. Type this command
#wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
3. After download cmake, rar cmake with type command below
#tar -xzvf cmake-3.6.2.tar.gz
4. Move directory to directory cmake
#cd cmake-3.6.2
5. Run configure and gmake to compile package
#./configure
#gmake
6. In this step, we donwload gammu packet
7. After download gammu, extract gammu
# tar -xzvf gammu-1.38.3.tar.gz
8. Move to directory gammu
# cd gammu-1.38.3
9. Configure gammu and make install gammu packet with type command below
# ./configure
# make install
10. Make symlink libGAmmu.so and libgsmsd.so
# ln -s /usr/local/lib64/libGammu.so /usr/lib64/libGammu.so.7
# ln -s /usr/local/lib64/libgsmsd.so /usr/lib64/libgsmsd.so.7
11. Make directory for gammu log
#mkdir /var/log/gammu
12. Edit and add value for gammu smsd
#nano etc/gammu-smsd
# This is a sample Gammu SMSD configuration file. It's required for gammu-smsd,
# see gammu-smsdrc(5) for documentation.
# Gammu configuration, this section is like section "gammu" in "gammurc" file,
# see gammurc(5) for documentation.
[gammu]
device = /dev/ttyUSB1
model = at
connection = at115200
synchronizetime = yes
#logfile = gammulog # this is not used at all in SMSD mode
#logformat = textall
#use_locking = yes
#gammuloc = gammu.us
#startinfo = yes
# When uncomment this section and insert numbers here, smsd will process
# incoming sms only from numbers written here (incoming sms from all other
# numbers will be deleted)
#[include_numbers]
#number1 = 1234
# When uncomment this section and insert numbers here, smsd will process
# incoming sms from all numbers not written here (incoming sms from numbers
# written here will be deleted). This is "black" list.
# Note: after using "include_numbers" section this one will be ignored
#[exclude_numbers]
#number1 = 1234
# General SMSD settings, see gammu-smsdrc(5) for detailed description.
[smsd]
service = sql
PIN = 1234
logfile = /var/log/gammu/phone
debuglevel = 1
phoneid = halophone
commtimeout = 30
sendtimeout = 30
maxretries = 2
receivefrequency = 30
loopsleep = 10
statusfrequency = 60
checksecurity = 0
resetfrequency = 1000
deliveryreport = sms
deliveryreportdelay = 14400
smsc = smsc
user = user
password = password
database = eklanku_sms
host = IP_xxxxxx
driver = native_pgsql

13. Installasi done you can use this command bellow for testing gammu
root@smsgateway1:~# gammu -c /etc/gammu-smsdrc3 getsmsc
Location             : 1
Number               : "+6281100000"
Default number       : ""
Format               : Text
Validity             : Maximum time
root@smsgateway1:~# gammu -c /etc/gammu-smsdrc3 sendsms TEXT 08113500090 -text "halo"
If you want break, press Ctrl+C…
Sending SMS 1/1....waiting for network answer..OK, message reference=117

3 Comments

  1. Hey, I installed gammu under centos 7 sever, When I test the send sms
    [tooy@Gammu ~] # echo "hello" | gammu --sendsms TEXT +2162*******
    No response in specified timeout. Probably phone not connected.
    please How I resolve this issue

    ReplyDelete
    Replies

    1. whether the modem is detected using the wvdial command?

      Delete
  2. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. PostgreSQL NULL value

    ReplyDelete
Previous Post Next Post