Products
Ozeki 10
Apps
Chat
SMS Gateway
Quick Start Guide
SMS with Client Software
HTTP API
SMS from/to Database
PHP SMS API
Solutions
Autoreply SMS
Autoreply Easy
Autoreply by Script
Autoreply from Database
Built-in SMTP server
SMS from C# API
SMS through Email
SMS from/to File
SMS from/to FTP server
Application starter SMS
C# SMS API
VB.NET SMS API
SQL Logging
System Database
Robot Controller
Softphone
PBX
Connections
Installation guide
Terms and Definitions
HTTP API
SMS
Bulk Messenger
Cluster
Developer tools
Robots
Hardware
Installer
Technology
Company


Ozeki 10 - SMS Gateway server software
Autoreply Easy Autoreply Easy | Autoreply from Database Autoreply from Database

Autoreply SMS using script

Ozeki SMS Gateway's Autoreply User can automatically reply to SMS messages or forward incoming messages. This guide explains how to install and configure your Autoreply User on SMS Gateway. Each Autoreply User is controlled by their own script. You will see example scripts too.

Start the video

Autoreply Users can be easily installed and configured through Ozeki SMS Gateway's browser GUI.

After creating your own Autoreply User, the script is stored at C:\Program Files\Ozeki\Ozeki10\Data\NG\config\scripts
with the following filename: 'autoreply_NameOfUser.txt'

Installing Autoreply User

On the 'Management' console you can see a 'Users/Applications' panel. Click the 'Add' button on the top-right corner of the panel (Figure 1). You can click 'Users and applications/Add user or application' from the top menu bar as well.


Figure 1 - Click 'Add' on the 'Users/Applications' panel of the 'Management' console

On the new page you will see two panels. The left-hand panel is called 'Users/Applications' and the right-hand panel is called 'Add user or application'. While the right-hand panel is for adding new users, the left-hand panel is contains the userlist. On the bottom of the userlist you can see the number of users plus applications currently installed on your Ozeki SMS Gateway. Keep in mind that each user and application must have a unique username.

Now look at the right-hand panel which contains usertypes and brief descriptions. Search Autoreply User and click the blue 'install' link next to it (Figure 2).


Figure 2 - Click 'install' next to Autoreply User

On the next page, please provide a unique username for your Autoreply User and click 'Ok'.

Configuring Autoreply User

The 'Autoreply script' tabpage should open up (Figure 3), which is the most important tabpage on the Autoreply User's Configuration panel. The autoreply script is the programcode of the Autoreply User.


Figure 3 - Write your Autoreply script

This tabpage contains two textboxes:

The upper textbox is the 'AutoReply script file'. This contains the filename of the script which is 'autoreply_NameOfUser.txt' as default. You can find this file at C:\Program Files\Ozeki\Ozeki10\Data\NG\config\scripts, which is it's default path. You can modify the file from outside sources, so it is very useful to know the path. For example you can rewrite the file from your own application. You can leave this textbox unchanged if you prefer.

The lower textbox contains the editable script stored in the file. It contains a few examples to show you the basics of programming SMS messaging for Ozeki SMS Gateway. The script is capable to set SMS messaging rules, like replying and forwarding. You can include comments by placing a hashmark (#) on the beginning of each line. As you can see, all lines are commented as default, but you can delete some hashmarks and insert real phone numbers to see how it works.

What is the structure of the SMS messaging script

The Autoreply User's SMS messaging script always consist of filter-action pairs, which is similar to an if-then structure used in other programming languages. The filter selects the SMS messages to perform the action on. The filter can identify phone numbers and text fragments, so it can react with an action accordingly. Actions are used for replying and forwarding SMS messages to certain GSM numbers. You can place several filter-action pairs in a simple code as seen in the following examples below, but keep in mind to finish the script with a 'STOP'. The interpreter will not go further the 'STOP' line.

Example Scripts for the Autoreply User

These are the same example scripts shown in the 'Autoreply script' tabpage of your Autoreply User (Figure 3 above).

Replies with a pre-written text to all incoming messages

Reply script:
n.*
SENDER Thank you for your message.

Interpretation: The sender of each message will get a pre-written text as a reply.

Explanation:

  • Filter: n means the filter will apply on the sender's phone number. 'n.*' means that every phone number is accepted. Keep in mind that in the other hand 'm.*' means the filter will apply to every message. Reach the current interpretation by using either 'n.*' or 'm.*'. Both of them will reply to all.
  • Action: All actions consist of a phone number and message pair.
    In this case the pre-written text will be sent to the sender's address, which is represented by a simple word, 'SENDER'. The text can be modified in 'autoreply_NameOfUser.txt' with text editors or from other applications and from Ozeki SMS Gateway as well. 'Thank you for your message.' is only an example.

Forwards incoming SMS messages to +3620123223

Forward script:
n.*
+3620123223 MSG

Interpretation: Each received message will be forwarded to +3620123223.

Explanation:

  • Filter: In the previous example you saw the same 'n.*' filter. It works the same way by applying the action to all incoming messages.
  • Action: The 1st word in the action is the phone number of the recipient. In this example the number is +3620123223. Make sure to use the international number format by starting the phone number with a plus sign (+) and continuing it with the country code. The 2nd word in the action is the message itself. The message in this example is 'MSG', which represents the text of the incoming message. You can target multiple recipients with your message by putting these actions in separate rows.

Forwards SMS messages from +362000001 to +3620123223

Forward script:
n^+362000001
+3620123223 MSG

Interpretation: Messages from +362000001 will be forwarded to +3620123223.

Explanation:

  • Filter: 'n' refers to the phone number of the sender. 'n^+362000001' checks if the phone number is +362000001.
  • Action: The 1st word in the action is the phone number of the recipient. In this example the number is +3620123223. Make sure to use the international number format by starting the phone number with a plus sign (+) and continuing it with the country code. The 2nd word in the action is the message itself. The message in this example is 'MSG', which represents the text of the incoming message. You can target multiple recipients with your message by putting these actions in separate rows. See this in the next example.

Forwards SMS messages starting with 'important' to +3620123223 and +3670322321

Forward script:
# If the message starts with the word 'important',
# forward it to +3620123223 and +3670322321
m^important.* +3620123223 SENDER: MSG +3670322321 MSG

Interpretation: If the beginning of the message is: 'important', it will be forwarded to +3620123223 and +3670322321.
+3670322321 will only get the text of the message, while +3620123223 gets the sender's address plus the text.

Explanation:

  • Filter: 'm' refers to the message text. 'm^important.*' checks if the 1st word is 'important'. * means that the text message can continue in any possible way.
  • Actions: The 1st word in these actions are the phone numbers of the recipients. In this example the numbers are +3620123223 and +3620123223. Make sure to use the international number format by starting the phone number with a plus sign (+) and continuing it with the country code. The 2nd word in these actions consists of the sender's address and the message text. The sender's address in this example is 'SENDER', which represents the sender of the incoming message and 'MSG', which represents the text of the incoming message.
    The two forwarded messages should look this way:
    +...numbers...: importat... sent to +3620123223
    important... sent to +3670322321

Configuring user Log Generation

Check out the 'Logging' tabpage on the Autreply User's 'Configuration' panel. If you place a tick in both checkboxes (Figure 4), it helps you to debug communication problems. It is capable to log the SMS message flow that has been applied by the Autoreply script (see above) and can also log low level communication related to the Autoreply User.


Figure 4 - Configuring Autoreply User logs

Below the checkbox you can find the 'Log file settings' groupbox with file related settings. The default log directory is C:\Program Files\Ozeki\Ozeki10\Data\NG\Logs, but you can always modify it. The maximum size of each log file and the maximum number of log files can also be set. If a log file gets bigger than the maximum file size, Ozeki SMS Gateway creates a new File. If the maximum number of log files have been reached, the oldest file should be replaced. This is why the corresponding textbox is called 'Number of rotated files'.

'Logging' tabpage's default values:
  • Log sent and received messages in human readable format: Checked
  • Log low level communication: Unchecked
  • Log directory: C:\Program Files\Ozeki\Ozeki10\Data\NG\Logs
  • Maximum log file size: 8000 kB
  • Number of rotated files: 8

If you like these default values, please do not change the boxes.

Advanced Settings

These settings can be reached by clicking on the 'Advanced' tabpage (Figure 5). Here you can set the user's login details for Ozeki SMS Gateway, which are the username and password pair. You should also specify the sender's address.

In the middle section you can change the 'Type of Addressbook' to SQL, LDAP or File then configure it on your left-hand.

In the lower section you can set the 'Max. number of responses' option, which prevents sending too much SMS responses to the same number. You can also 'Enable accounting for this user' which applies the credit limit for this Autoreply User. A cost of a single SMS is one credit. You can add credits by clicking 'Settings' on the left hand panel.


Figure 5 - Checking the 'Advanced' tab

SMS Scheduling

You can schedule when the Autoreply User will reply or forward incoming messages. It is turned off as default as you can see it on Figure 6. If it is turned on, SMS messages received before or after the schedule will not be replied.


Figure 6 - Modifying the configuration of SMS Scheduling

If the Autoreply User have been configured, please click 'OK' to save it.

You can always come back to check events or modify configuration. You can do this by selecting your user on the 'Users/Applications' panel and clicking appropriate button on the left hand panel (Figure 7)


Figure 7 - Events belonging to your Autoreply User


Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Products > Ozeki 10 > Apps > SMS Gateway > Solutions > Autoreply SMS > Autoreply by Script
Legal | Privacy policy | Terms of use
Page: 5747 | Login | 3.95.131.97