For example, setting up a GoIP SMS server in Ubuntu Server 14.04 LTS x64.
Switch immediately to root user:
sudo -i
Update the system, install the web server and mysql server:
apt-get update
apt-get upgrade
apt-get install apache2 php5 mysql-server php-mysqli
Let’s see if there are new versions of the SMS server here:
http://www.hybertone.com/en/news_detail.asp?newsid=21
http://en.dbltek.com/Software-Download.html
http://dbltek.com/update/
For you, I saved the goip_install-v1.24.2.tar.gz archive with the version I installed:
https://files.ixnfo.com/Soft/goip_install-v1.24.2.tar.gz
And also:
https://files.ixnfo.com/Soft/goip_install-v1.28.tar.gz
https://files.ixnfo.com/Soft/goip_install-v1.30.2.tar.gz
Download the archive with the goip SMS server in the temporary directory and run the installation script:
cd /tmp
wget http://dbltek.com/update/goip_install-v1.30.2.tar.gz
tar xvfz goip_install-v1.30.2.tar.gz
cd goip_install
./goip_install.sh
During installation, we will answer a few questions:
1) Location of the directory with the configuration of the web server (a file with web settings will be created), in my case it is /etc/apache2/conf-enabled
2) The root password of the user to the Mysql server (a goip database will be created)
3) The location of Mysql, it’s standard /usr/bin/mysql, just hit Enter
Restart the web server to load the configuration file from /etc/apache2/conf-enabled:
service apache2 restart
In the browser you can already open the control panel sms server http://HOSTNAME/goip
I have an error:
Forbidden
You don’t have permission to access /goip on this server.
The reason for this is the obsolete options in /etc/apache2/conf-enabled/goip.conf, I commented out the two lines with the # character and added a line after them:
# Order allow,deny
# Allow from all
Require all granted
After that, everything was opened, the standard login and root password.
We proceed to the setting.
In “System Manage” – “Provider Manage” we will add a provider, for this we indicate in Provider(1) his name or just the number by the numbers themselves.
Now let’s go to “System Manage” – “GoIP Manage“, click on the “Add GoIP” at the top and add an account for the first channel of the GoIP gateway (first Sim).
ID:ks1
Batch Lines:1
Provider:created provider
Password:password
Confirm Password:password
Open the web interface of the GoIP gateway and go to “Configurations” – “SMS” where we specify the parameters of this account.
SMS Server:Enable
SMS Server IP: SMS server address
SMS Server Port:44444
SMS Client ID: ks1
Password: password
Send SMSC Number: Enable
After that, the SMS server “System Manage” – “GoIP Manage” should display the status “Login“.
If the Login status does not appear, I had it on Ubuntu Server 14.04 LTS x64 and noticed the message:
but cannot get response from process named “goipcron”
To solve this problem, the libraries had to be delivered:
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
And run goipcron again:
cd /usr/local/goip
./run_goipcron
For autorun run_goipcron, create a file for example using the nano editor:
sudo nano /etc/init.d/goipcron
Add to file:
#! /bin/sh
cd /usr/local/goip
./run_goipcron
Make the file executable:
sudo chmod +x /etc/init.d/goipcron
And add to autoload:
sudo update-rc.d goipcron defaults 80
On the server in case of problems with the connection, you can catch packets through tcpdump like this:
tcpdump -i any -vnn -s0 port 44444
The server can receive POST and GET requests, I will give an example of sending SMS (recipients in “smsnum =” you can specify a few commas without spaces, instead of “text” we specify our values):
http://192.168.1.21/goip/en/dosend.php?USERNAME=text&PASSWORD=text&smsprovider=1&goipname=ks1&smsnum=text&method=2&Memo=text
Incoming SMS can be seen in Send Message – Inbox, outgoing in Send Message – Examine Sendings.
In order not to write call statistics (Asterisk writes it to me), in System Manage – System Manage we will put Disable opposite GoIP Report Record, and also put Disable on Save message before sending (browser should support javascript) not to use java from the client when sending SMS via API.
You can send SMS in the Send Directly menu, you can specify multiple recipient numbers at once, separated by commas.
I will give examples of SQL queries that can be viewed/counted the number of SMS sent/delivered, sent/not delivered for all the time and on a specific date:
SELECT * FROM `sends` WHERE received=1;
SELECT * FROM `sends` WHERE received=0;
SELECT * FROM `sends` WHERE received=0 AND time LIKE '2017-02-05%';
SELECT count(*) FROM sends WHERE received=0 AND time >=CURDATE();
SELECT count(*) FROM sends WHERE provider != '3';
Number of SMS sent today:
SELECT count(*) FROM sends WHERE time >=CURDATE();
SELECT count(*) FROM sends WHERE time >= cast((now()) as date) AND time < cast((now() + interval 1 day) as date);
I will give an example of searching the status of a message by text and phone number:
SELECT sends.received FROM sends
LEFT JOIN message ON (sends.messageid = message.id)
WHERE message.msg = "TEXT"
AND message.tel=380961112233;
An example of clearing old sent messages with a sql query:
DELETE FROM goip.sends WHERE time = '0000-00-00 00:00:00';
DELETE FROM goip.sends WHERE time < '2020-02-01 00:00:00';
DELETE FROM goip.message WHERE time < '2020-02-01 00:00:00';
If iptables is used on Linux, then we add a rule allowing the connection of the Goip4 gateway (where 192.168.2.2 is the Goip4 address of the gateway):
iptables -A INPUT -s 192.168.2.2/32 -p udp -m udp --dport 44444 -j ACCEPT
See also my articles:
Configuring GOIP4 with Asterisk
SMS sending script via Goip4 gateway
Script to send SMS via Goip4 gateway for ABillS
Hi,
Is possible to disable the “receiving” notification? I dont find where i can change this. But everytime i send a sms take 15 sec with the notification. I need to send it faster, and the option with “JavaScript” only works in web. Im using this with an api.