-
-
Save parsibox/e5cf0ee4bffe2bf5f215668e52294952 to your computer and use it in GitHub Desktop.
| yum install -y openssl-devel libxml2-devel texlive-* m4 gcc-c++ make | |
| yum-config-manager --disable mysql80-community | |
| yum-config-manager --enable mysql57-community | |
| yum install -y mysql-devel | |
| https://blog.onesconsultants.com/2018/08/how-to-install-kannel-in-centos-7.html | |
| need bison ==2.7 | |
| mkdir /var/www/ | |
| mkdir /var/www/kannel | |
| cd /var/www/kannel | |
| wget https://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz | |
| tar zxvf bison-2.7.tar.gz && cd bison-2.7 && ./configure && make && make install && cd src | |
| rm -rf /usr/local/bin/bison | |
| rm -rf /usr/bin/bison | |
| cp bison /usr/local/bin/bison && cp bison /usr/bin/bison | |
| cd .. && cd .. && rm -rf bison-2.7.tar.gz bison-2.7 | |
| cd /var/www/kannel | |
| wget --no-check-certificate https://www.kannel.org/download/1.4.5/gateway-1.4.5.zip | |
| unzip gateway-1.4.5.zip | |
| rm -rf gateway-1.4.5.zip | |
| mv gateway-1.4.5 gateway | |
| cd gateway/ | |
| ./configure --enable-localtime --prefix=/var/www/kannel --with-mysql --with-mysql-dir=/usr/lib/mysql/ --enable-debug --enable-assertions --with-defaults=speed --disable-localtime --enable-start-stop-daemon --enable-pam | |
| sudo make | |
| sudo make install | |
| sudo mkdir /var/www/kannel/logs | |
| mysql -uroot -p kannel < /var/www/kannel/kannel.sql |
./configure --enable-localtime --prefix=/usr/local/gateway-1.4.5 --with-mysql --with-mysql-dir=/usr/lib/mysql/ --enable-debug --enable-assertions --with-defaults=speed --disable-localtime --enable-start-stop-daemon --enable-pam
Getting This error :
Configuring DB support ...
checking whether to compile with MySQL support... searching
checking for mysql_config... no
checking for MySQL client support in... /usr
checking for "/usr/include/mysql/mysql.h"... no
checking for "/usr/include/mysql.h"... no
checking for MySQL client support in... /usr/local
checking for "/usr/local/include/mysql/mysql.h"... no
checking for "/usr/local/include/mysql.h"... no
configure: error: Unable to find mysql.h, please provide a --with-mysql-dir=
you did not install mysql-devel
./configure --enable-localtime --prefix=/usr/local/gateway-1.4.5 --with-mysql --with-mysql-dir=/usr/lib/mysql/ --enable-debug --enable-assertions --with-defaults=speed --disable-localtime --enable-start-stop-daemon --enable-pam
Getting This error : Configuring DB support ... checking whether to compile with MySQL support... searching checking for mysql_config... no checking for MySQL client support in... /usr checking for "/usr/include/mysql/mysql.h"... no checking for "/usr/include/mysql.h"... no checking for MySQL client support in... /usr/local checking for "/usr/local/include/mysql/mysql.h"... no checking for "/usr/local/include/mysql.h"... no configure: error: Unable to find mysql.h, please provide a --with-mysql-dir=
location
you did not install mysql-devel
DROP TABLE IF EXISTS
dlr;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
dlr(idbigint(20) NOT NULL AUTO_INCREMENT,datetimetimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,smscvarchar(40) DEFAULT NULL,tsvarchar(40) DEFAULT NULL,destinationvarchar(40) DEFAULT NULL,sourcevarchar(40) DEFAULT NULL,servicevarchar(40) DEFAULT NULL,urlvarchar(255) DEFAULT NULL,maskint(10) DEFAULT NULL,statusint(10) DEFAULT NULL,boxcvarchar(40) DEFAULT NULL,timebigint(20) NOT NULL,smsc_idvarchar(40) NOT NULL,sms_idbigint(20) NOT NULL,msgdatatext NOT NULL,numbertext NOT NULL,messagetext NOT NULL,PRIMARY KEY (
id)) ENGINE=InnoDB AUTO_INCREMENT=443 DEFAULT CHARSET=latin1;
/!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table
dlrLOCK TABLES
dlrWRITE;/*!40000 ALTER TABLE
dlrDISABLE KEYS /;/!40000 ALTER TABLE
dlrENABLE KEYS */;UNLOCK TABLES;
--
-- Table structure for table
dlr2DROP TABLE IF EXISTS
dlr2;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
dlr2(id_smsbigint(20) NOT NULL AUTO_INCREMENT,smscvarchar(40) DEFAULT NULL,msgidtext NOT NULL,destinationvarchar(40) DEFAULT NULL,sendertypetext,urlvarchar(255) DEFAULT NULL,maskint(10) DEFAULT NULL,statustext,boxcvarchar(40) DEFAULT NULL,sms_insert_datetimestamp NULL DEFAULT CURRENT_TIMESTAMP,sms_delivery_datetimestamp NULL DEFAULT NULL,sms_messagetext NOT NULL,status2text NOT NULL,PRIMARY KEY (
id_sms)) ENGINE=InnoDB AUTO_INCREMENT=293 DEFAULT CHARSET=latin1;
/!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table
dlr2LOCK TABLES
dlr2WRITE;/*!40000 ALTER TABLE
dlr2DISABLE KEYS /;/!40000 ALTER TABLE
dlr2ENABLE KEYS */;UNLOCK TABLES;
--
-- Table structure for table
send_smsDROP TABLE IF EXISTS
send_sms;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
send_sms(sql_idbigint(20) NOT NULL AUTO_INCREMENT,momtenum('MO','MT') DEFAULT NULL,sendervarchar(20) DEFAULT NULL,receivervarchar(20) DEFAULT NULL,udhdatablob,msgdatatext CHARACTER SET utf8,timebigint(20) DEFAULT NULL,smsc_idvarchar(255) DEFAULT NULL,servicevarchar(255) DEFAULT NULL,accountvarchar(255) DEFAULT NULL,idbigint(20) DEFAULT NULL,sms_typebigint(20) DEFAULT NULL,mclassbigint(20) DEFAULT NULL,mwibigint(20) DEFAULT NULL,codingbigint(20) DEFAULT NULL,compressbigint(20) DEFAULT NULL,validitybigint(20) DEFAULT NULL,deferredbigint(20) DEFAULT NULL,dlr_maskbigint(20) DEFAULT NULL,dlr_urlvarchar(255) DEFAULT NULL,pidbigint(20) DEFAULT NULL,alt_dcsbigint(20) DEFAULT NULL,rpibigint(20) DEFAULT NULL,charsetvarchar(255) CHARACTER SET utf8 DEFAULT NULL,boxc_idvarchar(255) DEFAULT NULL,binfovarchar(255) DEFAULT NULL,meta_datatext,statusvarchar(10) DEFAULT NULL,PRIMARY KEY (
sql_id)) ENGINE=MyISAM AUTO_INCREMENT=782 DEFAULT CHARSET=latin1;
/!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table
send_smsLOCK TABLES
send_smsWRITE;/*!40000 ALTER TABLE
send_smsDISABLE KEYS /;/!40000 ALTER TABLE
send_smsENABLE KEYS */;UNLOCK TABLES;
--
-- Table structure for table
sent_smsDROP TABLE IF EXISTS
sent_sms;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
sent_sms(sql_idbigint(20) NOT NULL AUTO_INCREMENT,datetimetimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,momtenum('MO','MT','DLR') DEFAULT NULL,sendervarchar(20) DEFAULT NULL,receivervarchar(20) DEFAULT NULL,udhdatablob,msgdatatext,smsc_idvarchar(255) DEFAULT NULL,servicevarchar(255) DEFAULT NULL,accountvarchar(255) DEFAULT NULL,idbigint(20) DEFAULT NULL,sms_typebigint(20) DEFAULT NULL,mclassbigint(20) DEFAULT NULL,mwibigint(20) DEFAULT NULL,codingbigint(20) DEFAULT NULL,compressbigint(20) DEFAULT NULL,validitybigint(20) DEFAULT NULL,deferredbigint(20) DEFAULT NULL,dlr_maskbigint(20) DEFAULT NULL,dlr_urlvarchar(255) DEFAULT NULL,pidbigint(20) DEFAULT NULL,alt_dcsbigint(20) DEFAULT NULL,rpibigint(20) DEFAULT NULL,charsetvarchar(255) DEFAULT NULL,boxc_idvarchar(255) DEFAULT NULL,binfovarchar(255) DEFAULT NULL,statustext,timebigint(20) DEFAULT NULL,PRIMARY KEY (
sql_id),KEY
ix_sent_sms_dlr_url(dlr_url)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table
sent_smsLOCK TABLES
sent_smsWRITE;/*!40000 ALTER TABLE
sent_smsDISABLE KEYS /;/!40000 ALTER TABLE
sent_smsENABLE KEYS */;UNLOCK TABLES;
DELIMITER ;;
/!50003 CREATE/ /*!50017 / /!50003 TRIGGER
after_sent_sms_insertAFTER INSERT ONsent_smsFOR EACH ROW BEGIN
UPDATE snd SET zaibstatus = 'Submitted to sqlbox' WHERE snd_id = NEW.dlr_url;
IF NEW.momt = 'DLR' THEN
CASE NEW.dlr_mask
WHEN 1 THEN UPDATE snd SET snd_success = FROM_UNIXTIME(NEW.time) , zaibstatus = 'SUCCESS' WHERE snd_id = NEW.dlr_url;
WHEN 2 THEN UPDATE snd SET snd_failure = FROM_UNIXTIME(NEW.time) , zaibstatus = 'FAILED wrong no' WHERE snd_id = NEW.dlr_url;
WHEN 4 THEN UPDATE snd SET snd_buffered = FROM_UNIXTIME(NEW.time) WHERE snd_id = NEW.dlr_url;
WHEN 8 THEN UPDATE snd SET snd_submitted = FROM_UNIXTIME(NEW.time) , zaibstatus = 'Pending' WHERE snd_id = NEW.dlr_url;
WHEN 16 THEN UPDATE snd SET snd_rejected = FROM_UNIXTIME(NEW.time) WHERE snd_id = NEW.dlr_url;
WHEN 32 THEN UPDATE snd SET snd_intermediate = FROM_UNIXTIME(NEW.time) WHERE snd_id = NEW.dlr_url;
ELSE UPDATE snd SET snd_last = NEW.dlr_mask WHERE snd_id = NEW.dlr_url;
END CASE;
END IF;
END */;;
DELIMITER ;
--
-- Table structure for table
sndDROP TABLE IF EXISTS
snd;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
snd(snd_idbigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Every message has a unique id',snd_sendervarchar(255) DEFAULT NULL COMMENT 'The number that the message is sent from',snd_tovarchar(255) DEFAULT NULL COMMENT 'The number that the message is sent to',snd_txtlongtext COMMENT 'The body text of the message',snd_smscvarchar(255) DEFAULT NULL COMMENT 'The number that the message is route to',snd_sentattimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The time that the message is inserted',snd_successdatetime DEFAULT NULL COMMENT 'The time that the message was delivered to the hand set',snd_failuredatetime DEFAULT NULL COMMENT 'The time that the message failed',snd_submitteddatetime DEFAULT NULL COMMENT 'The time that the message is submitted to the smsc',snd_buffereddatetime DEFAULT NULL COMMENT 'The time that the message is buffered at the smsc',snd_rejecteddatetime DEFAULT NULL COMMENT 'The time that the message was rejected',snd_intermediatedatetime DEFAULT NULL COMMENT 'Time of intermediate status',snd_lastint(11) NOT NULL DEFAULT '0',zaibstatustext,PRIMARY KEY (
snd_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This table holds the messages that are sent, including DLR values.';
/!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table
sndLOCK TABLES
sndWRITE;/*!40000 ALTER TABLE
sndDISABLE KEYS /;/!40000 ALTER TABLE
sndENABLE KEYS */;UNLOCK TABLES;
DELIMITER ;;
/!50003 CREATE/ /*!50017 / /!50003 TRIGGER
after_snd_insertAFTER INSERT ONsndFOR EACH ROW BEGIN
INSERT INTO send_sms (momt, sender, receiver, msgdata, smsc_id, sms_type, dlr_mask, dlr_url, boxc_id, coding)
VALUES ('MT', NEW.snd_sender, NEW.snd_to, NEW.snd_txt, NEW.snd_smsc, 2, 31, NEW.snd_id, 'sqlbox', '2');
END */;;
DELIMITER ;