Home |  Page Index / Recent Changes / Access deniedRecently Commented | Search:
Login:     Password:   

  Bookmarks:   Page Index | Recent Changes | Access deniedRecently Commented | Access deniedUsers | Registration  
Print version :: Microsoft Word ready version

Sw4me: SMSReceptionCenter/MSSQL ...

SmsRc and MSSQL

Microsoft SQL Server supports a very powerful SQL dialect. A lot of our customers prefer to use SmsRc just as a gateway between the phone and the server, implementing all SMS-handling logic in the server's stored procedures.

For this type of project, the file with just one ExecuteSQL action must be created. The SQL statement must call the stored procedure that is ready to handle incoming messages. Using appropriate ODBC escape sequence, the statement will look like this one:

{ CALL sp_incoming_sms ( [%Timestamp%],  [%Sender%] , [%Message%] ) }

Returning the Answer

There are two ways to send the answer from the stored procedure.

  1. The procedure may return one row of data, so the values in its columns will be assigned to SmsRc variables. “Expected result format” field in the action must be set to “one selected records”, and the «Store result to variable(s)" field must contain variable names, corresponding to columns, separated by spaces. Then you may add a “Send SMS” action, using the variables returned from the procedure in the message body.
  2. The procedure may insert rows into the table named OutgoingSMs, thay may be created with the following statement:
    CREATE TABLE OutgoingSMs (
        [MsgID] int IDENTITY (11NOT NULL ,
        [MsgText] nvarchar (254)  NOT NULL ,
        [MsgStatus] int NOT NULL ,
        [MsgTarget] varchar (12)  NOT NULL 
    As the rows get inserted into this table with MsgStatus=0, SmsRc will try to send out appropriate messages and update MsgStatus to 1 on success, 2 on error.

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]