Set up an SMS Server
Today, with a proactive attitude, we have successfully established the operating environment of the SMS Server. I would like to share my experience with you and hope to help you.
1. to install the Oracle client, you have been using the lite version of the Oracle client. However, "skysky colorful" cannot be identified. You can only install the Oracle client officially provided by Oracle,
2. Add a connection string in the tnsnames. ora configuration file of the Oracle client.
ORCL172 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.22.51.172)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RDPCS) ) )
3. Install the driver of the GPRS Modem and plug in the hardware of the GPRS Modem;
4. Install the Management Program of the GPRS Modem;
5. Create a colorful Channel configuration;
6. The data table required to create a program in the Oracle database. The script is as follows:
create table MSG_FAILEDBOX( ID NUMBER not null, OriginMsgID NUMBER not null, ExpressLevel NUMBER default 2 not null , Sender VARCHAR2(100), Receiver VARCHAR2(200) not null, MsgType NUMBER not null, MsgTitle VARCHAR2(500), MMSContentLocation VARCHAR2(500), SendTime DATE default SYSDATE not null, CommPort NUMBER not null, ActualSendTime DATE not null, FailedReason VARCHAR2(500));alter table MSG_FAILEDBOX add constraint MSG_FAILEDBOX_PK11075707620945 primary key (ID) using index pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited );create table MSG_INBOX( ID NUMBER not null, Sender VARCHAR2(100) not null, MsgType NUMBER not null, MsgTitle VARCHAR2(500), MMSUrl VARCHAR2(200), MMSContentLocation VARCHAR2(4000), MsgArrivedTime DATE not null, MMSDownloadedTime DATE, MMSDownloadedState NUMBER default 0 not null , CommPort NUMBER not null);alter table MSG_INBOX add constraint MSG_INBOX_PK21075710238559 primary key (ID) using index pctfree 10 initrans 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(100), Receiver VARCHAR2(200) not null, MsgType NUMBER default 1 not null , MsgTitle VARCHAR2(500), MMSContentLocation VARCHAR2(500), SendTime DATE default SYSDATE not null, CommPort NUMBER default 0 not null );alter table MSG_OUTBOX add constraint MSG_OUTBOX_PK21075710226041 primary key (MsgID) using index pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K minextents 1 maxextents unlimited );create table MSG_SENTBOX( ID NUMBER not null, OriginMsgID NUMBER not null, ExpressLevel NUMBER not null, Sender VARCHAR2(100), Receiver VARCHAR2(200) not null, MsgType NUMBER not null, MsgTitle VARCHAR2(500), MMSContentLocation VARCHAR2(500), SendTime DATE not null, CommPort NUMBER not null, ActualSendTime DATE not null, ReceiveMMSTime DATE, MMSMessageID VARCHAR2(200));alter table MSG_SENTBOX add constraint MSG_SENTBOX_PK21075710226041 primary key (ID) using index pctfree 10 initrans 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 999999999start with 81increment by 1cache 20;create sequence MSG_OUTBOX_ID_SEQminvalue 1maxvalue 999999999start with 141increment 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_FAILEDBOX_ID NUMBER;BEGIN SELECT MSG_FAILEDBOX_ID_SEQ.NEXTVAL INTO 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_ID NUMBER;BEGIN SELECT MSG_OUTBOX_ID_SEQ.NEXTVAL INTO 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_ID NUMBER;BEGIN SELECT MSG_OUTBOX_ID_SEQ.NEXTVAL INTO 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_SENTBOX_ID NUMBER;BEGIN SELECT MSG_SENTBOX_ID_SEQ.NEXTVAL INTO NEXT_MSG_SENTBOX_ID FROM DUAL; :NEW.ID := NEXT_MSG_SENTBOX_ID;END;/commit;
7. startup Database Configuration:
The database connection string name on the database configuration page must be the same as the connection string name configured in tnsnames. ora in step 2. Test the connection.
8. Send test text message:
Usage: insert the text message content to the MSG_Outbox table (information sending table). The program in the GRRS Modem Hardware sends the data in the table to the target mobile phone number, delete this record from the MSG_Outbox table. If the message is successfully sent, this record is stored in the MSG_Sentbox table (table indicating successful message sending). If the message fails to be sent, this record is stored in the MSG_Failedbox table (table indicating failed message sending ). The MSG_Inbox table is used to store received MMS/SMS messages.
At this point, the text message server's operating environment has been successfully set up. I hope my sharing will help you make progress.