Active Perts: S o F T W A R e
Active Perts: S o F T W A R e
Administrators Manual
June 2005
1999-2005 - ActiveXperts Software B.V.
http://www.activexperts.com
[email protected]
ActiveXperts
software
3
3
5
5
6
7
8
8
10
INTRODUCTION
12
OPTIONS (GENERAL PROGRAM SETTINGS) 12
CHANNELS (COMMUNICATION SETTINGS) 13
TRIGGERS (PROCESSING INCOMING MESSAGES)
6. MESSAGE DATABASE
6.1.
6.2.
6.3.
6.4.
18
INTRODUCTION
18
MESSAGE DATABASE - TABLES AND FIELDS
ARCHIVING MESSAGES
21
MIGRATING TO MS SQL
22
7. TROUBLESHOOTING
17
18
23
7.1. INTRODUCTION
23
7.2. ACTIVEXPERTS SMS MESSAGING SERVER MONITOR
7.3. TRACING
23
8. PERFORMANCE TUNING
25
8.1. INTRODUCTION
8.2. MESSAGE DATABASE
8.3. QUEUE DIRECTORY
25
25
26
27
27
27
28
29
30
31
32
34
35
36
37
38
39
40
23
3.2. Channels
A Channel is a communication device or a communication protocol. Messages are sent and
received by such a Channel. You can define Channels for each of the following
devices/protocols:
GSM Modem
SMPP compliant SMSC provider
POP3 server
SMTP server
The properties of a channel depend on the type of channel.
You can define a Channel for each GSM Modem, SMPP provider, POP3 connection and
SMTP connection. These channels are stored in the Configuration Database. The SMS
Messaging Server service reads the Channel configuration from the Configuration Database and
controls each Channel by a separate process (also called thread).
3.3. Triggers
Triggers are defined to process incoming messages.
Each trigger is a set that includes a condition and an associated script. The condition is an SQLlike condition that selects a set of unprocessed, incoming messages.
As soon as a new message is received through one of the channels, the status of the message is
set to Not Processed. The SMS Messaging Server regularly (by default: once every 5 seconds)
In the above table, the WorkFlow.vbs will be called if the senders mobile number matches
either +4400000001, +4400000002 or +4400000003.
Lets assume that the senders number equals +4400000001. WorkFlow.vbs sets the status of
the message to Processed and will create a reply in the message database (Saying Thank you
for the workflow).
The other scripts will not be triggered, because WorkFlow.vb has set the status to Processed.
If the senders number does not match +4400000001, +4400000002 or +4400000003, the
server will check if the string Product can be matched against the message body. If so, it will
call ProductInfo.vbs. If not, it will call UnknownMessage.vbs.
CPU
Memory
Service Pack
Available
Diskspace
Windows NT4
Server
486DX/33
96 MB
SP5 or higher
5 MB
Windows 2000
Server
P133 or higher
128 MB or more
SP1 or higher
5 MB
Windows XP
Professional
P233 or higher
128 MB or more
Not required
5 MB
Windows 2003
Server
P550 or higher
256 MB or more
5 MB
Its recommended to install the software on a Windows Server platform, because server platforms
are optimized for application services.
The InstallShield Installation Wizard will take you through the installation.
ActiveXperts SMS Messaging Server provides free SMPP messaging for a limited number of SMS
messages. You can connect to an ActiveXperts SMPP server and send/receive messages right after
installation, without the need to sign-up with an SMSC center first.
If you want to know about a list of SMPP providers recommended by ActiveXperts Software, click
here.
The following information can be configured for an SMPP Channel:
Enable/Disable Channel You can enable/disable a channel at any time. When a channel is
disabled, the SMS Messaging Server service will not attempt to send messages through this
channel or receive messages from this channel;
Enable/Disable Send Disable the Send option to allow only receiving through this channel;
Enable/Disable Receive Disable the Receive option to allow only sending through this
channel;
Description A smart description for this channel;
Server Hostname or IP address of the SMPP provider;
Server Port TCP/IP port of the SMPP provider. Default: 2775;
System ID and Password Account and Password used to logon to the SMPP-compliant
SMSC provider.
System Type Only required when the provider offers different protocols. Leave it default
(SMPP) unless required otherwise;
Subscriber ID The Subscriber ID is the actual SMS mobile number associated with the
SMPP subscription. This number cannot be detected by ActiveXperts SMS Messaging Server
(it is not part of the SMPP protocol), and therefore needs to be configured manually for your
own convenience. The Subscriber ID will be used in the Message Database to indicate the
sender (for outgoing SMS messages) or Recipient (for incoming SMS messages);
Address Range All messages on the SMSC with the address range as recipient address will
be forwarded to this channel when the client is bound to the SMSC in receiver or transceiver
model;
Check Interval Specifies how often the SMS Messaging Server should check for new SMS
Messages. Default value: 10 seconds;
Timeout Specifies the number of seconds that SMS Messaging Server should wait for a
response of the SMPP provider during a SMPP session. If a timeout occurs, an operation will
fail immediately. Default value: 3 seconds. Increase this value if the network connection is
slow;
Keep Alive Specifies how long the network connection is allowed to remain idle before the
network connection is disconnected. Leave it default (60 seconds) unless your provider
requests a different Keep Alive value;
SMS Limit The maximum number of outgoing SMS messages allowed per day to prevent a
malfunctioning custom script from sending out many messages;
Large Messages Indicates how large outgoing messages (i.e. messages longer than 160
characters) should be treated. There are three options: Truncate messages larger than 160
characters, send the large message as multi-part message, or dont send the large message at
all (message will fail).
Request Acknowledgement Specifies whether or not an acknowledgement should be
requested after sending an SMS message. If this value is enabled, a message is only
considered as delivered if a positive acknowledgement is received;
6. Message Database
6.1. Introduction
The Message Database contains incoming and outgoing SMS- and e-mail messages. The location of
the messages is indicated by a DSN connection string, defined in the Options of the software. To
see the location of the database:
Start the Manager application;
Open the Configuration Folder and select Options;
Click on the icon next to Message Database.
By default, the Message Database is located in the <INSTALL-DIR>\Msg\ directory and is called
Messages.mdb. It is an MS Access database (MS Access 2000 compatible). You can migrate to an
MS SQL database at any time (see also 6.4: Migrating to MS SQL).
Type
Description
ID
Direction
Auto
Number
Number
Type
Number
Status
Number
ChannelID
Number
MessageReference
Number
Number
LastUpdateSecs
Number
Sender
String
Recipient
String
Subject
String
Body
String
Trace
String
sysLock
Boolean
sysInfo
String
sysHash
String
sysForwarded
Boolean
NOTE:
All of the above fields can be used in a Trigger condition. For example, you can build a
Trigger condition like this one:
Direction=1 AND Type=2 AND ( ChannelID=1001 OR ChannelID=1002 )
Table: Directions
The 'Directions' table contains the following fields:
Property
Type
Description
Direction
Number
Description
String
Description of a direction.
The 'Directions' table is a static table; it contains definitions for each direction. Each direction is
described by a separate record:
Direction
Description
Undefined
In
Out
Table: Status
The 'Status' table contains the following fields:
Property
Type
Description
Status
Number
Description
String
Description of a status.
The 'Status' table is a static table; it contains definitions for each status. Each status is described by
a separate record:
Direction
Description
Undefined
12
255
2
3
10
11
NOTE:
There are two status values that look similar but are slightly different: Sent and
Delivered (ACK received).
Sent means that the message was successfully submitted, but according to the
properties of the Channel no acknowledgement was required.
Table: Type
The 'Type' table contains the following fields:
Property
Type
Description
Type
Number
Description
String
Description of a type.
The 'Type' table is a static table; it contains definitions for each message type. Each Type is
described by a separate record:
Direction
Description
Undefined
SMS
Chapter 7. Troubleshooting
7. Troubleshooting
7.1. Introduction
ActiveXperts SMS Messaging Server is designed with a special thing in mind: let the user have
complete control over the product. This means, that the system must show exactly what it is doing,
why things work, and why things do not work. The following things will help you with that:
ActiveXperts SMS Messaging Server Monitor The Monitor application shows you realtime information about Channels, Message Database and the VBScript engine;
Trace Files Trace files show you detailed information about Channels, Message Database
and VBScript engine, over a long period of time.
7.3. Tracing
The ActiveXperts SMS Messaging Server Monitor provides tracing for the following items:
Every single channel;
Message database;
VBScript engine.
Chapter 7. Troubleshooting
To enable tracing for a particular channel or thread, you must enable it through the registry, by
assigning a Log File to it:
Open a registry editor (REGEDIT.EXE or REGEDT32.EXE);
Open the HKLM\Software\ActiveXperts\SMS Messaging Server\Trace key;
Open the key of the item that you want to trace, and specify a valid trace filename;
Restart the Service.
Its important to restart the service after changing one of the Trace items.
NOTE:
Tracing will decrease the performance of the ActiveXperts SMS Messaging Server
service. So, just use tracing for troubleshooting purposes, and make sure you turn-off
the trace file(s) by assigning an empty string to the LogFile value in the Trace keys.
8. Performance Tuning
8.1. Introduction
ActiveXperts SMS Messaging Server can be tuned to improve performance.
When we talk about performance, we mean: the performance of the ActiveXperts SMS Messaging
Server service. This service is doing the actual job of managing the Message Database, controlling
the Channels and executing the Triggers.
ActiveXperts SMS Messaging Service has different sub-processes (so called threads). Each thread
is running as a separate process.
Constant
Description
MESSAGETYPE_SMS
MESSAGETYPE_UNDEFINED
MESSAGEDIRECTION_IN
MESSAGEDIRECTION_OUT
MESSAGEDIRECTION_UNDEFINED
MESSAGESTATUS_IN_NOTPROCESSED
MESSAGESTATUS_IN_PROCESSED
MESSAGESTATUS_IN_PROCESSINGFAILURE
MESSAGESTATUS_OUT_ACKEXP
MESSAGESTATUS_OUT_ACKRECEIVED
MESSAGESTATUS_OUT_DELIVEREDWAITING
MESSAGESTATUS_OUT_GENERICFAILURE
MESSAGESTATUS_OUT_NACK
MESSAGESTATUS_OUT_NOACKREQ
MESSAGESTATUS_OUT_PENDING
MESSAGESTATUS_OUT_SCHEDULED
MESSAGESTATUS_OUT_UNDEFINED
Example:
' Sample: print some constants
Set objConstants = CreateObject( "AxSmsServer.Constants" )
WScript.Echo objConstants.MESSAGEDIRECTION_IN
WScript.Echo objConstants.MESSAGEDIRECTION_OUT
WScript.Echo objConstants.MESSAGESTATUS_IN_NOTPROCESSED
Type
R/W
Description
LastError
Number
Functions:
Function
Parameters
Description
Count
Filter (String)
Create
None
Condition (String)
Load
Message-ID (Number)
FindFirstMessage
Condition (String)
FindNextMessage
None
GetDirectionDescription
GetStatusDescription
Direction-code
(Number)
Status-code (Number)
GetTypeDescription
Type (Number)
Sample:
' Sample: count all incoming messages in the message database
Set colMessages = CreateObject( "AxSmsServer.Messages" )
Set objConstants = CreateObject( "AxSmsServer.Constants" )
n = colMessages.Count( "Direction = " & objConstants. objConstants.MESSAGEDIRECTION_OUT )
If( colMessages.LastError = 0 ) Then
WScript.Echo "#Records: " & r
End If
Sample:
' Sample: create new outgoing SMS message
Set objConstants = CreateObject( "AxSmsServer.Constants" )
Set colMessages = CreateObject( "AxSmsServer.Messages" )
Set objMessage
= colMessages.Create
If( colMessages.LastError <> 0 ) Then
WScript.Echo "Create failed, error: " & colMessages.LastError
Exit Function
End If
WScript.Echo "Message successfully created, recordID: " & objMessage.ID
objMessage.Direction
objMessage.Type
objMessage.Status
objMessage.ChannelID
=
=
=
=
objConstants.MESSAGEDIRECTION_OUT
objConstants.MESSAGETYPE_EMAIL
objConstants.MESSAGESTATUS_OUT_SCHEDULED
0 ' Any avaialbe SMS channel
objMessage.Recipient
objMessage.Body
= "+31624896641"
= "Hello, world!"
colMessages.Save objMessage
WScript.Echo "Save, result: " & colMessages.LastError
Type
R/W
Description
Number
RW
Direction
Number
RW
Type
Number
RW
Status
Number
RW
ChannelID
Number
RW
MessageReference
Number
RW
ScheduleTimeSecs
Number
RW
ScheduleTime
String
RW
LastUpdateSecs
Number
RW
Sender
String
RW
Recipient
String
RW
Subject
String
RW
Body
String
RW
LastError
Number
Functions:
None.
Type
R/W
Description
ID
Number
LicenseKey
String
RW
LicenseActivation
String
RW
LogEnabled
Boolean
RW
LogUseDatabase
Boolean
RW
LogFileName
String
RW
String
RW
LogFileMaxMB
Number
RW
LogDbConnectionString
String
RW
LogDbConnectionPasswo
rd
DirTemp
String
RW
String
RW
DirMessageQueue
String
RW
MsgDbConnectionString
String
RW
DailySMSLimit
Number
RW
MaxPendingTime
Number
RW
LastError
Number
Functions:
Function
Parameter(s)
Description
Load
Record-ID (Number)
Save
None
Save options
Example:
Set objOptions = CreateObject( "AxSmsServer.Options" )
objOptions.Load( numID )
If( objOptions.LastError <> 0 ) Then
WScript.Echo "Failed to load Options record, error: " & objOptions.LastError
Else
WScript.Echo "ID: " & objOptions.ID
WScript.Echo "MaxPendingTime: " & objOptions.MaxPendingTime
objOptions.MaxPendingTime = 24
objOptions.Save
WScript.Echo "Save, result: " & objOptions.LastError
End If
Type
R/W
Description
LastError
Number
Function
Parameters
Description
FindFirstGsmModem
Filter (String)
Functions:
None
FindFirstSmpp
Filter (String)
FindNextSmpp
None
FindFirstPop3
Filter (String)
FindNextPop3
None
FindFirstSmtp
Filter (String)
FindNextSmtp
None
Sample:
' Sample: showing all POP3 channels in the configration database
Option Explicit
Dim colChannels, objChannel
Set colChannels = CreateObject( "AxSmsServer.Channels" )
Set objChannel = colChannels.FindFirstPop3( "" )
While colChannels.LastError = 0
PrintPop3Channel( objChannel )
Set objChannel = colChannels.FindNextPop3
Wend
Sub PrintPop3Channel( objChannel )
WScript.Echo "POP3 CHANNEL, ID: " & objChannel.ID
WScript.Echo " Description: " & objChannel.Description
WScript.Echo " Enabled: " & objChannel.Enabled
' Print any other POP3 Channel property
End Sub
Sample:
' Sample: iterate over all enabled GSM Modem Channels
Option Explicit
Dim colChannels, objChannel
Set colChannels = CreateObject( "AxSmsServer.Channels" )
Set objChannel = colChannels.FindFirstGsmModem( "Enabled <> 0" )
While colChannels.LastError = 0
Set objChannel = colChannels.FindNextGsmModem
Wend
Type
R/W
Description
ID
Number
Description
String
RW
Enabled
Boolean
RW
EnableSend
Boolean
RW
Device
String
RW
DeviceSpeed
Number
RW
PinCode
String
RW
MultiPart
Boolean
RW
DailyLimit
Number
RW
SubscriberID
String
RW
LeaveMessageOnDevice
Boolean
RW
LastError
Number
EnableReceive
Functions:
Function
Parameter(s)
Description
Clear
None
Create
None
Load
ChannelID (Number)
Save
None
Delete
ChannelID (Number)
Example:
' Load a GSM Modem Channel, change some properties and save it
Set objChannel = CreateObject( "AxSmsServer.GsmModemChannel" )
objChannel.Load( 1001 )
WScript.Echo "Load, result: " & objChannel.LastError
If( objChannel.LastError = 0 ) Then
objChannel.Host
= "newhost"
objChannel.Account = "newaccount"
objChannel.Password = "newpassword"
objChannel.Save
WScript.Echo "Save, result: " & objChannel.LastError
End If
Type
R/W
Description
ID
Number
Description
String
RW
Enabled
Boolean
RW
EnableSend
Boolean
RW
Server
String
RW
ServerPort
Number
RW
ServerTimeOut
Number
RW
SystemID
String
RW
SystemPassword
String
RW
SystemType
String
RW
SubscriberID
String
RW
CheckInterval
Number
RW
ServerKeepAlive
Number
RW
MultiPart
Boolean
RW
RequestAckAfterSend
Boolean
RW
AckTimeOut
Number
RW
DailyLimit
Number
RW
LastError
Number
EnableReceive
Functions:
Function
Parameter(s)
Description
Clear
None
Create
None
Load
ChannelID (Number)
Save
None
Delete
ChannelID (Number)
configuration database
Remove a SMPP Modem Channel from the
configuration database
Example:
' Load an SMPP Channel, change some properties and save it
Set objChannel = CreateObject( "AxSmsServer.SmppChannel" )
objChannel.Load( 1001 )
WScript.Echo "Load, result: " & objChannel.LastError
If( objChannel.LastError = 0 ) Then
objChannel.System
= "smpp.activexperts-labs.com"
objChannel.SystemPort
= 2775
objChannel.SystemID
= "testuser"
objChannel.SystemPassword = "123abc"
objChannel.Save
WScript.Echo "Save, result: " & objChannel.LastError
End If
Type
R/W
Description
ID
Number
Description
String
RW
Enabled
Boolean
RW
Host
String
RW
Accounts
String
RW
CheckInterval
Number
RW
LeaveMessageOnServer
Boolean
RW
MaxMessageSizeKB
Number
RW
LastError
Number
Functions:
Function
Parameter(s)
Description
Clear
None
Create
None
Load
ChannelID (Number)
Save
None
ChannelID (Number)
Example:
' Load a POP3 Channel, change some properties and save it
Set objChannel = CreateObject( "AxSmsServer.Pop3Channel" )
objChannel.Load( 3001 )
WScript.Echo "Load, result: " & objChannel.LastError
If( objChannel.LastError = 0 ) Then
objChannel.Host
= "pop3.myserver.com"
objChannel.Save
WScript.Echo "Save, result: " & objChannel.LastError
End If
Type
R/W
Description
ID
Number
Description
String
RW
Enabled
Boolean
RW
Host
String
RW
UseLogin
Boolean
RW
Account
String
RW
Password
String
RW
FromName
String
RW
FromAddress
String
RW
MaxMessageSizeKB
Number
RW
LastError
Number
Functions:
Function
Parameter(s)
Description
Clear
None
Create
None
Load
ChannelID (Number)
Save
None
Delete
ChannelID (Number)
Example:
Type
R/W
Description
LastError
Number
Functions:
Function
Parameters
Description
FindFirstTrigger
Filter (String)
FindNextTrigger
None
Create
None
Sample:
' Sample: list all triggers; then, create a new trigger
Option Explicit
Option Explicit
Dim colScripts, objScript
Set colScripts = CreateObject( "AxSmsServer.Triggers" )
Set objScript = colScripts.FindFirstTrigger( "" )
While colTriggers.LastError = 0
PrintTrigger( objTrigger )
Set objTrigger = colTriggers.FindNextTrigger
Wend
Set objScript = colScripts.Create()
objScript.Description = "My new trigger"
...
WScript.Echo "Ready."
' /////////////////////////////////////////////////////////////////////////////////////
Type
R/W
Description
ID
Number
Description
String
RW
Enabled
Boolean
RW
ProcessingOrder
Number
RW
Condition
String
RW
LastError
Number
Functions:
Function
Parameter(s)
Description
Clear
None
Load
TriggerID (Number)
Save
None
Delete
ChannelID (Number)
Example:
' Load a Trigger, change some properties and save it
Set objTrigger = CreateObject( "AxSmsServer.Trigger" )
objTrigger.Load( 1 ) ' Load Trigger 1
WScript.Echo "Load, result: " & objTrigger.LastError
If(objTrigger.LastError = 0 ) Then
objTrigger.Description = "new description"
objTrigger.LastError
9.13. Samples
ActiveXperts SMS Messaging Server includes various samples that show how to use the API.
To browse through the samples, click on the SMS Messaging Server API icon in the Tools and
Utilities map of the Manager application. Here, you will find API samples to access the
Configuration Database and the Message Database.
In the <INSTALL-DIR>ASP Folder, you will find an ASP web application with full source code.
The ASP code is based in the SMS Messaging Server API.