Ozeki 10 SMS Gateway
MSSQL table layout MSSQL table layout | SQL Log Tracking SQL Log Tracking

Default SQL template examples

You can use the following example templates in all cases that a message is 'Received', 'Accepted for delivery', 'Delivered to network', 'Delivered to handset' and has 'Delivery error'. These SQL statements will run every time one of these five message events occur in Ozeki SMS Gateway.

This example template INSERT-s every incoming message to the 'inbox' table.
INSERT INTO inbox (username,msgtype,msgid,sender,receiver,msgsubject,msgdata,senttime,receivedtime,operator) VALUES ('$username','$msgtype','$msgid','$sender','$receiver','$msgsubject','$msgdata','$senttime','$receivedtime','$operator')

Accepted for delivery:
You can INSERT messages in the 'outbox' table before broadcasting them with Ozeki SMS Gateway.
INSERT INTO outbox (username,msgtype,msgid,sender,receiver,msgsubject,msgdata,acceptedfordeliverytime,operator,status) VALUES ('$username','$msgtype','$msgid','$sender','$receiver','$msgsubject','$msgdata','$acceptedfordeliverytime','$operator','accepted')

Delivered to network:
UPDATE-s the message record before delivering it to the network. For example it changes the message status.
UPDATE outbox SET deliveredtonetworktime='$deliveredtonetworktime', callbackid='$callbackid', status='deliveredtonetwork', cost='$cost' where msgid='$msgid'

Delivered to handset:
UPDATE-s the message record before delivering it to the recipient's handset by changing the message status.
UPDATE outbox SET deliveredtohandsettime='$deliveredtohandsettime', status='deliveredtohandset' where msgid='$msgid'

Delivery error:
UPDATE-s the message record in case of an error. It also saves the error message as well.
UPDATE outbox SET errormessage='$errormessage', status='deliveryfailed' where msgid='$msgid'

You can find these SQL examples in the field boxes

Figure 1 - Find and if necessary modify the SQL templates

Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Products > SMS > SMS gateway > SQL Logging > SQL templates
Legal | Privacy policy | Terms of use
Page: 5780 | Login |