Build SMS Server

Source: Internet
Author: User

Today with a proactive attitude, the SMS server operating environment to build a successful, and we share the experience, hope to help everyone.

1. Install the Oracle client, the original version of the Oracle client has been used, but "sky shine" is not recognized, can only install Oracle's official Oracle client,


2. Add a connection string to the Oracle client's Tnsnames.ora configuration file

ORCL172 =  (DESCRIPTION = (    address_list = (      ADDRESS = (PROTOCOL = TCP) (HOST = 172.22.51.172) (PORT = 1521))    )    (Connect_data =      (SERVER = dedicated)      (service_name = rdpcs)    )  )

3. Install the GPRS modem driver, plug in the GPRM modem hardware;


4. Installation of GPRM modem management procedures;


5. Create Sky colorful channel configuration;


6. The data tables required by the Oracle database creator are as follows:

CREATE TABLE Msg_failedbox (ID number not NULL, Originmsgid number not NULL, expresslevel number default 2 NOT NULL, Sender VARCHAR2 (+), Rec                         Eiver VARCHAR2 ($) NOT NULL, Msgtype number Not NULL, Msgtitle VARCHAR2 (+), mmscontentlocation VARCHAR2 (+), Se Ndtime DATE default sysdate NOT NULL, Commport NUM BER NOT NULL, actualsendtime DATE NOT NULL, FAILEDR Eason VARCHAR2 (+)); ALTER TABLE Msg_failedbox add constraint msg_failedbox_pk11075707620945 primary ke Y (ID) using index pctfree Initrans 2 Maxtrans 255 storage (initial 64K minextents 1 maxextents Unlimi Ted); CREATE TABLE Msg_INBOX (ID number not NULL, Sender VARCHAR2 (100) Not NULL, msgtype number is not NULL, Msgtitle VAR CHAR2 (+), Mmsurl VARCHAR2, mmscontentlocation VARCHAR2 (4000), Msgarriv             Edtime date not NULL, Mmsdownloadedtime date, mmsdownloadedstate Number default 0 NOT NULL, commport number not ALTER TABLE Msg_inbox ADD constraint msg_inbox_pk21075710238559 primary key (ID) using index Pctfree Initran                          s 2 Maxtrans 255 storage (initial 64K minextents 1 Maxextents Unlimited); CREATE TABLE Msg_outbox (MsgID  Number NOT NULL, expresslevel number default 2 NOT NULL            , Sender             VARCHAR2 (+), Receiver VARCHAR2 (+) not NULL, Msgtype Number default 1 NOT NULL, Msgtitle VARCHAR2 (+), MM Scontentlocation VARCHAR2 ($), sendtime DATE default Sysdat  E NOT NULL, commport number is default 0 NOT NULL); ALTER TABLE Msg_outbox Add constraint msg_outbox_pk21075710226041 primary key (MsgID) using index pctfree Initrans 2 Maxtrans 255 Stora                             GE (initial 64K minextents 1 Maxextents Unlimited); CREATE TABLE Msg_sentbox (ID                    Number NOT NULL, ORIGINMSGID number is not NULL, expresslevel                       Number NOT NULL, Sender VARCHAR2 (+), Receiver VARCHAR2 () not NULL, msgtype number is not NULL, Msgtitle                       VARCHAR2 (+), mmscontentlocation VARCHAR2 (+), Sendtime DATE                 Not NULL, commport number is not NULL, actualsendtime Date not NULL, Receivemmstime date, Mmsmessageid VARCHAR2 (20 0); ALTER TABLE Msg_sentbox add constraint msg_sentbox_pk21075710226041 primary key (ID) using index Pctfree INITR Ans 2 Maxtrans 255 storage (initial 64K minextents 1 Maxextents unlimited); Create sequence msg_failedbox_id _seqminvalue 1maxvalue 999999999start with 81increment by 1cache 20;create sequence Msg_inbox_id_seqminvalue 1maxvalue 99 9999999start with 81increment by 1cache 20;create sequence Msg_outbox_id_seqminvalue 1maxvalue 999999999start with 141inc Rement by 1cache 20;create Sequence Msg_sentbox_id_seqminvalue 1maxvalue 999999999start with 81increment by 1cache 20; CREATE OR REPLACE TRIGGER "set_msg_failedbox_id" before INSERT on "Msg_failedbox" for each rowdeclare Next_msg_fail EDBOX_ID number; BEGIN SELECT Msg_failedbox_id_seq.  Nextval to next_msg_failedbox_id from DUAL; : new.id: = next_msg_failedbox_id; End;/create OR REPLACE TRIGGER "set_msg_inbox_id" before INSERT on "Msg_inbox" for each rowdeclare next_msg_inbox_i D number; BEGIN SELECT Msg_outbox_id_seq.  Nextval to next_msg_inbox_id from DUAL; : new.id: = next_msg_inbox_id; End;/create OR REPLACE TRIGGER "set_msg_outbox_id" before INSERT on "Msg_outbox" for each rowdeclare next_msg_outbox_i D number; BEGIN SELECT Msg_outbox_id_seq.  Nextval to next_msg_outbox_id from DUAL; : NEW. MsgID: = next_msg_outbox_id; End;/create OR REPLACE TRIGGER "set_msg_sentbox_id" before INSERT on "Msg_sentbox" for each rowdeclare Next_msg_sentbo X_ID number; BEGIN SELECT Msg_sentbox_id_seq. Nextval intonext_msg_sentbox_id from DUAL; : new.id: = next_msg_sentbox_id; End;/commit;
7. Create a colorful database configuration:


The database connection string name of the database configuration page and the connection string name configured in step 2 in Tnsnames.ora must be the same, test the connection.

8. Send the test SMS:


Use the method is: to Msg_outbox table (Information sent table) inserted the text message you want to send, Grrs modem hardware program will send the table data to the target phone number, while the record from the Msg_outbox table deleted. The message is sent successfully, the record is stored to the Msg_sentbox table (the Information sending success table), the message sending fails, and the record is stored to the Msg_failedbox table (Information sending failure table). The Msg_inbox table is used to store received MMS/SMS messages.

To this, the SMS server operating environment to build a successful, I hope that my share can help everyone progress.

Setting up a short message server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.