ActiveXperts SMS and MMS Toolkit
Manual


© 1999-2008 - ActiveXperts Software B.V.
www.activexperts.com

Table of Contents

PART I: GETTING STARTED
1. Introduction
2. System requirements
3. Installation

PART II: SMS
4. SMS messaging with SMS and MMS Toolkit
5. SMS constants
6. SmsMessage object
7. SmsProtocolGsm object
8. SmsProtocolHttp object
9. SmsProtocolSmpp object
10. SmsProtocolDialup object
11. SmsData objects (WAP, ringtones, picture messages, vCards, MMS notifications)
12. SmsDeliveryStatus Object

PART III: PAGING
13. Pager messaging with SMS and MMS Toolkit
14. PagerMessage object
15. PagerProtocolSnpp object

PART IV: MMS
16. MMS messaging with SMS and MMS Toolkit
17. MMS constants
18. MmsMessage and MmsSlide objects
19. MmsProtocolMm1 object
20. MmsProtocolMm4 object
21. MmsProtocolMm7 object

PART V: Support, Licensing
22. Support
23. Purchase and product activation

APPENDIX
   Appendix A: License Agreement



1. Introduction

1.1. What is the ActiveXperts SMS and MMS Toolkit?

Adding SMS, MMS and Pager capabilities to an application is not a simple matter. It requires specialized knowledge that might be outside an individual programmer's expertise. Today, Windows developers rely upon the power, flexibility and reliability of the SMS and MMS Toolkit by ActiveXperts Software.

SMS and MMS Toolkit is an ActiveX/COM component, and provides SMS, MMS and Pager messaging functionality.

With this Toolkit, you can send and receive SMS messages via a:
With this Toolkit, you can also send MMS messages via an:
With this Toolkit, you can also send pager messages via a:
SMS and MMS Toolkit can be used by any of the following operating systems:

SMS and MMS Toolkit can be used by any of the following development languages:

1.2. SMS and MMS Toolkit features

SMS features:

MMS features:

Pager features:

Generic:

1.3. SMS and MMS Toolkit Architecture

SMS and MMS Toolkit is built on top of the Microsoft serial device drivers and TAPI drivers. It does NOT replace any Windows drivers during installation; it neither adds any files or components to the Windows or Windows System directory.

The core of SMS and MMS Toolkit consists of one file:

The component encapsulates the following SMS objects:
The component encapsulates the following Pager objects:
The component encapsulates the following MMS objects:
SMS and MMS Toolkit can be distributed easily to many PC's. Once you have purchased the licenses, you copy the AXmsCtrl.dll to the PCs and register the DLL on that PC. Click here for more information about the installation.



2. System requirements

2.1. ASP .NET, VB .NET, VC# .NET, ASP, VB, Visual C++ and more

The SMS and MMS Toolkit can be used by any of the following programming languages:

2.2. .NET Framework

To use SMS and MMS Toolkit in an ASP .NET, Visual Basic .NET or Visual C#. NET environment, the .NET Framework must be installed on the system. The .NET Framework is part of Windows Server 2008, Windows Server 2003 and Windows XP SP1. On Windows 2000 and Windows XP (no SP), it's available as a separate installation. Please visit the Technology Information for the .NET Framework page to download the .NET Framework.

2.3. Internet Information Server

Internet Information Server (IIS) Setup installs the Visual Basic Script and Java Script engines.

To run server-side ASP pages, IIS 6.x or higher must be installed. IIS is part of the Windows XP Professional and Windows 2008/Vista/2003/2000/ Operating Systems. IIS is NOT supported on Windows XP Home.

2.4. Internet Explorer 6.x or higher

The Internet Explorer 6.x Setup (or higher) installs the Visual Basic Script and Java Script engines.
You can use the SMS and MMS Toolkit component from client HTML browser using Javascript.

2.5. Windows Scripting Host

SMS and MMS Toolkit can be used in VBScript scripts. VBScripts can be used by passing the script-file as a parameter to the scripting host ( either 'cscript' or 'wscript').
WSH relies on the Visual Basic Script and Java Script engines provided with Internet Explorer 4.x or later. WSH is also installed as part of Windows 98, Windows 2000/2003, Windows XP and Internet Information Services 4.0 or higher. A separate setup program is provided for Windows 95.

2.6. Visual Basic

SMS and MMS Toolkit can be used in Visual Basic 5.x or higher.

2.7. Visual C++

SMS and MMS Toolkit can be used in Visual C++ 5.x or higher.

2.8. Delphi

SMS and MMS Toolkit can be used in Borland Delphi 6.x or higher.



3. Installation

The SMS and MMS Toolkit package consists of 4 components; any combination of components can be installed:

3.1. Automatic Installation

Simply run the AXMSTOOL.EXE Setup program; you can download this Setup file here.
The InstallShield wizard will guide you through the rest of the setup.
The Setup program can will installation and registration of the ActiveX/COM component automatically.

Any subsequent installation of SMS and MMS Toolkit can be performed either manually or by using the Automatic Installation.

3.2. Manual installation

To install the ActiveX/COM component manually, simply perform the following tasks:



4. SMS Messaging with SMS and MMS Toolkit

4.1. Introduction

With ActiveXperts SMS and MMS Toolkit, you can send and receive SMS messages via a GSM/GPRS modem, GSM/GPRS phone, SMS/HTTP provider, SMPP provider or Hayes compatible modem. You can send/receive not only plain text messages, but also multi-part messages, Unicode SMS messages and SMS data messages including WAP Push, WAP Bookmark, ringtones and picture messages. The following code snippets (VBScript) illustrate how to use various SMS and MMS Toolkit objects for sending/receiving SMS messages.


Send a text SMS message via GSM/GPRS Modem

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

    objSmsMessage.Recipient  = "+31624896641"                                  ' Set recipient's mobile number
    objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

    objGsmProtocol.Device    = "MultiTech GSM MultiModem"                      ' Use MultiTech's Windows Telephony device 
    objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code
    objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message now
    WScript.Echo "Result: " & objGsmProtocol.LastError

Send a text SMS message via HTTP

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
   
    objSmsMessage.Recipient  = "+31624896641"                                  ' Set recipient's mobile number
    objSmsMessage.Sender     = "+31638740160"                                  ' Set sender   
    objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

    ' Provider Settings
    objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Set host
    objHttpProtocol.ProviderPort = 8080                                        ' Set port (default port:80)
      
    ' Provider Response templates
    objHttpProtocol.ProviderErrorResponse = "ERR"                              ' Response should NOT contain 'ERR'
    objHttpProtocol.ProviderSuccessResponse = "id"                             ' Response should contain 'id'
   
    ' URL Template to submit plain text SMS messages
    objHttpProtocol.URLText  = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=" & _
                               "%MESSAGERECIPIENT%&from=%MESSAGESENDER%"   
      
    objHttpProtocol.Send( objSmsMessage )                                      ' Send the message   
    WScript.Echo "Send, result:" & objHttpProtocol.LastError                   ' Display the result  
    WScript.Echo "Provider response:" & objHttpProtocol.ProviderResponse       ' Display provider response

Send a text SMS message via SMPP

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
    objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' Set SMPP server (hostname or IP address)
    objSmppProtocol.ServerPort =  2775                                         ' Set TCP/IP port of the SMPP server
    objSmppProtocol.SystemID = "AX005"                                         ' Set SMPP server login
    objSmppProtocol.SystemPassword = "812056"                                  ' Set SMPP server password
    objSmppProtocol.Connect
    If objSmppProtocol.IsConnected = True Then
      objSmsMessage.Recipient= "+31647134225"                                  ' Set recipient's mobile number
      objSmsMessage.Data     = "Hello World via SMPP"                          ' Set SMS message text
      objSmppProtocol.Send( objSmsMessage )                                    ' Send the message
      objSmppProtocol.Disconnect                                               ' Disconnect
    End If
    WScript.Echo "Result: " & objSmppProtocol.LastError

Send a text SMS message via Dial-up provider

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objDialupProtocol    = CreateObject( "ActiveXperts.SmsProtocolDialup" )' Create SmsProtocolDialup instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
 
    objSmsMessage.Recipient  = "0624896641"                                    ' Set recipient's mobile number
    objSmsMessage.Sender     = "0638740160"                                    ' Set message sender   
    objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

    objDialupProtocol.Device = "Standard 1200 bps Modem"                 
    objDialupProtocol.DeviceSpeed = 1200                                       ' Provider-dependent; 0 for default (TAP 1200, UCP 2400)
    objDialupProtocol.DeviceSettings = objSmsConstants.asDEVICESETTINGS_8N1    ' Provider-dependent; here we use 8 data bits,
                                                                               ' no parity, 1 stop-bit
    objDialupProtocol.ProviderDialString = "+31653141414"                      ' Provider's dial-in number
    objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP        ' UCP or TAP
    objDialupProtocol.Send ( objSmsMessage )                     
    WScript.Echo "Result: " & objDialupProtocol.LastError

Receive a text SMS message through GSM/GPRS Modem

    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

    objGsmProtocol.Device    = "MultiTech GSM MultiModem"
    objGsmProtocol.EnterPin ( "1234" )                                         ' SIM card's PIN code

    objGsmProtocol.MessageStorage = objSmsConstants.asSTORAGE_ALL              ' Set memory to all available storage locations 
    objGsmProtocol.Receive()                                                   ' Receive all messages from all memory locations 
    
    If( objGsmProtocol.LastError <> 0 ) Then 
      WScript.Echo "Failed to receive, error: " & objGsmProtocol.LastError
      WScript.Quit
    End If

    Set objSmsMessage        = objGsmProtocol.GetFirstMessage()                ' Get first message
    
    While ( objGsmProtocol.LastError = 0 ) 
      WScript.Echo "Message from: " & objSmsMessage.Sender                     ' Show sender's mobile number
      wScript.Echo "Message : "     & objSmsMessage.Data                       ' Show the SMS message text
      Set objSmsMessage      = objGsmProtocol.GetNextMessage()                 ' Get next message
    Wend

Send a Unicode SMS message via GSM/GPRS Modem

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

    objSmsMessage.Recipient  = "+31624896641"                                  ' Recipient's mobile number
    objSmsMessage.Format     = objSmsConstants.asMESSAGFORMAT_UNICODE          ' SMS message format
    objSmsMessage.Data       = "ملحق خاصملحق خاص"                              ' SMS message text

    objGsmProtocol.Device    = "MultiTech GSM MultiModem"   
    objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code
    objGsmProtocol.Send ( objSmsMessage )                                      ' Send the SMS message now
    WScript.Echo "Result: " & objGsmProtocol.LastError

Send a Ringtone message via GSM/GPRS Modem

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
    Set objRingTone          = CreateObject( "ActiveXperts.SmsDataRingtone" )  ' Create SmsDataRingtone instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
 
    objRingtone.LoadRTTTL( "Muppets:d=4,o=5,b=250:c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,8a,8p,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,8e," & _
                           "8p,8e,g,2p,c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,a,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,d,8d,c" )
    objRingtone.Encode                                                         ' Encode the message
    If( objRingtone.LastError <> 0 ) Then
       WScript.Echo "Error encoding ringtone: " & objRingtone.LastError
       WScript.Quit
    End If
 
    objSmsMessage.Data       = objRingtone.EncodedMessage                      ' Assign encoded data to the message
    objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
    objSmsMessage.Recipient  = "+31647134225"

    objGsmProtocol.Device    = "COM1"

    objGsmProtocol.Send( objSmsMessage )                                       ' Send the ringtone
    If ( objGsmProtocol.LastError <> 0 ) Then
       WScript.Echo ( "Error " & objGsmProtocol.LastError & " : " & objGsmProtocol.GetErrorDescription ( objGsmProtocol.LastError ) )
       WScript.Quit
    End If
    
    WScript.Echo "Message successfully submitted."

Send a WAP Push message (via SMPP)

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
    Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
    
    objWapPush.URL           = "http://wap.yahoo.com"                          ' Push wap.yahoo.com
    objWapPush.Description   = "Go visit yahoo.com !"                          ' Friendly push text   
    objWapPush.Encode                                                          ' Encode the WAP data

    objSmsMessage.Recipient  = "+31647134225"                                  ' Recipient's mobile number
    objSmsMessage.Data       = objWapPush.EncodedMessage                       ' Assign encoded data to the message
    objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

    objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' SMPP server (hostname or IP address)
    objSmppProtocol.ServerPort =  2775                                         ' TCP/IP port of the SMPP server
    objSmppProtocol.SystemID = "myaccount"                                     ' SMPP server login
    objSmppProtocol.SystemPassword = "mypassword"                              ' SMPP server password
    objSmppProtocol.Connect
    If objSmppProtocol.IsConnected = True Then
      objSmppProtocol.Send( objSmsMessage )                                    ' Send WAP message
      objSmppProtocol.Disconnect                                               ' Disconnect
    End If

Send a Voicemail indication (via GSM Modem / GSM phone)

    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
    
    objSmsMessage.Recipient  = "+31624896641"                                  ' Recipient's mobile number
    objSmsMessage.Data       = "5"                                             ' Indication for 5 new voicemail messages 
    objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_INDICATION_VOICEMAIL  ' Voicemail indication 
    
    objGsmProtocol.Device    = "MultiTech GSM MultiModem"
    
    objGsmProtocol.Send( objSmsMessage )                                       ' Send the voicemail indication now
    WScript.Echo "Result: " & objGsmProtocol.LastError

4.2. SMS Hardware requirements

SmsProtocolGsm requirements: GSM/GPRS modem or GSM phone with datacable/bluetooth

This is a fast and reliable device to send and receive SMS messages.
You can send plain text SMS messages, unicode messages, ringtones and other advanced SMS messages using a GSM modem.

To send/receive SMS messages using a GSM modem, use the SmsProtocolGsm object.
ActiveXperts recommends Falcom SAMBA GSM modems, WaveCom GSM modems and MultiTech GSM modems. For more information, click here.


SmsProtocolSmpp requirements: Internet connection / VPN tunnel.

Customers requiring a high throughput should deliver SMS messsages over a network connection to a remote SMPP-compliant SMSC provider. The SMPP ('Short Message Peer-to-Peer') protocol is a Layer-7 TCP/IP protocol for exchanging SMS messages between SMS peer entities such as short message service centres. It is often used to allow third parties (e.g. content suppliers like news organisations) to submit SMS messages, often in bulk.
To send SMS messages using an SMPP-compliant provider and SMS and MMS Toolkit, use the SmsProtocolSmpp object.

You can use the free ActiveXperts SMPP Demo server (smpp.activexperts-labs.com) to send and receive a limited number of SMPP messages (for testing only). For daily use, you need to sign-up with a commercial SMPP-compliant SMSC provider.

For a list of SMPP providers that have been tested with ActiveXperts SMS and MMS Toolkit, click here: www.activexperts.com/xmstoolkit/smpplist.


SmsProtocolHttp requirements: Internet connection / VPN tunnel.

With the easy-to-configure HTTP interface you can send SMS messages directly from your business applications or websites in minutes. All you need is a subscription with a commercial HTTP- compliant SMS provider, and an internet connection. To send SMS messages using an HTTP-compliant provider and SMS and MMS Toolkit, use the SmsProtocolHttp object.

You can use the free ActiveXperts SMSHTTP gateway (post.activexperts-labs.com:8080) to send and receive a limited number of SMS/HTTP messages (for testing only). For daily use, you need to sign-up with a commercial HTTP-compliant SMS provider.


SmsProtocolDialup requirements: Hayes compatible modems (1200 bps or higher)

Use SMS and MMS Toolkit connect your normal Hayes modem (1200 bps or higher) to an SMSC service provider and send out SMS messages, one-by-one.
There are many SMSC dial-in provider around the world. Most of them do not require sign-up. You pay per dial-up call. For a complete list of SMSC dial-in providers around the world, click here.

You can only send plain text messages with a normal modem; to send ringtones, data, unicode and other advanced SMS format, you should use a GSM Modem (or GSM phone with modem functions). You cannot receive SMS messages using a normal Hayes modem.


To use a normal Hayes modem to connect to an SMSC dial-in provider with SMS and MMS Toolkit, use the SmsProtocolDialup object.



4.2. Visual Basic .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual Basic Solution Explorer:

You can create a new SmsMessage object in the following way:
    Imports AXmsCtrl
    ...
    Dim objSmsMessage As SmsMessage  = New SmsMessage() 
You can create a new SmsConstants object in the following way:
    Imports AXmsCtrl
    ...
    Dim objSmsConstants As SmsConstants  = New SmsConstants() 
If you use a GSM modem (or GSM phone) to send and/or receive SMS messages, create a new SmsProtocolGsm object in the following way:
    Imports AXmsCtrl
    ...
    Dim objGsmProtocol As SmsProtocolGsm   = New SmsProtocolGsm() 
If you use an HTTP-compliant SMSC provider to deliver SMS messages, create a new SmsProtocolHttp object in the following way:
    Imports AXmsCtrl
    ...
    Dim objHttpProtocol As SmsProtocolHttp = New SmsProtocolHttp()
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
    Imports AXmsCtrl
    ...
    Dim objSmppProtocol As SmsProtocolSmpp = New SmsProtocolSmpp()
If you use a normal modem to connect to an SMSC dial-in provider, create a newSmsProtocolDialup object in the following way:
    Imports AXmsCtrl
    ...
    Dim objDialupProtocol As SmsProtocolDialup = New SmsProtocolDialup()
If you want to use advanced SMS data objects, you can create a newSmsDataWapPush, SmsDataWapBookmark, SmsDatavCard, SmsDataRingtone, SmsDataPicture or SmsDataMmsNotification object in the following way:
    Imports AXmsCtrl
    ...
    Dim objWapPush As SmsDataWapPush = New SmsDataWapPush()
    Dim objWapBookmark As SmsDataWapBookmark = New SmsDataWapBookmark()
    Dim objCard As SmsDatavCard = new SmsDatavCard()
    Dim objRingtone As SmsDataRingtone = New SmsDataRingtone()
    Dim objPictureMessage As SmsDataPicture = New SmsDataPicture()
    Dim objNotification As SmsDataMmsNotification = New SmsDataMmsNotification()
After these declarations and creation of the object(s), you can use the objects in your Visual Basic .NET projects.

4.3. Visual C# .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual C# Solution Explorer:

You can create a new SmsMessage object in the following way:
    using AXmsCtrl;
    ...
    SmsMessage objSmsMessage = new SmsMessage();         
You can create a new SmsConstants object in the following way:
    using AXmsCtrl;
    ...
    SmsConstants objSmsConstants = new SmsConstants();         
If you use a GSM modem (or GSM phone) to send SMS messages, declare and create a new SmsProtocolGsm object in the following way:
    using AXmsCtrl;
    ...
    SmsProtocolGsm objGsmProtocol = new SmsProtocolGsm();
If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:
   using AXmsCtrl;
   ...
   SmsProtocolHttp objHttpProtocol = new SmsProtocolHttp();
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
    using AXmsCtrl;
    ...
    SmsProtocolSmpp objSmppProtocol = new SmsProtocolSmpp();
If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object in the following way:
    using AXmsCtrl;
    ...
    SmsProtocolDialup objDialupProtocol = new SmsProtocolDialup();

If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDatavCard, SmsDataRingtone, SmsDataPicture or SmsDataMmsNotification object in the following way:
   using AXmsCtrl;
   ...
   SmsDataWapPush objWapPush = new SmsDataWapPush(); 
   SmsDataWapBookmark objWapBookmark = new SmsDataWapBookmark();
   SmsDatavCard objCard = new SmsDatavCard();
   SmsDataRingtone objRingtone = new SmsDataRingtone();
   SmsDataPicture objPictureMessage = new SmsDataPicture();
   SmsDataMmsNotification objNotification = new SmsDataMmsNotification();

After these declarations and creation of the object(s), you can use the objects inside your Visual C# .NET code.

4.4. Visual Basic

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual Basic 5.x or higher. In Visual Basic, go to the 'Project/References...' menu item and check the box next to 'ActiveXperts SMS and MMS Toolkit' Type Library. Now, you can declare and create SMS objects.


You can create a new SmsMessage object in the following way:
    Dim objSmsMessage As AXmsCtrl.SmsMessage                            
    Set objSmsMessage = CreateObject( "ActiveXperts.SmsMessage" ) 
You can create a new SmsConstants object in the following way:
    Dim objSmsConstants As AXmsCtrl.SmsConstants                            
    Set objSmsConstants = CreateObject( "ActiveXperts.SmsConstants" ) 
If you use a GSM modem (or GSM phone) to send SMS messages, create a new SmsProtocolGsm object using the 'CreateObject' function:
    Dim objGsmProtocol As AXmsCtrl.SmsProtocolGsm           
    Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:
    Dim objHttpProtocol As AXmsCtrl.SmsProtocolHttp             
    Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )  
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
    Dim objSmppProtocol As AXmsCtrl.SmsProtocolSmpp                          
    Set objSmppProtocol = CreateObject( "ActiveXperts.SmsProtocolSmpp" )     
If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object using the 'CreateObject' function:
    Dim objDialupProtocol As AXmsCtrl.SmsProtocolDialup                     
    Set objDialupProtocol = CreateObject( "ActiveXperts.SmsProtocolDialup" ) 
If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDatavCard, SmsDataRingtone, SmsDataPicture or SmsDataMmsNotification object in the following way:
    Dim objWapPush As AXmsCtrl.SmsDataWapPush                              
    Set objWapPush = CreateObject( "ActiveXperts.SmsDataWapPush" )         

    Dim objWapBookmark As AXmsCtrl.SmsDataWapBookmark                      
    Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" ) 
    
    Dim objCard As AXmsCtrl.SmsDatavCard
    Set objCard = CreateObject ( "ActiveXperts.SmsDatavCard" )

    Dim objRingtone As AXmsCtrl.SmsDataRingtone   
    Set objRingtone = CreateObject( "ActiveXperts.SmsDataRingtone" )

    Dim objPictureMessage As AXmsCtrl.SmsDataPicture        
    Set objPictureMessage = CreateObject( "ActiveXperts.SmsDataPicture" ) 

   Dim objNotification As AXmsCtrl.SmsDataMmsNotification                      
   Set objNotification = CreateObject( "ActiveXperts.SmsDataMmsNotification" ) 
After these declarations and creation of the object(s), you can use the objects in your Visual Basic projects.

4.5. Visual C++

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual C++ projects. Include the *.h and *.c file provided by ActiveXperts to bind your code to the SMS component. These files are located in the Include directory of the Visual C++ samples directory. These are the files:
You can create a new SmsMessage object in the following way:
    ISmsMessage              *pSmsMessage;                         
    CoCreateInstance(CLSID_SmsMessage, NULL, CLSCTX_INPROC_SERVER, IID_ISmsMessage, (void**) &pSmsMessage); 
If you use a GSM modem (or GSM phone) to send and/or receive SMS messages, declare and create a new SmsProtocolGsm object in the following way:
    ISmsProtocolGsm          *pGsmProtocol;                         
    CoCreateInstance(CLSID_SmsProtocolGsm, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolGsm, (void**) &pGsmProtocol);               
If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:
   ISmsProtocolHttp          *pHttpProtocol;                    
   CoCreateInstance(CLSID_SmsProtocolHttp, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolHttp, (void**) &pHttpProtocol); 
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
   ISmsProtocolSmpp          *pSmppProtocol;                           
   CoCreateInstance(CLSID_Smpp, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolSmpp, (void**) &pSmppProtocol);  
If you use a normal modem to connect to an SMSC dial-in provider, declare and create a new SmsProtocolDialup object in the following way:
way:
   ISmsProtocolDialup        *pDialupProtocol;                      
   CoCreateInstance(CLSID_SmsProtocolDialup, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolDialup, (void**) &pDialupProtocol);
To format SMS messages as WAP Push or WAP Bookmark messages, you can create a new SmsDataWapPush or SmsDataWapBookmark object in the following way:
   ISmsDataWapPush           *pObjWapPush;                        
   CoCreateInstance(CLSID_SmsDataWapPush, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataWapPush, (void**) &pObjWapPush);              

   IWapBookmark              *pObjWapBookmark;                     
   CoCreateInstance(CLSID_SmsDataWapBookmark, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataWapBookmark, (void**) &pObjWapBookmark);  
To format SMS messages as vCard, you can create a new SmsDatavCard object in the following way:
   ISmsDatavCard           *pObjCard;                        
   CoCreateInstance(CLSID_SmsDatavCard, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDatavCard, (void**) &pObjCard);              
If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDataRingtone, SmsDataPicture or SmsDataMmsNotification object in the following way:
   ISmsDataRingtone          *pObjRingtone;                        
   CoCreateInstance(CLSID_SmsDataRingtone, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataRingtone, (void**) &pObjRingtone);        

   ISmsDataPictureMessage    *pObjPictureMessage;                
   CoCreateInstance(CLSID_SmsDataPicture, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataPicture, (void**) &pObjPictureMessage);
To format SMS messages as MMS notification messages, you can create a new SmsDataMmsNotification object in the following way:
   ISmsDataMmsNotification   *pNotification;       
   CoCreateInstance(CLSID_SmsDataMmsNotification, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataMmsNotification, (void**) &pObjNotification); 

4.6. Delphi 6.x or higher

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

First, add a reference to the SMS and MMS Toolkit objects:

You can create a new SmsMessage object in the following way:
    SmsMessage    :  TSmsMessage;                                    ' Declaration of the wrapper class
    objSmsMessage :  ISmsMessage;                                    ' Declaration of the interface class
    objSmsMessage := SmsMessage.DefaultInterface;                    ' Creation new instance of the object
You can create a new SmsConstants object in the following way:
    SmsConstants    :  TSmsConstants;                                ' Declaration of the wrapper class
    objSmsConstants :  ISmsConstants;                                ' Declaration of the interface class
    objSmsConstants := SmsConstants.DefaultInterface;                ' Creation new instance of the object
If you use a GSM modem (or GSM phone) to send SMS messages, create a new SmsProtocolGsm object in the following way:
    SmsProtocolGsm :  TSmsProtocolGsm;                               ' Declaration of the wrapper class
    objGsmProtocol :  ISmsProtocolGsm;                               ' Declaration of the interface class
    objGsmProtocol := SmsProtocolGsm.DefaultInterface;               ' Creation new instance of the object
If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:
    SmsProtocolHttp :  TSmsProtocolHttp;                             ' Declaration of the wrapper class
    objHttpProtocol :  ISmsProtocolHttp;                             ' Declaration of the interface class
    objHttpProtocol := SmsProtocolHttp.DefaultInterface;             ' Creation new instance of the object
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
    SmsProtocolSmpp :  TSmsProtocolSmpp;                             ' Declaration of the wrapper class
    objSmppProtocol :  ISmsProtocolSmpp;                             ' Declaration of the interface class
    objSmppProtocol := SmsProtocolSmpp.DefaultInterface;             ' Creation new instance of the object
If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object in the following way:
    SmsProtocolDialup :  TSmsProtocolDialup;                         ' Declaration of the wrapper class
    objDialupProtocol :  ISmsProtocolDialup;                         ' Declaration of the interface class
    objDialupProtocol := SmsProtocolDialup.DefaultInterface;         ' Creation new instance of the object
If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDataRingtone, SmsDataPicture or SmsDataMmsNotification object in the following way:
    SmsDataWapPush :  TSmsDataWapPush;                               ' Declaration of the wrapper class
    objWapPush     :  ISmsDataWapPush;                               ' Declaration of the interface class
    objWapPush     := SmsDataWapPush.DefaultInterface;               ' Creation new instance of the object

    SmsDataWapBookmark :  TSmsDataWapBookmark;                       ' Declaration of the wrapper class
    objWapBookmark     :  ISmsDataWapBookmark;                       ' Declaration of the interface class
    objWapBookmark     := SmsDataWapBookmark.DefaultInterface;       ' Creation new instance of the object

	SmsDatavCard       :  TSmsDatavCard;                             ' Declaration of the wrapper class
	objCard            :  ISmsDatavCard;                             ' Declaration of the interface class
	objCard            := SmsDatavCard.DefaultInterface;             ' Creation new instance of the object
	
    SmsDataRingtone    :  TSmsDataRingtone;                          ' Declaration of the wrapper class
    objRingtone        :  ISmsDataRingtone;                          ' Declaration of the interface class
    objRingtone        := SmsDataRingtone.DefaultInterface;          ' Creation new instance of the object

    SmsDataPicture     : TSmsDataPicture;                            ' Declaration of the wrapper class
    objPictureMessage  : ISmsDataPicture;                            ' Declaration of the interface class
    objPictureMessage  := SmsDataPicture.DefaultInterface;           ' Creation new instance of the object

    SmsDataMmsNotification : TSmsDataMmsNotification;                ' Declaration of the wrapper class
    objNotification    : ISmsDataMmsNotification;                    ' Declaration of the interface class
    objNotification    := SmsDataMmsNotification.DefaultInterface;   ' Creation new instance of the object

After these declarations and creation of the object(s), you can use the objects in your Delphi projects.

4.7. ASP 2.x environment

Simply create the objects in the following way:
  <html>
  <body>
  Version:
  <script language=vbscript runat=server>
    Set objSmsConstants    = CreateObject( "ActiveXperts.SmsConstants" )
    Set objSmsMessage      = CreateObject( "ActiveXperts.SmsMessage" )
    Set objGsmProtocol     = CreateObject( "ActiveXperts.SmsProtocolGsm" )
    Set objHttpProtocol    = CreateObject( "ActiveXperts.SmsProtocolHttp" )
    Set objSmppProtocol    = CreateObject( "ActiveXperts.SmsProtocolSmpp" )
    Set objDialupProtocol  = CreateObject( "ActiveXperts.SmsProtocolDialup" )
    Set objWapPush         = CreateObject( "ActiveXperts.SmsDataWapPush" )
    Set objWapBookmark     = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
    Set objPictureMessage  = CreateObject( "ActiveXperts.SmsDataPicture" )
    Set objRingtone        = CreateObject( "ActiveXperts.SmsDataRingtone" )
    Set objCard            = CreateObject( "ActiveXperts.SmsDatavCard" )
    ...
    Set objMmsConstants    = CreateObject( "ActiveXperts.MmsConstants" )
    Set objMmsMessage      = CreateObject( "ActiveXperts.MmsMessage" )
    Set objMm1Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm1" )
    Set objMm4Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm4" )
    Set objMm7Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm7" )
    ...
    Response.Write objGsmProtocol.Version
    ...
  </script>
  </body>
  </html>



5. SMS Constants

In SMS and MMS Toolkit, all SMS constants are grouped together in a separate object called SmsConstants. You must first create the SmsConstants object before you can actually use the constant:
   Set objSmsConstants = CreateObject( "ActiveXperts.SmsConstants" )
   WScript.Echo objSmsConstants.asDIALMODE_TONE
   WScript.Echo objSmsConstants.asDIALMODE_PULSE
   ...
 
5.1. SMS Message Formats

Name Description
asMESSAGEFORMAT_TEXT Standard Text message (GSM)
asMESSAGEFORMAT_TEXT_FLASH Standard Text message, immediate display
asMESSAGEFORMAT_TEXT_MULTIPART Standard Text message, multipart
asMESSAGEFORMAT_TEXT_MULTIPART_FLASH Standard Text message, multipart, immediate display
asMESSAGEFORMAT_DATA Data message (raw 8 bit data)
asMESSAGEFORMAT_DATA_UDH Data message with User Data Header ( ringtones, logo's, ... )
asMESSAGEFORMAT_UNICODE Unicode Message (UCS2)
asMESSAGEFORMAT_UNICODE_FLASH Unicode Message, immediate display
asMESSAGEFORMAT_UNICODE_MULTIPART Unicode Message, multipartimmediate display
asMESSAGEFORMAT_UNICODE_MULTIPART_FLASH Unicode Message, multipart, flash

 
5.2. GSM Storage Types

Name Description
asSTORAGE_ALL Use all available memory storage locations (default)
asSTORAGE_SIM Use SIM Memory
asSTORAGE_DEVICE Use Device Memory
asSTORAGE_COMBINED Use SIM and device memory
asSTORAGE_REPORTS Use special Reports memory of the device. Only advanced GSM modems have such a Reports memory

 
5.3. SMPP Versions

Name Description
asSMPPVERSION_33 v 3.3
asSMPPVERSION_34 v 3.4
asSMPPVERSION_50 v 5.0

 
5.4. SMPP Modes

Name Description
asSMPPMODE_TRANSCEIVER SMPP in send/receive mode (only supported for SMMP 3.4 and higher)
asSMPPMODE_TRANSMITTER SMPP in send-only mode
asSMPPMODE_RECEIVER SMPP in receive-only mode

 
5.5. SMPP Character Sets

Name Description
asSMPPCHARSET_DEFAULT Use SMSC (provider) default charset
asSMPPCHARSET_GSM Use GSM charset
asSMPPCHARSET_ASCII Use ASCII charset
asSMPPCHARSET_LATIN Use ISO8859-1 charset
asSMPPCHARSET_JIS Use JIS charset
asSMPPCHARSET_CYRILLIC Use Cyrillic charset
asSMPPCHARSET_HEBREW Use Hebrew charset
asSMPPCHARSET_JAPANESE Use Japanase (iso_2022) charset
asSMPPCHARSET_GREEK Use Greek (iso_8859_7) charset

 
5.6. SMPP Modes

Name Description
asSMPPDELIVERYREPORTFORMAT_HEX The deliveryreport contains the messagereference in hexadecimal format.
asSMPPDELIVERYREPORTFORMAT_DEC The deliveryreport contains the messagereference in decimal format.

 
5.7. SMS Delivery Status codes

Name Description
asDELIVERYSTATUS_SCHEDULED Scheduled
asDELIVERYSTATUS_ENROUTE Enroute
asDELIVERYSTATUS_DELIVERED Delivered
asDELIVERYSTATUS_EXPIRED Expired
asDELIVERYSTATUS_DELETED Deleted
asDELIVERYSTATUS_UNDELIVERABLE Undeliverable
asDELIVERYSTATUS_ACCEPTED Accepted
asDELIVERYSTATUS_UNKNOWN Unknown
asDELIVERYSTATUS_REJECTED Rejected
asDELIVERYSTATUS_SKIPPED Skipped
asDELIVERYSTATUS_SUBMITTED Submitted

 
5.8. SMS WAP Push Constants

Name Description
asWAPPUSHSIGNAL_NONE A WAP Push message without an alert
asWAPPUSHSIGNAL_LOW Priority of the WAP Push message (Low)
asWAPPUSHSIGNAL_MEDIUM Priority of the WAP Push message (Medium)
asWAPPUSHSIGNAL_HIGH Priority of the WAP Push message (High)
asWAPPUSHSIGNAL_DELETE Delete a WAP Push message

Name Description
asWAPPUSH_SERVICE_INDICATION A Service Indication WAP Push message
asWAPPUSH_SERVICE_LOAD A Service Load WAP Push Message

Name Description
asWAPPUSH_ACTION_EXECUTE_LOW Execute with user intervention
asWAPPUSH_ACTION_EXECUTE_HIGH Execute without user intervention
asWAPPUSH_ACTION_CACHE Cache URL for faster loading

 
5.9. SMS Dialup Provider Type

Name Description
asPROVIDER_TYPE_UCP UCP compliant SMS/Paging service provider
asPROVIDER_TYPE_TAP_DEFAULT Standard TAP provider
asPROVIDER_TYPE_TAP_NOLF TAP provider, no request for LineFeed
asPROVIDER_TYPE_TAP_NOEOT TAP provider, no request for EOT

 
5.10. SMS Dial Mode

Name Description
asDIALMODE_TONE Use tone dialing (DTMF)
asDIALMODE_PULSE Use pulse dialing

 
5.11. SMS Device Settings

Name Description
asDEVICESETTINGS_DEFAULT Use default settings. In case of a Windows telephony, the settings are inherited. In case of a direct COM port, it used 8 data bits, no parity and 1 stop bit
asDEVICESETTINGS_8N1 8 data bits, no parity, 1 stop bit
asDEVICESETTINGS_7E1 7 data bits, even parity, 1 stop bit

 
5.12. Modem Flow Control Settings

Name Description
asFLOWCONTROL_DEFAULT Use default settings (defined through the Windows Control Panel)
asFLOWCONTROL_DISABLE Disable flow control
asFLOWCONTROL_ENABLE Enable flow control

 
5.13. SmsDataPicture constants

Name Description
asPICTURE_MESSAGE Bitmap
asPICTURE_CALLERGROUP Caller Line Identification Icon
asPICTURE_OPERATORLOGO Operator Logo
asPICTURE_OPERATORLOGO_RESTORE Remove Operator Logo ISmsDataPicture Interface

 
5.14. SmsDataMmsNotification constants

Name Description
asMMS_CLASS_PERSONAL Personal
asMMS_CLASS_ADVERTISEMENT Commercial
asMMS_CLASS_INFORMATIONAL Informational
asMMS_CLASS_AUTO Auto

 
5.15. TLV constants

Name Description
asSMPP_TLV_1BYTE 1 Byte TLV Value
asSMPP_TLV_2BYTE 2 Byte TLV Value
asSMPP_TLV_4BYTE 4 Byte TLV Value
asSMPP_TLV_COCTET Zero terminated TLV Value
asSMPP_TLV_OCTET Data TLV Value



6. SmsMessage Object

6.1. SmsMessage Object - Introduction

The SmsMessage object includes all properties of an SMS message. It is used for incoming- and outgoing SMS messaging, and is used by all SMS protocol objects:
You can send and receive different types of SMS messages:

Create a new SMS message

The following sample shows how to create a new SMS message so it can be sent through one of the available SMS protocols:
    Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage object

    objSmsMessage.Recipient  = "+4412345678"                                   ' Set recipient's mobile number 
    objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text 
    objSmsMessage.RequestDeliveryStatus = False                                ' Set delivery report request
    objSmsMessage.ValidityPeriod = 0                                           ' Set GSM operator's retry time

6.2. SmsMessage Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Sender String In/Out O SMS number of the sender
Recipient String In/Out M SMS number of the recipient
Format Number In/Out O Message format (like: plain text, unicode, etc.)
Data String In/Out O Message body. Either plain text characters, or binary data
ValidityPeriod Number In/Out O Retry time (in minutes)
RequestDeliveryStatus Boolean In/Out O Request a delivery report, to ensure delivery
TimeSecs Number Out n/a Time that the message was received
Time String Out n/a Time (formatted string) that the message was received

Advanced Property Type In/Out Mand/Opt Description
SMSC String Out n/a SMSC number of the sending provider (in case SMS was sent by an SMSC provider, incoming SMS message only)
ServiceType String In/Out O Some providers require that you set the type of SMS application for each message
PID Number Out n/a The 'protocol_id' parameter (incoming SMPP SMS message only)
DCS Number Out n/a The 'data_coding' parameter (incoming SMPP SMS message only)
ESM Number Out n/a The 'esm_class' parameter (incoming SMPP SMS message only)
SourceTON Number In/Out O SMPP client's TON (Type Of Number) (outgoing SMPP SMS messages only)
SourceNPI Number In/Out O SMPP client's NPI (Numbering Plan Indicator) (outgoing SMPP SMS messages only)
DestinationTON Number In/Out O SMPP server's TON (Type Of Number) (outgoing SMPP SMS messages only)
DestinationNPI Number In/Out O SMPP server's NPI (Numbering Plan Indicator) (outgoing SMPP SMS messages only)

Function Description
Clear Clear all properties

6.3. SmsMessage Object - Properties


 Sender property

Type:
String
Applies to:
All SMS protocols
Description:
The Sender address (incoming messages only)
Example:
    
    Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
    ...
    objSmppProtocol.Connect()
    ...
    Set objSmsMessage        = objSmppProtocol.GetFirstMessage
    While ( objSmppProtocol.LastError = 0 )
      WScript.Echo "Message received, sender: & objSmsMessage.Sender
      ...
      Set objSmsMessage      = objSmppProtocol.GetNextMessage
    WEnd
    ...
    objSmppProtocol.Disconnect()

 Recipient property

Type:
String
Applies to:
All SMS protocols
Description:
The Recipient address, which means: the SMS number of the person that should receive the message. The length of the field must be between 4 and 20 digits.
Two SMS number formats are supported:
  • International number format - The SMS number, prefixed by the international dialing number and the '+' character. The use of the '+' character is required. For example: +4412345678

  • Special service format - To send messages to special services etc., you can use the following prefixes:
    • S : Use a shortcut number (most often a short number provider by the operator), use the S prefix. For instance: S5511
    • N : Force the toolkit to use a national number format, you must prefix the number with an N prefix. For instance: N1234567
    • G : Network specific number
    • A : Abbreviated number
To send a message to a specific application or port on the remote mobile phone, you can add a port to the recipient number.
Use the following format:
    <+mobilenumber>:<port>
For instance, to send a message to an application that is listening on port 1234 on user's mobile phone +31624896641, set the Recipient property as follows:
    objSmsMessage.Recipient = "+31624896641:1234" Application ports can only be used for plain text messages and Unicode messages (single- and multipart).
Example:
    
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    objSmsMessage.Recipient  = "+4412345678"                                   ' Set recipient to UK number 12345678
    objSmsMessage.Data       = "Hello, world!"
    objGsmProtocol.Send( objSmsMessage )

 Format property

Type:
Number
Applies to:
All SMS protocols
Description:
An SMS message can have different types, like: plain text, flash, unicode and more. The 'Format' property indicates the type of data that is stored in the Data property, which will be sent out by the Send function.
You can assign the following values to the 'Format' property:
Example: Send a ringtone SMS
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
    Set objRingTone          = CreateObject( "ActiveXperts.SmsDataRingtone" )  ' Create SmsDataRingtone instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance
 
    objRingtone.LoadRTTTL( "Muppets:d=4,o=5,b=250:c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,8a,8p,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,8e," & _
                           "8p,8e,g,2p,c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,a,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,d,8d,c" )
    objRingtone.Encode                                                         ' Encode the message
    objSmsMessage.Data       = objRingtone.EncodedMessage                      ' Assign encoded data to the message
    objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
    objSmsMessage.Recipient  = "+31647134225"

    objGsmProtocol.Device    = "COM1"
    objGsmProtocol.Send( objSmsMessage )

 Data property

Type:
String
Applies to:
All SMS protocols
Description:
The actual message data. Depending on the Format property, the data contains of plain text characters or binary data.
Example: Send a plain text SMS
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

    objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text
    objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_TEXT   
    objSmsMessage.Recipient  = "+31624896641"                   

    objGsmProtocol.Device    = "Nokia 6310i GSM"               
    objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

 ValidityPeriod property

Type:
Number
Applies to:
Gsm
Smpp
Description:
Specifies the preferred retry time, in minutes. Only applies to outgoing GSM- and SMPP SMS messages. The retry time is used by the GSM/SMPP operator. When a message cannot be delivered to the recipient (for instance because the remote GSM phone is switched off), the operator will try to resend the message for a maximum of 'ValidityPeriod' minutes. After that, the message fails.
If 0 (default value) is specified, the default retry time of the operator is used.
Example:
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

    objSmsMessage.Data       = "Hello, world!"                                 
    objSmsMessage.Recipient  = "+31624896641"                   
    objSmsMessage.ValidityPeriod = 10                                          ' When message fails, operator will retry for 
                                                                               ' a maximum of 10 minutes
    objGsmProtocol.Device    = "Nokia 6310i GSM"               
    objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

 RequestDeliveryStatus property

Type:
Boolean
Applies to:
Gsm
Smpp
Description:
Set the property if you wish to receive status report info from the mobile operator.
A status report can be used to verify the delivery of an SMS message. By default, 'RequestDeliveryStatus' is disabled because it is not supported by all GSM modems.

If the property is enabled, use the SmsProtocolGsm::QueryStatus or SmsProtocolSmpp::QueryStatus function to query for status report information.
Example:
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
    ...
    objSmsMessage.RequestDeliveryStatus = True
    objSmsMessage.Recipient  = "+4412345678"
    strMessageReference = objGsmProtocol.Send( objSmsMessage )
    If( objGsmProtocol.LastError <> 0 ) Then
      WScript.Quit
    End If

    WScript.Echo "MessageReference of last sent message: " & strMessageReference
    WScript.Sleep 60000                                                        ' Wait for 60 secs to allow operator to 
                                                                               ' deliver the message
    Set objStatusDelivery    = objGsmProtocol.QueryStatus(strMessageReference) ' Query the status of the message
    If( objGsmProtocol.LastError = 0 ) Then
      WScript.Echo "Status: " & objStatusDelivery.Status
      WScript.Echo "Status Description: " & objStatusDelivery.StatusDescription
    End If

 Time,
 TimeSeconds properties


Type:
String, Number
Applies to:
Gsm
Smpp
Description:
'Time' and 'TimeSeconds' indicate the time the SMS message was received. Both properties only apply to incoming GSM- and SMPP SMS messages. 'TimeSeconds' is formatted as a number, and indicates the number of seconds from 1/1/1970; 'Time' formats this number as a friendly string.
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
    ...
    objGsmProtocol.Receive()
    If( objGsmProtocol.LastError = 0 ) Then
      Set objSmsMessage      = objGsmProtocol.GetFirstMessage()
      While( objGsmProtocol.LastError = 0 ) Then
        WScript.Echo "Received Message at: " & objSmsMessage.Time & " - " & objSmsMessage.TimeSecs
        Set objSmsMessage    = objGsmProtocol.GetNextMessage()
      WEnd
    End If

 SMSC property

Type:
String
Applies to:
Gsm
Smpp
Description:
Indicates the number of the provider that sent the message (only applies to messages that were sent through an SMSC provider). Only applies to incoming SMS messages via GSM or SMPP.
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    ...
    objGsmProtocol.Receive()
    If( objGsmProtocol.LastError = 0 ) Then
      Set objSmsMessage      = objGsmProtocol.GetFirstMessage()
      While( objGsmProtocol.LastError = 0 ) Then
        WScript.Echo "SMSC: " & objSmsMessage.SMSC
        Set objSmsMessage    = objGsmProtocol.GetNextMessage()
      WEnd
    End If

 ServiceType property

Type:
String
Applies to:
Gsm
Smpp
Description:
Some providers require that you set the type of SMS application for each message. By default, this property is an empty string.
You can assign the following values to the 'ServiceType' property:
  • "" - Empty string (default)
  • "CMT" - Cellular Messaging
  • "CPT" - Cellular Paging
  • "VMN" - Voice Mail Notification
  • "VMA" - Voice Mail Alerting
  • "WAP" - Wireless Application Protocol
  • "USSD" - Unstructured Supplementary Services Data
  • "CBS" - Cell Broadcast Service
  • "GUTS" - Generic UDP Transport Service
Example:
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
    objSmppProtocol.Server   = "..."
    objSmppProtocol.SystemID = "login"
    objSmppProtocol.SystemPassword = "password
    objSmppProtocol.SystemType = "..."
    objSmppProtocol.Connect()
    If objSmppProtocol.IsConnected = True Then
      objSmsMessage.ServiceType = "CMT"                                        ' Cellular Messaging
      objSmsMessage.Recipient = "+31624896641"                          
      objSmppProtocol.Send( objSmsMessage )                                    ' Send
      objSmppProtocol.Disconnect()                                             
    End If

 PID,
 DCS,
 ESM properties


Type:
Number
Applies to:
Smpp
Description:
The 'PID', 'DCS' and 'ESM' properties apply to incoming SMS messages received via the SMPP protocol.
'PID' represents the SMPP 'protocol_id' parameter; 'DCS' represents the SMPP 'data_coding' parameter; 'ESM' represents the SMPP 'esm_class' parameter.
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    ...
    objSmppProtocol.Receive()
    If( objSmppProtocol.LastError = 0 ) Then
      Set objSmsMessage      = objSmppProtocol.GetFirstMessage()
      While( objSmppProtocol.LastErrror = 0 ) Then
        WScript.Echo "PID: " & objSmsMessage.PID
        WScript.Echo "DCS: " & objSmsMessage.DCS
        WScript.Echo "ESM: " & objSmsMessage.ESM
        Set objSmsMessage    = objSmppProtocol.GetNextMessage()
      WEnd
    End If

 SourceTON,
 SourceNPI,
 DestinationTON,
 DestinationNPI properties


Type:
Number
Applies to:
Smpp
Description:
The 'SourceTON', 'SourceNPI', 'DestinationTON' and 'DestinationNPI' properties apply to outgoing SMPP SMS messages. 'SourceTON' and 'SourceTON' (Type of Numbering) indicate the type of SMS numbers to use during an SMPP session. If you use '0', the connection (session) value is used. Valid numbers are:
  • 0 - Default;
  • 1 - International;
  • 2 - National;
  • 3 - Network Specific;
  • 4 - Subscriber Number;
  • 5 - Alphanumeric;
  • 6 - Abbreviated.

'DestinationNPI' and 'DestinationNPI' (Numbering Plan Indicator) indicate which numbering plan to use during an SMPP session. If you use '0', the connection (session) value is used. Valid numbers are:
  • 0 - Default;
  • 1 - Telephone/ISDN (E163/E164);
  • 3 - Data (X.121);
  • 4 - Telex (F.69) ;
  • 6 - Land Mobile (E.212);
  • 8 - National;
  • 9 - Private.

Example:
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    ...
    ...
    objSmsMessage.SourceTON  = 1
    objSmsMessage.DestinationNPI = 1
    objSmsMessage.Recipient  = "+4412345678"
    strMessageReference = objSmppProtocol.Send( objSmsMessage )

6.4. SmsMessage Object - Functions


 Clear function

Description:
This function resets all Properties to the initial, default values.
Parameters:
  • None
Return value:
Always 0.
Example:
    Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
    ...
    objSmsMessage.Recipient  = "+4412345678"
    objSmsMessage.Clear()
    ...



7. SmsProtocolGsm Object

7.1. SmsProtocolGsm Object - Introduction

The SmsProtocolGsm object enables sending and receiving of SMS messages using a GSM Modem or a modem-capable GSM phone.

The SmsProtocolGsm object communicates through a serial port, USB port, Bluetooth connection, infrared port or any Windows telephony compliant device.
It is recommended to use Windows 'Phone and Modem' devices, for example 'Standard 9600 bps Modem', or 'Nokia 6310i Phone'.
If a Windows telephony device is used, settings are controlled by the Windows telephony driver, and can be configured through the 'Phone and Modem' settings:
To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:
Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be setup properly before receiving messages:
You can send different types of SMS messages:
For more information about recommended GSM Modems, click here.
For a list of GSM phones tested with SMS and MMS Toolkit, click here.


Send a simple SMS message (via GSM Modem / GSM phone)

The following sample shows how to send an SMS message using a GSM modem (or modem-capable GSM phone):
    Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage instance
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

    objSmsMessage.Recipient  = "+4412345678"                                   ' Recipient's mobile number 
    objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text 
    objSmsMessage.RequestDeliveryStatus = False                                ' No request for status report
    objSmsMessage.ValidityPeriod = 0                                           ' Use GSM operator's default retry time

    objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
    objGsmProtocol.EnterPin ( "1234" )                                         ' SIM card's PIN code 
    objGsmProtocol.Send( objSmsMessage )

    If objGsmProtocol.LastError = 0 Then
      WScript.Echo "Message successfully delivered."
    Else
      WScript.Echo "Error: " & objGsmProtocol.LastError
    End If
NOTE: As an alternative, "Nokia 6310i Modem" can be replaced by "COM1", assuming that the Nokia phone is connected on COM1. However, the use of Windows telephony devices is recommended.


Receive SMS messages using a GSM device

The following sample shows how to receive SMS messages via a GSM modem (or modem-capable GSM phone):
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    Set objConstants         = CreateObject( "ActiveXperts.SmsConstants" )

    objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
    objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code 
    
    objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from all available storage locations 

    numMessages = objGsmProtocol.Receive()
    If ( objGsmProtocol.LastError <> 0 ) Then 
     WScript.Quit
    End If

    For i = 0 to numMessages - 1
      On Error Resume Next
      Set objSmsMessage        = objGsmProtocol.GetMessage ( i )               ' Iterate over all received messages 
      On Error Goto 0
    
      If( objGsmProtocol.LastError = 0 ) Then
        WScript.Echo "Message from: " & objSmsMessage.Sender
        WScript.Echo "  " & objSmsMessage.Data
      End If
    Next
    
    objGsmProtocol.DeleteAllMessages ()                                        ' Delete messages from phone or modem 


7.2. SmsProtocolGsm Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Version String Out n/a Product version number
ExpirationDate String Out n/a Product expiration date
Device String In/Out M Name of the device you want to use for receiving the SMS messages
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceFlowControl Number In/Out O Hardware flow control
DeviceInitString String In/Out O Initialization string for the device
MessageStorage Number In/Out O Preferred message storage
ReportsStorage Number In/Out O Preferred report storage
SMSC String In/Out O Preferred SMSC centre
LastError Number Out n/a Result of the last called function
LogFile String In/Out O All GSM commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
GetDeviceCount Return the number of Windows telephony devices installed on the local computer
GetDevice Retrieve a Windows telephony device name
EnterPin Enter pincode (required if SIM card is pin protected)
Send Send an SMS message
SendCommand Send a special command to the GSM device and read the response
QueryStatus Query message status
Receive Read all SMS messages from device storage
GetMessage Get the message at a specified index
DeleteMessage Delete the message at a specified index
DeleteAllMessages Delete all SMS messages
GetErrorDescription Lookup error description of the given error code

7.3. SmsProtocolGsm Object - Properties


 Version property

Type:
String
Description:
Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Example:
    Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
    WScript.Echo "Version: " & objGsmProtocol.Version

 ExpirationDate property

Type:
String
Description:
Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Once you have registered the product, the property holds the empty string value.
Example:
    Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
    WScript.Echo "ExpirationDate: " & objGsmProtocol.ExpirationDate

 Device property

Type:
String
Description:
The preferred device for sending and receiving SMS messages.
You can either use a Windows telephony device (recommended) or a physical COM port (directly).

Assign one of the following strings to the 'Device' property:
  • A valid Windows telephony device name - this must be the literal name as it appears in Modems tab of the Phone and Modems Options applet in the Control Panel. For instance: "Standard 9600 bps Modem";
    Use the GetDevice function to iterate over the installed Windows telephony devices;
  • A valid COM port string, formatted as COMx, where x is a valid COM port number. When you assign the 'Device' property with a COM port string, you bypass all Windows telephony intelligence, like dialing rules, port sharing and so on.
Windows telephony devices are highly recommended.
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    objGsmProtocol.Device    = "Standard 19200 bps Modem"                      ' Use a Windows telephony device (recommended)
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    objGsmProtocol.Device    = "COM2"                                          ' Use a COM port directly

 DeviceSpeed property

Type:
Number
Description:
By default, the speed settings are inherited from the Windows telephony device, or (in case a direct COM port is used) the default COM settings are used.
The default speed will usually suffice. Use 0 to use the default baudrate, or you any valid baudrate value like: 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, etc.
Example:
    Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
    objGsmProtocol.Device    = "Standard 19200 bps Modem"
    objGsmProtocol.DeviceSpeed = 4800                                          ' This will overwrite the Windows telephony device speed

 DeviceFlowControl property

Type:
Number
Description:
Hardware flow control regulates communication between computer and device (usually a modem). There are two signals on the port for hardware flow control: DTR (Data Terminal Ready) and RTS (Request To Send). If you enable hardware flow control, computer and device will use both physical signals for flow control. It's very uncommon to change these values for modem communications. The 'DeviceFlowControl' will be ignored if the Device is a Windows telephony device, because flow control is already defined in the Windows telephony device properties (in the Windows Control Panel).
If a Windows telephony device is used (for instance: "Standard 19200 bps modem"), the 'DeviceFlowControl' property will be ignored because it is configured through the Control Panel.
For a list of flowcontrol values, click here.
Example:
    Set objGsmProtocol      = CreateObject("ActiveXperts.SmsPro