ActiveXperts SMS and Pager Toolkit
Manual


© 1999-2007 - ActiveXperts Software B.V.
http://www.activexperts.com
info@activexperts.com




Table of Contents

1. Introduction
2. System Requirements
3. Installation
4. How to use the SMS and Pager Toolkit objects
5. Error Codes and Constants
6. GsmOut Object
7. GsmIn Object
8. HttpPost Object
9. Smpp Object
10. DialUp object
11. Snpp object
12. Pager object
13. WapPush and WapBookmark objects
14. Ringtone and PictureMessage objects
15. MMS notification object
16. Samples
17. Troubleshooting
18. Purchase and Product Activation
   
Appendix A: License Agreement



1. Introduction

1.1. What is the ActiveXperts SMS and Pager Toolkit?

Adding SMS 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 Pager Toolkit by ActiveXperts Software.

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

With this Toolkit, you can send and receive SMS messages via a:
With this Toolkit, you can also send pager messages via a:
SMS and Pager Toolkit features the following:

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

1.2. Hardware Requirements

SMS and Pager Toolkit supports the following hardware:


1.3. SMS and Pager Toolkit Architecture

SMS and Pager 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 Pager Toolkit consists of one file:
The component encapsulates the following objects:
SMS and Pager Toolkit can be distributed easily to many PC's. Once you have purchased the licenses, you copy the ASmsCtrl.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 Pager Toolkit can be used in any of these languages:

2.2. .NET Framework

To use SMS and Pager 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 the Windows 2003 Operating System. On Windows 2000, Windows 98, Windows ME, Windows NT, Windows Server 2003, Windows XP, 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 ASP pages on NT4 Servers, IIS 4.x must be installed. IIS 4.x ships with the NT4 Option Pack CD's.
To run ASP pages on Windows XP Professional and Windows 2000/2003 Servers, IIS 5.x or higher must be installed. IIS is part of the Windows XP Professional and Windows 2000/2003 Operating Systems. IIS is NOT supported on Windows XP Home and Windows 98/ME.

2.4. Internet Explorer 4.x or higher

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

2.5. Windows Scripting Host

SMS and Pager 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 Pager Toolkit can be used in Visual Basic 5.x or higher.

2.7. Visual C++

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

2.8. Delphi

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



3. Installation

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

3.1. Automatic Installation

Simply run the ASMSTOOL.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 Pager 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. How to use the SMS and Pager Toolkit objects

4.1. Introduction

The following code snippets (VBScript) illustrate how to use various SMS and Pager Toolkit objects.


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

    Set objGsmOut                = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device             = "MultiTech GSM MultiModem"         ' Use MultiTech's Windows Telephony device 
    objGsmOut.MessageRecipient   = "+31624896641"                     ' Recipient's mobile number
    objGsmOut.MessageData        = "Hello, world!"                    ' SMS message text
    objGsmOut.EnterPin ( "1234" )                                     ' SIM card's PIN code
    objGsmOut.Send                                                    ' Send the SMS message now
    WScript.Echo "Result: " & objGsmOut.LastError

Send a simple SMS message (via HTTP-POST)

    Set objHttpPost  = CreateObject ( "ActiveXperts.HttpPost" )       ' Create HttpPost instance
    Set objConstants = CreateObject ( "ActiveXperts.SmsConstants" )
   
    ' Provider Settings
    objHttpPost.ProviderHost    = "post.activexperts-labs.com"        ' Specify host
    objHttpPost.ProviderPort    = 8080                                ' Specify port (default port:80)
      
    ' Provider Response templates
    objHttpPost.ProviderErrorResponse       = "ERR"                   ' Response should NOT contain 'ERR'
    objHttpPost.ProviderSuccessResponse     = "id"                    ' Response should contain 'id'
   
    ' URL Template to submit plain text SMS messages
    objHttpPost.URLText         = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=" & _
                                 "%MESSAGERECIPIENT%&from=%MESSAGESENDER%"   
    objHttpPost.MessageType     = objConstants.asMESSAGETYPE_TEXT     ' Message Property: plain text
   
    objHttpPost.MessageData     = "Hello, world"                      ' Message text
    objHttpPost.MessageSender   = "+31638740160"                      ' Message sender   
    objHttpPost.AddRecipient( strRecipient )                          ' Message recipient (you can add multiple recipients)
   
    objHttpPost.Send                                                  ' Send the message   
    WScript.Echo "Send, result:" & objHttpPost.LastError              ' Display the result  
    WScript.Echo "Provider response:" & objHttpPost.ProviderResponse  ' Display provider response

Send a simple SMS message (via SMPP)

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

Send a simple SMS message (via Dial-up provider)

    Set objDialUp    = CreateObject ( "ActiveXperts.DialUp" )
    Set objConstants = CreateObject ( "ActiveXperts.SmsConstants" )
 
    objDialUp.Device             = "Standard 1200 bps Modem"                 
    objDialUp.DeviceSpeed        = 1200                              ' Depends on provider; use 0 for default (TAP 1200, UCP 2400)
    objDialUp.DeviceSettings     = objConstants.asDEVICESETTINGS_8N1 ' Depends on provider; here we use 8 data bits,
                                                                       no parity, 1 stop-bit
    objDialUp.ProviderDialString = "+31653141414"                    ' Provider's dial-in number
    objDialUp.ProviderType       = objConstants.asPROVIDERTYPE_UCP   ' UCP or TAP
    objDialUp.MessageSender      = "0625044454"                      ' Set your own mobile phone number here
    objDialUp.MessageRecipient   = "0647134225"                      ' Recipient's mobile phone number
    objDialUp.MessageData        = "Hello, world"                    ' SMS message text
    objDialUp.Send                     
    WScript.Echo "Result: " & objDialUp.LastError

Receive a simple SMS message (GSM Modem / GSM phone)

    Set objGsmIn                 = CreateObject( "ActiveXperts.GsmIn" )
    objGsmIn.Device              = "MultiTech GSM MultiModem"
    objGsmIn.EnterPin ( "1234" )                                     ' SIM card's PIN code
    objGsmIn.Receive ()                                              ' Receive all messages from SIM or device memory 
    If ( objGsmIn.LastError <> 0 ) Then 
      WScript.Echo "Failed to receive, error: " & objGsmIn.LastError
      WScript.Quit
    End If
    objGsmIn.GetFirstMessage()                                       ' Get first message
    While ( objGsmIn.LastError = 0 ) 
      WScript.Echo "Message from: " & objGsmIn.MessageSender         ' Show sender's mobile number
      wScript.Echo "Message : "     & objGsmIn.MessageData           ' Show the SMS message text
      objGsmIn.GetNextMessage()                                      ' Get next message
    Wend

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

    Set objGsmOut                = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants             = CreateObject( "ActiveXperts.SmsConstants" )
    objGsmOut.Device             = "MultiTech GSM MultiModem"   
    objGsmOut.MessageRecipient   = "+31624896641"                     ' Recipient's mobile number
    objGsmOut.MessageType        = objConstants.asMESSAGTYPE_UNICODE  ' SMS message text
    objGsmOut.MessageData        = "ملحق خاصملحق خاص"                 ' SMS message text
    objGsmOut.EnterPin ( "1234" )                                     ' SIM card's PIN code
    objGsmOut.Send                                                    ' Send the SMS message now
    WScript.Echo "Result: " & objGsmOut.LastError

Send a Ringtone message (via GSM Modem / GSM phone)

    Set objRingTone                = CreateObject ( "ActiveXperts.RingTone" )
    Set objGsmOut                  = CreateObject ( "ActiveXperts.GsmOut" )
    Set objConstants               = CreateObject ( "ActiveXperts.SmsConstants" )
 
    objGsmOut.Device               = "COM1"
    objGsmOut.MessageRecipient     = "+31647134225"
    objGsmOut.MessageType          =  objConstants.asMESSAGETYPE_DATA_UDH
 
    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
    
    If( objRingtone.LastError <> 0 ) Then
       WScript.Echo "Error encoding ringtone: " & objRingtone.LastError
       WScript.Quit
    End If
 
    objGsmOut.MessageData = objRingtone.EncodedMessage
    objGsmOut.MessageType = objConstants.asMESSAGETYPE_DATA_UDH
    objGsmOut.Send
    
    If ( objGsmOut.LastError <> 0 ) Then
       WScript.Echo ( "Error " & objGsmOut.LastError & " : " & objGsmOut.GetErrorDescription ( objGsmOut.LastError ) )
       WScript.Quit
    End If
    
    WScript.Echo "Message successfully submitted."

Send a WAP Push message (via SMPP)

    Set objSmpp                  = CreateObject ( "ActiveXperts.Smpp" )
    Set objWapPush               = CreateObject ( "ActiveXperts.WapPush" )
    
    objSmpp.Server               = "smpp.activexperts-labs.com"       ' SMPP server (hostname or IP address)
    objSmpp.ServerPort           =  2775                              ' TCP/IP port of the SMPP server
    objSmpp.SystemID             = "AX005"                            ' SMPP server login
    objSmpp.SystemPassword       = "812056"                           ' SMPP server password
    objSmpp.Connect
    
    If objSmpp.IsConnected = True Then
      objSmpp.MessageRecipient   = "+31647134225"                     ' Recipient's mobile number
      objSmpp.MessageData        = "Hello World via SMPP"             ' SMS message text
      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
      
      objSmpp.MessageType = objConstants.asMESSAGETYPE_DATA_UDH
      objSmpp.MessageData = objWapPush.EncodedMessage
      objSmpp.Send                                                    ' Send WAP data
      
      objSmpp.Disconnect                                              ' Disconnect
    End If

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

    Set objGsmOut                = CreateObject ( "ActiveXperts.GsmOut" )
    Set objConstants             = CreateObject ( "ActiveXperts.SmsConstants" )
    
    objGsmOut.Device             = "MultiTech GSM MultiModem"
    objGsmOut.MessageRecipient   = "+31624896641"                    ' Recipient's mobile number
    objGsmOut.MessageData        = "5"                               ' Indication for 5 new voicemail messages 
    objGsmOut.MessageType        = objConstants.asMESSAGETYPE_INDICATION_VOICEMAIL  ' Voicemail indication 
    
    objGsmOut.Send                                                   ' Send the voicemail indication now
    WScript.Echo "Result: " & objGsmOut.LastError

4.2. Visual Basic .NET

Make sure the SMS & Pager 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 SmsConstants object in the following way:
  Dim objConstants As ASmsCtrl.SmsConstants             ' Declaration
  objConstants = New ASmsCtrl.SmsConstants()            ' Creation
If you use a GSM modem (or GSM phone) to send SMS messages, create a new GsmOut object in the following way:
  Dim objGsmOut As ASmsCtrl.GsmOut                      ' Declaration
  objGsmOut = New ASmsCtrl.GsmOut()                     ' Creation
If you use a GSM modem (or GSM phone) to receive SMS messages, create a new GsmIn object in the following way:
  Dim objGsmIn As ASmsCtrl.GsmIn                        ' Declaration
  objGsmIn = New ASmsCtrl.GsmIn()                       ' Creation
If you use an HTTP-POST-compliant SMSC provider to deliver messages, create a new HttpPost object in the following way:
  Dim objHttpPost As ASmsCtrl.HttpPost                  ' Declaration
  objHttpPost = New ASmsCtrl.HttpPost()                 ' Creation
If you use an SMPP-compliant SMSC provider to deliver messages, create a new Smpp object in the following way:
  Dim objSmpp As ASmsCtrl.Smpp                          ' Declaration
  objSmpp = New ASmsCtrl.Smpp()                         ' Creation
If you use a normal modem to connect to an SMSC dial-in provider, create a new DialUp object in the following way:
  Dim objDialUp As ASmsCtrl.Dialup                      ' Declaration
  objDialUp = New ASmsCtrl.Dialup()                     ' Creation
If you have a connection to an SNPP provider via the Internet to send alpha-numeric pager messages, create a new Snpp object in the following way:
  Dim objSnpp As ASmsCtrl.Snpp                          ' Declaration
  objSnpp = New ASmsCtrl.Snpp()                         ' Creation
If you use a normal modem to send pager messages, create a new Pager object in the following way:
  Dim objPager As ASmsCtrl.Pager                        ' Declaration
  objPager = New ASmsCtrl.Pager()                       ' Creation
If you want to use WAP Push or WAP Bookmark messages, you can create a new WapPush or WapBookmark object in the following way:
  Dim objWapPush As ASmsCtrl.WapPush                    ' Declaration
  objWapPush = New ASmsCtrl.WapPush()                   ' Creation

  Dim objWapBookmark As ASmsCtrl.WapBookmark            ' Declaration
  objWapBookmark = New ASmsCtrl.WapBookmark()           ' Creation
If you want to use Ringtone messages or Picture messages, you can create a new Ringtone or PictureMessage object in the following way:
  Dim objRingtone As ASmsCtrl.Ringtone                  ' Declaration
  objRingtone = New ASmsCtrl.Ringtone()                 ' Creation

  Dim objPictureMessage As ASmsCtrl.PictureMessage      ' Declaration
  objPictureMessage = New ASmsCtrl.PictureMessage()     ' Creation
If you want to use MMS notification messages, you can create a new MMSNotification object in the following way:
  Dim objNotification As ASmsCtrl.MMSNotification       ' Declaration
  objNotification = New ASmsCtrl.MMSNotification()      ' Creation
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 & Pager 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 SmsConstants object in the following way:
   using ASmsCtrl;
   ...
   SmsConstants objConstants;                           // Declaration
   objConstants = new SmsConstants();                   // Creation
If you use a GSM modem (or GSM phone) to send SMS messages, declare and create a new GsmOut object in the following way:
   using ASmsCtrl;
   ...
   GsmOut objGsmOut;                                    // Declaration
   objGsmOut = new GsmOut();                            // Creation
If you use a GSM modem (or GSM phone) to receive SMS messages, declare and create a new GsmIn object in the following way:
   using ASmsCtrl;
   ...
   GsmIn objGsmIn;                                      // Declaration
   objGsmIn = new GsmIn();                              // Creation
If you use an HTTP-POST-compliant SMSC provider to deliver messages, create a new HttpPost object in the following way:
   using ASmsCtrl;
   ...
   Smpp objHttpPost;                                    // Declaration
   objHttpPost = new HttpPost();                        // Creation
If you use an SMPP-compliant SMSC provider to deliver messages, create a new Smpp object in the following way:
   using ASmsCtrl;
   ...
   Smpp objSmpp;                                        // Declaration
   objSmpp = new Smpp();                                // Creation
If you use a normal modem to connect to an SMSC dial-in provider, create a new DialUp object in the following way:
   using ASmsCtrl;
   ...
   DialUp objDialUp;                                    // Declaration
   objDialUp = new DialUp();                            // Creation

If you have a connection to an SNPP provider via the Internet to send alpha-numeric pager messages, create a new Snpp object in the following way:
   using ASmsCtrl;
   ...
   Snpp objSnpp;                                        // Declaration
   objSnpp = new Snpp();                                // Creation

If you use a normal modem to send out Pager messages, create a new Pager object in the following way:
   using ASmsCtrl;
   ...
   Pager objPager;                                      // Declaration
   objPager = new Pager();                              // Creation

To format SMS messages as WAP Push or WAP Bookmark messages, you can create a new WapPush or WapBookmark object in the following way:
   using ASmsCtrl;
   ...
   WapPush objWapPush;                                  // Declaration
   objWapPush = new WapPush();                          // Creation
   ...
   WapBookmark objWapBookmark;                          // Declaration
   objWapBookmark = new WapBookmark();                  // Creation

To format SMS messages as Ringtone messages or picture messages, you can create a new Ringtone or PictureMessage object in the following way:
   using ASmsCtrl;
   ...
   Ringtone objRingtone;                                // Declaration
   objRingtone = new Ringtone();                        // Creation
   ...
   PictureMessage objPictureMessage;                    // Declaration
   objPictureMessage = new PictureMessage();            // Creation
To format SMS messages as MMS notification messages, you can create a new MMSNotification object in the following way:
   using ASmsCtrl;
   ...
   MMSNotification objNotification;                     // Declaration
   objNotification = new MMSNotification();             // Creation

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 & Pager Toolkit is installed on your system. For details about installation, click here.

SMS and Pager 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 Pager Toolkit' Type Library. Now, you can declare and create SMS objects.


You can create a new SmsConstants object in the following way:
  Dim objConstants As ASmsCtrl.SmsConstants                      ' Declaration              
  Set objConstants = CreateObject( "ActiveXperts.SmsConstants" ) ' Creation
If you use a GSM modem (or GSM phone) to send SMS messages, create a new GsmOut object using the 'CreateObject' function:
  Dim objGsmOut As ASmsCtrl.GsmOut                      ' Declaration              
  Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" ) ' Creation
If you use a GSM modem (or GSM phone) to receive SMS messages, create a new GsmIn object using the 'CreateObject' function:
  Dim objGsmIn As ASmsCtrl.GsmIn                        ' Declaration
  Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )   ' Creation
If you use an HTTP-POST-compliant SMSC provider to deliver messages, create a new HttpPost object in the following way:
  Dim objHttpPost As ASmsCtrl.HttpPost                  ' Declaration
  Set objHttpPost = CreateObject( "ActiveXperts.HttpPost" )  ' Creation
If you use an SMPP-compliant SMSC provider to deliver messages, create a new Smpp object in the following way:
  Dim objSmpp As ASmsCtrl.Smpp                          ' Declaration
  Set objSmpp = CreateObject( "ActiveXperts.Smpp" )     ' Creation
If you use a normal modem to connect to an SMSC dial-in provider, create a new DialUp object using the 'CreateObject' function:
  Dim objDialUp As ASmsCtrl.DialUp                      ' Declaration
  Set objDialUp = CreateObject( "ActiveXperts.DialUp" ) ' Creation
If you have a connection to an SNPP provider via the Internet to send alpha-numeric pager messages, create a new Snpp object in the following way:
  Dim objSnpp As ASmsCtrl.Snpp                          ' Declaration
  Set objSnpp = CreateObject( "ActiveXperts.Snpp" )     ' Creation
If you use a normal modem to send out Pager messages, create a new Pager object in the following way:
  Dim objPager As ASmsCtrl.Pager                        ' Declaration
  Set objPager = CreateObject( "ActiveXperts.Pager" )   ' Creation
To format SMS messages as WAP Push or WAP Bookmark messages, you can create a new WapPush or WapBookmark object in the following way:
  Dim objWapPush As ASmsCtrl.WapPush                              ' Declaration
  Set objWapPush = CreateObject( "ActiveXperts.WapPush" )         ' Creation

  Dim objWapBookmark As ASmsCtrl.WapBookmark                      ' Declaration
  Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" ) ' Creation
To format SMS messages as Ringtone messages or picture messages, you can create a new Ringtone or PictureMessage object in the following way:
  Dim objRingtone As ASmsCtrl.Ringtone                            ' Declaration
  Set objRingtone = CreateObject( "ActiveXperts.Ringtone" )       ' Creation

  Dim objPictureMessage As ASmsCtrl.PictureMessage                      ' Declaration
  Set objPictureMessage = CreateObject( "ActiveXperts.PictureMessage" ) ' Creation
To format SMS messages as MMS notification messages, you can create a new MMSNotification object in the following way:
  Dim objNotification As ASmsCtrl.MMSNotification                      ' Declaration
  Set objNotification = CreateObject( "ActiveXperts.MMSNotification" ) ' Creation
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 & Pager Toolkit is installed on your system. For details about installation, click here.

SMS and Pager 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 SmsConstants object in the following way:
   ISmsConstants *pObjConstants;                           // Declaration
   CoCreateInstance(CLSID_SmsConstants, NULL, CLSCTX_INPROC_SERVER, IID_ISmsConstants, (void**) &pObjSmsConstants); // Creation
If you use a GSM modem (or GSM phone) to send SMS messages, declare and create a new GsmOut object in the following way:
   IGsmOut       *pObjGsmOut;                           // Declaration
   CoCreateInstance(CLSID_GsmOut, NULL, CLSCTX_INPROC_SERVER, IID_IGsmOut, (void**) &pObjGsmOut);                   // Creation
If you use a GSM modem (or GSM phone) to receive SMS messages, declare and create a new GsmOut object in the following way:
   IGsmIn        *pObjGsmIn;                            // Declaration
   CoCreateInstance(CLSID_GsmIn, NULL, CLSCTX_INPROC_SERVER, IID_IGsmIn, (void**) &pObjGsmIn);                      // Creation
If you use an HTTP-POST-compliant SMSC provider to deliver messages, create a new HttpPost object in the following way:
   IHttpPost     *pObjHttpPost;                         // Declaration
   CoCreateInstance(CLSID_HttpPost, NULL, CLSCTX_INPROC_SERVER, IID_IHttpPost, (void**) &pObjHttpPost);             // Creation
If you use an SMPP-compliant SMSC provider to deliver messages, create a new Smpp object in the following way:
   ISmpp         *pObjSmpp;                             // Declaration
   CoCreateInstance(CLSID_Smpp, NULL, CLSCTX_INPROC_SERVER, IID_ISmpp, (void**) &pObjSmpp);                         // Creation
If you use a normal modem to connect to an SMSC dial-in provider, declare and create a new DialUp object in the following way:
way:
   IDialUp       *pObjDialUp;                           // Declaration
   CoCreateInstance(CLSID_DialUp, NULL, CLSCTX_INPROC_SERVER, IID_IDialUp, (void**) &pObjDialUp);                   // Creation
If you use a normal modem to send pager messages, declare and create a new Pager object in the following way:
way:
   IPager        *pObjPager;                            // Declaration
   CoCreateInstance(CLSID_Pager, NULL, CLSCTX_INPROC_SERVER, IID_IPager, (void**) &pObjPager);                      // Creation
If you have a connection to an SNPP provider via the Internet to send alpha-numeric pager messages, create a new Snpp object in the following way:
way:
   ISnpp        *pObjSnpp;                              // Declaration
   CoCreateInstance(CLSID_Snpp, NULL, CLSCTX_INPROC_SERVER, IID_ISnpp, (void**) &pObjSnpp);                         // Creation
To format SMS messages as WAP Push or WAP Bookmark messages, you can create a new WapPush or WapBookmark object in the following way:
   IWapPush      *pObjWapPush;                          // Declaration
   CoCreateInstance(CLSID_WapPush, NULL, CLSCTX_INPROC_SERVER, IID_IWapPush, (void**) &pObjWapPush);                // Creation

   IWapBookmark  *pObjWapBookmark;                      // Declaration
   CoCreateInstance(CLSID_WapBookmark, NULL, CLSCTX_INPROC_SERVER, IID_IWapBookmark, (void**) &pObjWapBookmark);    // Creation
To format SMS messages as Ringtone messages or picture messages, you can create a new Ringtone or PictureMessage object in the following way:
   IRingtone      *pObjRingtone;                        // Declaration
   CoCreateInstance(CLSID_Ringtone, NULL, CLSCTX_INPROC_SERVER, IID_IRingtone, (void**) &pObjRingtone);             // Creation

   IPictureMessage  *pObjPictureMessage;                // Declaration
   CoCreateInstance(CLSID_PictureMessage, NULL, CLSCTX_INPROC_SERVER, IID_IPictureMessage, (void**) &pObjPictureMessage); // Creation
To format SMS messages as MMS notification messages, you can create a new MMSNotification object in the following way:
   IMMSNotification      *pNotification;                 // Declaration
   CoCreateInstance(CLSID_MMSNotification, NULL, CLSCTX_INPROC_SERVER, IID_IMMSNotification, (void**) &pObjNotification); // Creation

4.6. Delphi 6.x or higher

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

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

You can create a new SmsConstants object in the following way:
  SmsConstants : TSmsConstants;                          ' Declaration of the wrapper class
  objConstants : ISmsConstants;                          ' Declaration of the interface class
  objConstants := SmsConstants.DefaultInterface;         ' Creation new instance of the object
If you use a GSM modem (or GSM phone) to send SMS messages, create a new GsmOut object in the following way:
  GsmOut : TGsmOut;                                      ' Declaration of the wrapper class
  objGsmOut : IGsmOut;                                   ' Declaration of the interface class
  objGsmOut := GsmOut.DefaultInterface;                  ' Creation new instance of the object
If you use a GSM modem (or GSM phone) to receive SMS messages, create a new GsmIn object in the following way:
  GsmIn : TGsmIn;                                        ' Declaration of the wrapper class
  objGsmIn : IGsmIn;                                     ' Declaration of the interface class
  objGsmIn := GsmIn.DefaultInterface;                    ' Creation new instance of the object
If you use an HTTP-POST-compliant SMSC provider to deliver messages, create a new HttpPost object in the following way:
  HttpPost : THttpPost;                                  ' Declaration of the wrapper class
  objHttpPost : IHttpPost;                               ' Declaration of the interface class
  objHttpPost := HttpPost.DefaultInterface;              ' Creation new instance of the object
If you use an SMPP-compliant SMSC provider to deliver messages, create a new Smpp object in the following way:
  Smpp : TSmpp;                                          ' Declaration of the wrapper class
  objSmpp : ISmpp;                                       ' Declaration of the interface class
  objSmpp := Smpp.DefaultInterface;                      ' Creation new instance of the object
If you use a normal modem to connect to an SMSC dial-in provider, create a new DialUp object in the following way:
  Dialup : TDialup;                                      ' Declaration of the wrapper class
  objDialup : IDialup;                                   ' Declaration of the interface class
  objDialup:= Dialup.DefaultInterface;                   ' Creation new instance of the object
If you have a connection to an SNPP provider via the Internet to send alpha-numeric pager messages, create a new Snpp object in the following way:
  Snpp : TSnpp;                                          ' Declaration of the wrapper class
  objSnpp : ISnpp;                                       ' Declaration of the interface class
  objSnpp := Snpp.DefaultInterface;                      ' Creation new instance of the object
If you use a normal modem to send pager messages, create a new Pager object in the following way:
  Pager : TPager;                                        ' Declaration of the wrapper class
  objPager : IPager;                                     ' Declaration of the interface class
  objPager := Pager.DefaultInterface;                    ' Creation new instance of the object
If you want to use WAP Push or WAP Bookmark messages, you can create a new WapPush or WapBookmark object in the following way:
  WapPush : TWapPush;                                    ' Declaration of the wrapper class
  objWapPush : IWapPush;                                 ' Declaration of the interface class
  objWapPush := WapPush.DefaultInterface;                ' Creation new instance of the object

  WapBookmark : TWapBookmark;                            ' Declaration of the wrapper class
  objWapBookmark : IWapBookmark;                         ' Declaration of the interface class
  objWapBookmark := WapBookmark.DefaultInterface;        ' Creation new instance of the object
If you want to use Ringtone messages or Picture messages, you can create a new Ringtone or PictureMessage object in the following way:
  Ringtone : TRingtone;                                  ' Declaration of the wrapper class
  objRingtone : IRingtone;                               ' Declaration of the interface class
  objRingtone:= Ringtone.DefaultInterface;               ' Creation new instance of the object

  PictureMessage : TPictureMessage;                      ' Declaration of the wrapper class
  objPictureMessage : IPictureMessage;                   ' Declaration of the interface class
  objPictureMessage:= PictureMessage.DefaultInterface;   ' Creation new instance of the object
If you want to use MMS notification messages, you can create a new MMSNotification object in the following way:
  MMSNotification : TMMSNotification;                    ' Declaration of the wrapper class
  objNotification : INotification;                       ' Declaration of the interface class
  objNotification:= MMSNotification.DefaultInterface;    ' Creation new instance of the object
After these declarations and creation of the object(s), you can use the objects in your Visual Basic .NET projects.

4.7. ASP 2.x environment

Simply create the objects in the following way:
  <html>
  <body>
  Version:
  <script language=vbscript runat=server>
    Set objConstants       = CreateObject( "ActiveXperts.SmsConstants" )
    Set objGsmOut          = CreateObject( "ActiveXperts.GsmOut" )
    Set objGsmIn           = CreateObject( "ActiveXperts.GsmIn" )
    Set objHttpPost        = CreateObject( "ActiveXperts.HttpPost" )
    Set objSmpp            = CreateObject( "ActiveXperts.Smpp" )
    Set objDialUp          = CreateObject( "ActiveXperts.DialUp" )
    Set objSnpp            = CreateObject( "ActiveXperts.Snpp" )
    Set objPager           = CreateObject( "ActiveXperts.Pager" )
    Set objWapPush         = CreateObject( "ActiveXperts.WapPush" )
    Set objWapBookmark     = CreateObject( "ActiveXperts.WapBookmark" )
    Set objRingtone        = CreateObject( "ActiveXperts.Ringtone" )
    Set objPictureMessage  = CreateObject( "ActiveXperts.PictureMessage" )
    Set objNotification    = CreateObject( "ActiveXperts.MMSNotification" )
    ....
    Response.Write objGsmOut.Version
    ....
  </script>
  </body>
  </html>



5. Error Codes and Constants

 

5.1. Error Codes

When a function is called, the result of the function is stored in the object's 'LastError' property.
When 'LastError' is 0, it means that the last called function completed successfully; otherwise, an error occured.

The value of the LastError tells you why the function failed. All error codes are listed on the ActiveXperts web site:

www.activexperts.com/support/errorcodes (list of error codes).

Here, you can also lookup a specific error to find its description.

You can also call the 'GetErrorDescription' function of any of the objects to find the error description.

5.2. Constants

In SMS and Pager Toolkit, all 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 objConstants = CreateObject( "ActiveXperts.SmsConstants" )
   WScript.Echo objConstants.asDIALMODE_TONE
   WScript.Echo objConstants.asDIALMODE_PULSE
   ...
 
5.2.1. Message Types

Name Description
asMESSAGETYPE_TEXT Standard Text message (GSM)
asMESSAGETYPE_TEXT_FLASH Standard Text message, immediate display
asMESSAGETYPE_TEXT_MULTIPART Standard Text message, multipart
asMESSAGETYPE_DATA Data message (raw 8 bit data)
asMESSAGETYPE_DATA_MULTIPART Multi-part data message (raw 8 bit data)
asMESSAGETYPE_DATA_UDH Data message with User Data Header ( ringtones, logo's, ... )
asMESSAGETYPE_UNICODE Unicode Message (UCS2)
asMESSAGETYPE_UNICODE_FLASH Unicode Message, immediate display
asMESSAGETYPE_UNICODE_MULTIPART Unicode Message, Multipart
asMESSAGETYPE_USERPDU User defined PDU String
asMESSAGETYPE_INDICATION_VOICEMAIL Voicemail indication
asMESSAGETYPE_INDICATION_FAX Fax indication
asMESSAGETYPE_INDICATION_EMAIL E-mail indication

 
5.2.2. GSM Storage Types

Name Description
asSTORAGE_SIM Use SIM Memory (supported by all GSM devices)
asSTORAGE_DEVICE Use Device Memory (supported by the majority of the GSM devices)
asSTORAGE_ANY Use SIM Memory and Device memory

 
5.2.3. GSM Report Storage Types (only when using status reports for outgoing SMS messages)

Name Description
asREPORTSSTORAGE_SIM Use SIM Memory for status reports
asREPORTSSTORAGE_DEVICE Use Device Memory for status reports
asREPORTSSTORAGE_ANY Use SIM and device memory for status reports
asREPORTSSTORAGE_REPORTS Use special Reports memory of the device for all status reports. Only advanced GSM modems have such a Reports memory

 
5.2.4. SMPP Version

Name Description
asSMPPVERSION_33 v 3.3
asSMPPVERSION_34 v 3.4
asSMPPVERSION_50 v 5.0

 
5.2.5. SMPP Mode

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.2.6. 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.2.7. Status codes

Name Description
asSTATUSCODE_SCHEDULED Scheduled
asSTATUSCODE_ENROUTE Enroute
asSTATUSCODE_DELIVERED Delivered
asSTATUSCODE_EXPIRED Expired
asSTATUSCODE_DELETED Deleted
asSTATUSCODE_UNDELIVERABLE Undeliverable
asSTATUSCODE_ACCEPTED Accepted
asSTATUSCODE_UNKNOWN Unknown
asSTATUSCODE_REJECTED Rejected
asSTATUSCODE_SKIPPED Skipped

 
5.2.8. WAP Push Signals

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

 
5.2.9. 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.2.10. Dial Mode

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

 
5.2.11. 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.2.12. 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.2.13. PictureMessage constants

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

 
5.2.14. 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. GsmOut Object

6.1. GsmOut Object - Introduction

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

The GsmOut 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 Pager Toolkit, click here.


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

The following sample demonstrates how to send an SMS message using a GSM modem (or modem-capable GSM phone):
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )

   objGsmOut.Device              = "Nokia 6310i Modem"                ' Use a Nokia Windows Telephony device 
   objGsmOut.MessageRecipient    = "+4412345678"                      ' Recipient's mobile number 
   objGsmOut.MessageData         = "Hello, world!"                    ' SMS message text 
   objGsmOut.RequestStatusReport = False                              ' No request for status report
   objGsmOut.ValidityPeriod      = 0                                  ' Use GSM operator's default retry time
   
   objGsmOut.EnterPin ( "1234" )                                      ' SIM card's PIN code 
   objGsmOut.Send()

   If objGsmOut.LastError = 0 Then
      WScript.Echo "Message successfully delivered."
   Else
      WScript.Echo "Error: " & objGsmOut.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.

6.2. GsmOut 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
DeviceSettings Number In/Out O Identifier string indicating databits, parity and stopbits
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceHwFlowControl Number In/Out O Hardware flow control
DeviceSwFlowControl Number In/Out O Software flow control
DeviceInitString String In/Out O Initialization string for the device
Storage Number In/Out O Preferred status report storage
RequestStatusReport Boolean In/Out O Request a status report, to ensure delivery
ValidityPeriod Number In/Out O Retry time (in minutes)
MessageRecipient String In/Out M SMS number of the recipient
MessageType Number In/Out O Message Type (like: plain text, unicode, etc.)
MessageData String In/Out O Message body. Either plain text characters, or binary data
MessageReference Number Out n/a Message reference of the delivered SMS message
StatusCode Number Out n/a Status code of the last sent SMS message
StatusTimeSeconds Number Out n/a Time (in seconds from 1/1/1970) that status code was reported
StatusTime String Out n/a Time (in US date/time format) that status code was reported
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
GetStatusDescription Lookup status description of the given status code
GetErrorDescription Lookup error description of the given error code

6.3. GsmOut Object - Properties


 Version property

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

 ExpirationDate property

Type:
String
Description:
Expiration date of SMS and Pager 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 objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
    WScript.Echo "ExpirationDate: " & objGsmOut.ExpirationDate

 Device property

Type:
String
Description:
The preferred device for sending 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 objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device = "Standard 19200 bps Modem" ' Use a Windows telephony device (recommended)
Example:
    Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device = "COM2"                     ' Use a COM port directly

 DeviceSettings property

Type:
Number
Description:
By default, the databits/parity/stopbits settings are inherited from the Windows telephony device, or (in case a direct COM port is used) the default COM settings are used (8 databits, no parity, 1 stopbit).
The default settings will usually suffice. Valid values are: asDEVICESETTINGS_8N1 and asDEVICESETTINGS_7E1.
Example:
    Set objGsmOut             = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants          = CreateObject( "ActiveXperts.SmsConstants" )
    objGsmOut.Device          = "COM3"
    objGsmOut.DeviceSettings  = objConstants.asDEVICESETTINGS_7E1

 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. You can assign one of the following values: 0 (to use the default baudrate), 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, 128000 or 256000.
Example:
    Set objGsmOut             = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device          = "Standard 19200 bps Mode"
    objGsmOut.DeviceSpeed     = 4800  ' This will overwrite the Windows telephony device speed

 DeviceHwFlowControl property

Type:
Number
Description:
Hardware flow control regulates communication between computer and device (usually a modem). The 'DeviceHwFlowControl' 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).
You can find a list of valid flow control values here.
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device              = "COM2"
    objGsmOut.DeviceHwFlowControl = objConstants.asFLOWCONTROL_DISABLE

 DeviceSwFlowControl property

Type:
Number
Description:
Software flow control regulates communication between communication device and communication device (in this case: modem to modem). The 'DeviceSwFlowControl' 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).
You can find a list of valid flow control values here.
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
    objGsmOut.Device              = "COM2"
    objGsmOut.DeviceSwFlowControl = objConstants.asFLOWCONTROL_DISABLE

 DeviceInitString property

Type:
String
Description:
Initialization string for the GSM device. The following string is used to initialize a GSM device:
  • If a Windows telephony device is used, the Windows telephony initialization string is used (the 'DeviceInitString' property is ignored);
  • If a direct COM port is used, the 'DeviceInitString' property is used to initialize the device. If the property contains an empty string, "AT&C1&K0" is used to initialize the device.
As mentioned above, the 'DeviceInitString' property is ignored if a Windows telephony device is used.
If you are using a direct port device, and you assign a string to the 'DeviceInitString' property, the string will be used to initialize the modem.
Important: commands can be separated by the ';' character, and will issued separately. So, if 'DeviceInitString' property holds the "ATZ" string, the toolkit first issues ATZ, waits for the OK response, then issues the AT&C1&K0 command and again waits for the OK response.
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.Device              = "COM1"
    objGsmOut.DeviceInitString    = "AT&F;AT&C1&K0"

 Storage property

Type:
Number

Description:
This property is for advanced GSM modems only: If you need status reports for your outgoing SMS messages and you are dealing with an advanced GSM modem, you may want to specify a prefered storage for retrieving the status reports.
The storage location of status reports depends on the type of hardware: GSM phones usually store incoming delivery reports in their internal memory ONLY (don't use the 'Storage' property for these phones);
GSM modems usually store SMS messages on the SIM card, but sometimes have a special storage for delivery reports (including WaveCom and Multitech GSM modems).

Again, please note that not all GSM devices support status reports.

Click here to see the list of GSM report storage types.
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
    ...
    objGsmOut.Device              = "WaveCom Fastrack 1306B"
    objGsmOut.Storage             = objConstants.asREPORTSTORAGE_REPORTS    ' Use special Reports memory instead of default SIM memory
    objGsmOut.MessageReference    = 162
    objGsmOut.QueryStatus()

 RequestStatusReport property

Type:
Boolean
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, 'RequestStatusReport' is disabled because it is not supported by all GSM modems.

If the property is enabled, use the QueryStatus function to query for status report information.
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    ...
    objGsmOut.RequestStatusReport = True
    objGsmOut.MessageRecipient    = "+4412345678"
    objGsmOut.Send()
    If( objGsmOut.LastError = 0 ) Then
       WScript.Echo "MessageReference of last sent message: " & objGsmOut.MessageReference
       WScript.Sleep 20000             ' Wait for 20 secs to allow operator to deliver the message
       objGsmOut.QueryStatus()         ' Query the status of message indicated by objGsmOut.MessageReference
       If( objGsmOut.LastError = 0 ) Then
          WScript.Echo "Status: "             & objGsmOut.StatusCode
          WScript.Echo "Status description: " & objGsmOut.GetStatusDescription( objGsmOut.StatusCode )
          WScript.Echo "Status updated at: "  & objGsmOut.StatusTime
          WScript.Echo "Status updated at (in seconds after 1/1/1970): " & objGsmOut.StatusTimeSeconds
       End If
    End If

 ValidityPeriod property

Type:
Number
Description:
Specifies the preferred retry time, in minutes. The retry time is used by the GSM operator. When a message cannot be delivered to the recipient (for instance because the remote GSM phone is switched off), the GSM 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 objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.RequestStatusReport = True
    objGsmOut.ValidityPeriod      = 10  ' When message fails, operator will retry for a maximum of 10 minutes
    objGsmOut.Send()
    If( objGsmOut.LastError = 0 ) Then
       ' Message successfully delivered to the GSM provider
       ' If the recipients' GSM phone is switched on, it will be delivered immediately
       ' If it is switched off, the GSM operator will retry for 10 minutes.
    End If

 MessageRecipient property

Type:
String
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. If not assigned, the Send function will fail.

The GsmOut object supports two SMS number formats:
  • 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 MessageRecipient property as follows:
    objGsmOut.MessageRecipient = "+31624896641:1234" Application ports can only be used for plain text messages and Unicode messages (single- and multipart).
Example:
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    objGsmOut.MessageData         = "Hello, world!"
    objGsmOut.MessageRecipient    = "+4412345678" ' Send message to UK recipient 12345678
    objGsmOut.Send()

 MessageType property

Type:
Number
Description:
The GsmOut object can send all kinds of data, including: plain text, flash, unicode and more. The 'MessageType' property indicates the type of data that is stored in the MessageData property, which will be sent out by the Send function.
You can assign the following values to the 'MessageType' property: When you use one of the indication types (asMESSAGETYPE_INDICATION_VOICEMAIL, asMESSAGETYPE_INDICATION_FAX or asMESSAGETYPE_INDICATION_EMAIL), you must assign a valid number (as a string) in the range 0..255 to the MessageData property. "0" indicates: deletion of message(s); "1" indicates: 1 new message, "2" indicates: 2 news messages, etc.
Example: Send a ringtone SMS
    Set objRingTone                = CreateObject ( "ActiveXperts.RingTone" )
    Set objGsmOut                  = CreateObject ( "ActiveXperts.GsmOut" )
    Set objConstants               = CreateObject ( "ActiveXperts.SmsConstants" )
 
    objGsmOut.Device               = "COM1"
    objGsmOut.MessageRecipient     = "+31647134225"
    objGsmOut.MessageType          =  objConstants.asMESSAGETYPE_DATA_UDH             ' Data type: User Data
 
    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
    
    If( objRingtone.LastError <> 0 ) Then
       WScript.Echo "Error encoding ringtone: " & objRingtone.LastError
       WScript.Quit
    End If
 
    objGsmOut.MessageData = objRingtone.EncodedMessage
    objGsmOut.Send
    If ( objGsmOut.LastError <> 0 ) Then
      WScript.Echo ( "Error " & objGsmOut.LastError & " : " & objGsmOut.GetErrorDescription ( objGsmOut.LastError ) )
      WScript.Quit
    End If
    
    WScript.Echo "Message successfully submitted."

Example: Send a Voicemail indication
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
    objGsmOut.Device              = "Nokia 6310i GSM"
    objGsmOut.MessageType         = objConstants.asMESSAGETYPE_INDICATION_VOICEMAIL    ' Data type: User Data
    objGsmOut.MessageData         = "5"                                                ' To indicate 5 new voicemail messages.
                                                                                       ' Valid range 0..255. 0 indicates delete,
                                                                                       ' 1 indicates 1 new message, etc.
    objGsmOut.MessageRecipient    = "+31624896641"                                     ' Recipient's mobile number
    objGsmOut.Send()

 MessageData property

Type:
String
Description:
The actual message data. Depending on the MessageType property, the data contains of plain text characters or binary data.
Example: Send a plain text SMS
    Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
    Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
    objGsmOut.Device              = "Nokia 6310i GSM"                 ' Windows telephony driver
    objGsmOut.MessageData         = "Hello, world!"                   ' SMS message text
    objGsmOut.MessageType         = objConstants.asMESSAGETYPE_TEXT   ' Default message type
    objGsmOut.MessageRecipient    = "+31624896641"                    ' Recipient's mobile number
    objGsmOut.Send()

 MessageReference property

Type:
Number
Description:
The message reference, assigned by the Send function, can be used later on to verify delivery of the SMS. If the Send function completes successfully, it doesn't necessarily mean that the SMS has been delivered successfully. The remote GSM may be switched off for instance, and the GSM operator will retry to deliver the message for some hours/days.
To verify delivery, store 'MessageReference' and match it later against an incoming 'Status Report' SMS message. To receive status report messages, you must set the RequestStatusReport property. For an example of how to use a message reference to check delivery of an SMS message, click here.


 StatusCode property

Type:
Number
Descri