ActiveXperts SMS and Pager Toolkit
Manual Pages


© 1999-2005 - ActiveXperts Software
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. Smpp Object
  9. DialUp object
  10. Pager object
  11. WapPush and WapBookmark objects
  12. Samples
  13. Troubleshooting
  14. License Agreement
  15. Purchase and Product Activation





1. Introduction


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:
  • GSM modem;
  • GSM phone;
  • SMPP compliant SMSC provider;
  • Hayes compatible modem.

SMS and Pager Toolkit features the following:
  • Send alphanumeric text SMS messages;
  • Send numeric Pager messages;
  • Send multimedia SMS messages, including ringtones, pictures and logo's;
  • Verify delivery of outgoing SMS message;
  • Send WAP Push messages;
  • Send WAP Bookmarks;
  • Receive SMS messages;
  • Receive SMS messages from different storage locations;
  • Support for Unicode, to support foreign languages like Chinese, Turkisch, etc.;
  • Support for multi-part messages, to allow messages longer than 160 characters;
  • Support for GSM modems and GSM phones to send and receive SMS messages;
  • Support for SMPP (Short Message Peer to Peer) providers for large message volumes;
  • Support TAP/XIO and UCP dial-in SMSC providers;
  • Support Windows 'Phone and Modem devices' and direct COM ports;
  • Support Multi-threading environments. The component is thread-safe, which means it can be used in a multi-threaded environment;
  • Troubleshooting facilities by tracing all modem commands and responses;
  • Samples included for various development platforms: MS Visual Basic, MS Visual Basic .NET, MS Visual C++, MS Visual C# .NET, ASP, ASP .NET and more.
SMS and Pager Toolkit can be used by any of the following development languages:
  • Visual Basic .NET - Windows .NET based application;
  • Visual C# .NET - Windows .NET based applications;
  • Visual Basic 5.x or higher - Windows based applications;
  • Visual C++ 5.x or higher - Windows based applications;
  • ASP .NET - Web site based on Active Server Pages and the .NET Framework;
  • ASP 2.x - Web site based on Active Server Pages (server-side scripting);
  • PHP - Embedded HTML scripting;
  • VBScript - Windows based scripts;
  • Java/Javascript - Java based scripts;
  • HTML - Client scripts within HTML pages;
  • Any other development platform that supports ActiveX/COM components.

Hardware Requirements

SMS and Pager Toolkit supports the following hardware:
  • Network Cards / SMPP protocol

    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 Pager Toolkit, use the Smpp 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 provders that have been tested with ActiveXperts SMS and Pager Toolkit, click here: www.activexperts.com/activsms/smpplist.


  • GSM modems

    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 SMS messages using a GSM modem, use the GsmOut object. To receive, use the GsmIn object.

    ActiveXperts recommends WaveCom GSM modems and MultiTech GSM modems. For more information, click here.


  • GSM phones with AT+C modem command support

    GSM phones work similar to GSM modems. Connect your GSM phone to a PC or server via the serial port, USB port or Bluetooth.
    People usually prefer to use a dedicated GSM modem rather than a GSM phone, because it is cheaper and faster.

    To send SMS messages using a GSM phone and SMS and Pager Toolkit, use the GsmOut object; to receive, use the GsmIn object.

    For a list of GSM phones tested with SMS and Pager Toolkit, click here: www.activexperts.com/support/activsms/phones/.


  • Hayes compatible modems (1200 bps or higher).

    Use SMS and Pager 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 Pager Toolkit, use the DialUp object.
To send Pager messages, you can use any of the above hardware devices; however, there is no need to use a GSM modem or GSM phone for paging, because it will only use ATD commands. A normal Hayes compatible modem is less expensive.
To send pager messages with SMS and Pager Toolkit, use the Pager object.



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:
  1. ASmsCtrl.dll - the SMS and Pager Toolkit ActiveX object.
The component encapsulates the following objects:
  • Constants - This object is a collection of read-only properties (so called constants) that can be used anywhere in the source code for various purposes;
  • GsmOut - Send SMS messages using a GSM modem (like MultiTech MultiModem GSM/GPRS USB Modem) or GSM phone (like Nokia 6310i);
  • GsmIn - Receive SMS messages using a GSM modem or GSM phone;
  • Smpp - Send and Receive corporate and high volumes SMS messages. Use the ActiveXperts Demo SMPP server for testing, or sign-up with a commercial SMPP SMSC provider;
  • DialUp - Send SMS messages though an SMSC dial-up provider. This requires a standard Hayes compatible modem and a dial-in number of an SMSC provider;
  • Pager - Send pager messages. This requires a standard Hayes compatible modem;
  • WapPush - Format messages as WapPush messages.
  • WapBookmark - Format messages as WapBookmark messages.
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:
  • Visual Basic .NET;
  • Visual C# .NET;
  • Visual Basic 5.x or higher;
  • Visual C++ 5.x or higher;
  • ASP .NET;
  • ASP 2.x;
  • PHP - Embedded HTML scripting;
  • VBScript;
  • Java/Javascript;
  • HTML;
  • Any other development platform that supports ActiveX/COM components.

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.





3. Installation


The SMS and Pager Toolkit package consists of 4 components; any combination of components can be installed:
  1. The SMS and Pager Toolkit ActiveX/COM component (required) - ASMSCTRL.DLL (the actual ActiveX/COM component);
  2. The SMS and Pager Toolkit Help Files (optional) - documentation;
  3. The SMS and Pager Toolkit Example Files (optional) - sample code for various development platforms;
  4. The SMS and Pager Toolkit Utilities (optional) - SMS demo applications. application

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:
  • Copy the ASMSCTRL.DLL (the SMS and Pager Toolkit ActiveX/COM component) to a destination location on the target machine;
  • Register the ActiveX/COM component by using the following command: REGSVR32 <dest-location>\ASMSCTRL.DLL




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 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" )
   objGsmOut.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 objGsmOut                = CreateObject ( "ActiveXperts.GsmOut" )
   Set objConstants             = CreateObject ( "ActiveXperts.SmsConstants" )
   objGsmOut.Device             = "MultiTech GSM MultiModem"
   objGsmOut.MessageRecipient   = "+31624896641"                    ' Recipient's mobile number

   sRingData                    = "06 05 04 15 81 15 81 02 4A 3A 51 D1 95 CD " & _   ' 
                                  "D0 08 00 1B 20 55 05 90 61 05 60 55 85 50 " & _ 
                                  "54 85 40 82 08 49 90 00"         ' The actual ringtone (binary format)
   RingData = Split ( sRingdata, " " )                              ' Split bytes string into separate bytes
   For i = 0 To UBound ( ringData )                                 ' Create message data 
     objGsmOut.MessageData      = objGsmOut.MessageData & Chr ( "&H" &  RingData ( i ) )
   Next
   objGsmOut.MessageType        = objConstants.asMESSAGETYPE_DATA_UDH ' Set messagetype to User Data Header 
   objGsmOut.Send                                                   ' Send the ringtone message now
   WScript.Echo "Result: " & objGsmOut.LastError

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
     nParts = objWapPush.Encode                                      ' Encode the WAP data
     For i = 0 To nParts - 1
       objSmpp.MessageData = objWapPush.GetMessagePart ( i )
       objSmpp.Send                                                  ' Send WAP data
       WScript.Echo "Send part #" & i & ",result: " & objSmpp.LastError
     Next
     objSmpp.Disconnect                                              ' Disconnect
   End If


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:
  1. Start the Solution Provider, go to the project's 'References' container;
  2. Choose 'Add Reference' from the context menu;
  3. Select the COM tab, choose the 'ActiveXperts SMS and Pager Toolkit' component.
You can create a new SmsConstants object in the following way:
  Dim objConstants As ASmsCtrl.SmsConstants             ' Declaration
  objConstants = New ASmsCtrl.GsmOut()                  ' 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 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 = ASmsCtrl.Dialup()                         ' 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 = 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 = ASmsCtrl.WapPush()                       ' Creation

  Dim objWapBookmark As ASmsCtrl.WapBookmark            ' Declaration
  objWapBookmark = ASmsCtrl.CapBookmark()               ' 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:
  1. Start the Solution Provider, go to the project's 'References' container;
  2. Choose 'Add Reference' from the context menu;
  3. From the COM components tab, choose the 'ActiveXperts SMS and Pager Toolkit' component.
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 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 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
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 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 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
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:
  • ASmsCtrl.h
  • ASmsCtrl_i.c
  • ASmsConstants.h
You can create a new SmsConstants object in the following way:
   ISmsConstants *pObjConstants;                        // Declaration
   CoCreateInstance(CLSID_CSmsConstants, NULL, CLSCTX_INPROC_SERVER, IID_IProvider, (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_CGsmOut, NULL, CLSCTX_INPROC_SERVER, IID_IProvider, (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_CGsmIn, NULL, CLSCTX_INPROC_SERVER, IID_IProvider, (void**) &pObjGsmIn);               // 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_CSmpp, NULL, CLSCTX_INPROC_SERVER, IID_IProvider, (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_CDialUp, NULL, CLSCTX_INPROC_SERVER, IID_IProvider, (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_CPager, NULL, CLSCTX_INPROC_SERVER, IID_IPager, (void**) &pObjPager);                  // 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_CWapPush, NULL, CLSCTX_INPROC_SERVER, IID_IWapPush, (void**) &pObjWapPush);            // Creation

   IWapBookmark  *pObjWapBookmark;                      // Declaration
   CoCreateInstance(CLSID_CWapBookmark, NULL, CLSCTX_INPROC_SERVER, IID_IWapBookmark, (void**) &pObjWapBookmark);// Creation


4.6. 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 objSmpp         = CreateObject( "ActiveXperts.Smpp" )
    Set objDialUp       = CreateObject( "ActiveXperts.DialUp" )
    Set objPager        = CreateObject( "ActiveXperts.Pager" )
    Set objWapPush      = CreateObject( "ActiveXperts.WapPush" )
    Set objWapBookmark  = CreateObject( "ActiveXperts.WapBookmark" )
    ....
    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:

http://www.activexperts.com/support/errorcodes.

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 Constants 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

 
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
asREPORTSTORAGE_SIM Use SIM Memory for status reports
asREPORTSTORAGE_MEMORY Use Device Memory for status reports
asREPORTSTORAGE_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 simultaneous 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

 
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






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:
  • Open the Windows Control Panel from the Start menu;
  • Double-click on 'Phone and Modem Options' and select the 'Modems' tab;
  • Select the preferred modem and click on 'Properties'; from here, you can change the settings.
To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:
  • Device - the literal Windows telephony device string, for instance: 'Standard 9600 Modem'.
Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be setup properly before receiving messages:
  • Device - The actual COM port, formatted as COMx, where x represents the COM port number;
  • DeviceHwFlowControl - Hardware flow control is used to regulate commands from PC to device and visa versa; default: On;
  • DeviceSwFlowControl - Software flow control is used to regulate data from device to device; default: Off;
  • DeviceSpeed - The speed to be used to communicate with the GSM modem or GSM phone; default: 0 (which means that factory defaults are used for modem communications);
  • DeviceSettings - The number of databits, paritybits and stopbits; default: 8 databits, no parity, 1 stopbit;
  • DeviceInitString - The modem initialization string is used to initialize the modem; default value: '' (which means a generic initialization string will be used).
You can send different types of SMS messages:
  • Text - Plain text (default)
  • Flash - Plain text, immediate display
  • Data - Data message (raw, 8 bits)
  • Unicode - Unicode message
  • Unicode Flash - Unicode message, immediate display
  • WAP Push - Propagate a URL to the remote recipient's WAP phone
  • WAP Bookmark - Propagate a bookmark to the remote recipient's WAP phone
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 Boolean In/Out O Hardware flow control
DeviceSwFlowControl Boolean 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 ID 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 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 retrieve Windows telephony device names;
  • 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:
Boolean

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). The default value of 'DeviceHwFlowControl' is: True.

Example:
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Device              = "COM2"
   objGsmOut.DeviceHwFlowControl = True

 DeviceSwFlowControl property

Type:
Boolean

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). The default value of 'DeviceSwFlowControl' is: False.

Example:
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Device              = "COM2"
   objGsmOut.DeviceSwFlowControl = False

 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;AT&C1&K0" 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 msecs 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:
  1. 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

  2. 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

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:

Example: Send a ringtone SMS
   ' Ringtone Data Header contents :
   '   06		Length of header
   '   05		Application Port addressing 16 bit
   '   04		Datalength of information element
   '   15 81  Source Port ( Ringtones supply )
   '   15 81  Dest Port	( Ringtones supply )
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
   Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
   strRingData                   = "06 05 04 15 81 15 81 02 4A 3A 51 D1 95 CD D0 08 00 1B 20 55 05"
   arrRingData                   = Split ( strRingData, " " )
   objGsmOut.Device              = "Nokia 6310i GSM"
   For i = 0 To UBound ( ringData ) 
      objGsmOut.MessageData      = objGsmOut.MessageData & Chr("&H" & arrRingData(i)) ' Create ringtone data
   Next
   objGsmOut.MessageType         = objConstants.asMESSAGETYPE_DATA_UDH                ' Data type: User Data
   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 ID, 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 ID to check delivery of an SMS message, click here.


 StatusCode property

Type:
Number

Description:
This property holds the status of a message that was queried by the QueryStatus function.

Please note that status delivery info ONLY works if the RequestStatusReport was set before sending the SMS message(s).

Click here for a list of status codes.
For a description of a status code, you can call the GetStatusDescription function.
The StatusTimeSeconds and StatusTime properties hold the time that the status code was updated by the mobile operator.

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

 StatusTimeSeconds and StatusTime properties

Type:
Number

Description:
These properties hold the time that the status code was updated by the mobile operator.
'StatusTimeSeconds' holds the time in seconds after 1/1/1970, 'StatusTime' shows the time as a friendly string in US date notation.

Example:
      See also StatusCode.



 DeleteAfterReceive property

Type:
Boolean

Description:
Delete message from storage after receive. By default, message are NOT deleted from storage after the function is called.

Example:
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Device              = "Nokia 6310i GSM"
   objGsmOut.DeleteAfterReceive  = True              ' Delete message from storage after receive
   objGsmOut.Receive()
   If( objGsmOut.LastError = 0 ) Then
      objGsmOut.GetFirstMessage()
      While( objGsmOut.LastErrror = 0 ) Then
         ...
         objGsmOut.GetNextMessage()
      WEnd
   End If

 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Send()
   WScript.Echo "LastError: " & objGsmOut.LastError

 LogFile property

Type:
String

Description:
By default, LogFile holds the empty string and nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output is always appended.

Example:
   Set objGsmOut       = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.LogFile   = "c:\temp\mylogfile.log"
   objGsmOut.Send()


6.4. GsmOut Object - Functions


 Activate function

Description:
This functions activates the SMS and Pager Toolkit product. A valid registration code should be passed as parameter.

Parameters:
  • The registration code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmOut  = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Activate "xxxxx-xxxxx-xxxxx"  ' replace xxxxx-xxxxx-xxxxx by your personal registration code

 Clear function

Description:
This function resets all Properties to their initial, default values.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Send()
   objGsmOut.Clear()
   objGsmOut.Send()
   objGsmOut.Clear()

 GetDeviceCount function

Description:
Returns the number of installed Windows telephony devices on the local computer.

Parameters:
  • None
Return value:
The number of installed Windows telephony devices. Check the LastError property to see if the function was completed successfully.

NOTE: The number of Windows telephony devices does not include the number installed COM ports.

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   WScript.Echo "Number of installed Windows telephony devices: " & objGsmOut.GetDeviceCount()

 GetDevice function

Description:
Returns the n-th telephony device of the system. The number n can be between 0 and GetDeviceCount()-1.

Parameters:
  • Zero based index, to iterate over all telephony devices.
Return value:
The name of the device. Call the LastError function to see if the function was completed successfully.
The name of the device can be assigned to the Device property to open a Windows telephony device.

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   n = objGsmOut.GetDeviceCount()
   For i = 0 to n-1
      WScript.Echo "Device " & i & ": " & objGsmOut.GetDevice( i )
   Next
Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   If( objGsmOut.GetDeviceCount() > 0 )
      objGsmOut.Device = objGsmOut.GetDevice( 0 )  ' Use the first telephony device
      objGsmOut.Receive()
   End If

 EnterPin function

Description:
Enter the PIN code. Required for PIN protected SIM cards.

Parameters:
  • PIN code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.EnterPin( "1234" )
   ....
   objGsmOut.Send()
   Next

 Send function

Description:
Send an SMS message via a GSM modem or GSM phone.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example: Send an SMS message
   Set objGsmOut                 = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Device              = "MultiTech GSM MultiModem"   
   objGsmOut.MessageRecipient    = "+31624896641"
   objGsmOut.MessageData         = "Hello, world!"
   objGsmOut.RequestStatusReport = False    ' No request for status report
   objGsmOut.ValidityPeriod = 0             ' Use GSM operator's default retry time
   objGsmOut.Send()
   If objGsmOut.LastError = 0 Then
      WScript.Echo "Message successfully delivered"
   Else
      WScript.Echo "Error: " & objGsmOut.LastError
   End If


 SendCommand function

Description:
Send a special command to the GSM device, and read the response.
'SendCommand' is often used to check the signal strength of the device, but also be used for other purposes.

Parameters:
  • Command - the AT command
  • TimeOut - the timeout (in milliseconds) to wait for the response
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example: Send an SMS message, but only if the signal strength is good
   Dim objGsmOut
   Dim strCmdResponse, arrCmdResponse, arrSignal, numSignal

   Set objGsmOut              = CreateObject( "ActiveXperts.GsmOut" )

   objGsmOut.Device           = "COM1"
   objGsmOut.MessageRecipient = "+31625044454"
   objGsmOut.MessageData      = "Hello, world"

   ' Query the GSM modem for its signal strength
   ' The output (strCmdResponse) is something like "+CSQ: 30,0"
   ' where 30 indicates the signal strength (0 is lowest strength, 31 is highest),
   ' and 0 is an error code (0 means: no error)
   strCmdResponse = objGsmOut.SendCommand( "AT+CSQ", 5000 )

   ' Split up the response and store it in arrCmdResponse
   ' arrCmdResponse(0): "+CSQ:"
   ' arrCmdResponse(1): "30,0"
   arrCmdResponse = Split( strCmdResponse )

   ' Split up the string and store it in arrSignal
   ' arrSignal(0): "30"
   ' arrSignal(1): "1"
   arrSignal = Split( arrCmdResponse(1), "," )

   ' Store Signal strneght [0..31] in numSignal as an Integer value
   numSignal = CInt( arrSignal(0) )
   WScript.Echo "Signal strength: " & numSignal

   ' If the signal strength is poor (less than 20) then quit
   If( numSignal < 20 ) Then
      WScript.Echo "Singal strength too low."
      WScript.Quit
   End If

   objGsmOut.Send	   ' Send the message 		 
   If objGsmOut.LastError = 0 Then
      WScript.Echo "Message successfully delivered"
   Else
      WScript.Echo "Error: " & objGsmOut.LastError
   End If


 QueryStatus function

Description:
Query the status of a message that was successfully submitted by the Send function.
The function queries the message indicated by the MessageReference property. If the function completes successfully (i.e. if the LastError is 0 after the call), you can check the StatusCode property to check the status of the message.

Please note that status delivery info ONLY works if the RequestStatusReport was set before sending the SMS message(s). Only then, the telecom operator knows that you want a status report for the particular SMS message.

By default, status reports are retrieved from the SIM card. Some advanced GSM modems have a sepcial Status Reports memory inside their device. If you want to use this special Status Reports memory, set the Storage property before calling 'QueryStatus'.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

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 msecs 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

 GetStatusDescription function

Description:
Retrieve the description of a status code.

Parameters:
  • Status code. Click here for a list of valid status codes
Return value:
The status string.

Example:
   Set objGsmOut                   = CreateObject( "ActiveXperts.GsmOut" )
   ...
   objGsmOut.MessageReference      = "123"
   objGsmOut.QueryStatus()
   If objGsmOut.LastError <> 0 Then
     WScript.Echo "Status code: "        & objGsmOut.StatusCode
     WScript.Echo "Status description: " & objGsmOut.GetStatusDescription( objGsmOut.StatusCode )
   End If

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objGsmOut = CreateObject( "ActiveXperts.GsmOut" )
   objGsmOut.Send()
   If objGsmOut.LastError <> 0 Then
     WScript.Echo "Error description: " & objGsmOut.GetErrorDescription( objGsmOut.LastError )
   End If





7. GsmIn Object


7.1. GsmIn Object - Introduction


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

The GsmIn 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 devices is used, settings are controlled by the Windows telephony driver, and can be configured through the 'Phone and Modem' settings:
  • Open the Windows Control Panel from the Start menu;
  • Double-click on 'Phone and Modem Options' and select the 'Modems' tab;
  • Select the preferred modem and click on 'Properties'; from here, you can change the settings.
To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:
  • Device - the literal Windows telephony device string, for instance: 'Standard 9600 Modem'.
Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be setup properly before receiving messages:
  • Device - The actual COM port, formatted as COMx, where x represents the COM port number;
  • DeviceHwFlowControl - Hardware flow control is used to regulate commands from PC to device and visa versa; default: On;
  • DeviceSwFlowControl - Software flow control is used to regulate data from device to device; default: Off;
  • DeviceSpeed - The speed to be used to communicate with the GSM modem or GSM phone; default: 0 (which means that factory defaults are used for modem communications);
  • DeviceSettings - The number of databits, paritybits and stopbits; default: 8 databits, no parity, 1 stopbit;
  • DeviceInitString - The modem initialization string is used to initialize the modem; default value: '' (which means a generic initialization string will be used).
SMS messages can be received from different types of storage. The storage location depends on the type of hardware: GSM phones usually store incoming SMS messages in their internal memory; GSM modems usually keep SMS messages on the SIM card. It is recommended to read from the default storage.
Some devices (including WaveCom GSM modems) have a special storage for delivery reports. This enables you to verify the delivery of a message. The 'GsmIn' object supports the following storage locations:
  • Default - use default device settings;
  • SIM Memory - use SIM memory;
  • Device Memory - use device memory;
  • Any - use any device memory;
  • Reports - status report memory;
  • Archive - Use archive memory.
SMS messages are always received in 'batches', i.e. all incoming SMS messages are read from the message storage and stored in the SMS and Pager Toolkit internal message queue. This queue is a FIFO (First-In-First-Out) queue.
To read all messages from the selected storage, use the following function:
  • Receive - Receive incoming SMS messages and place them in the internal message queue. Optionally, delete all messages from device storage.
After calling the 'Receive' function, messages can be fetched one-by-one using the GetFirstMessage/GetNextMessage functions:
  • GetFirstMessage - Fetch first SMS message from the toolkit's internal message queue
  • GetNextMessage - Fetch next SMS message from the toolkit's internal message queue
After each function call, you should check the result of the function. The result of the last called function is stored in the 'LastError' property. All other functions will also store their result in this 'LastError' property.


Receive SMS messages using a GSM device

The following sample demonstrates how to receive SMS messages via a GSM modem (or modem-capable GSM phone):
   Set objGsmIn       = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device    = "Nokia 6310i Modem"  ' Use the Nokia telephony device
   objGsmIn.Receive()
   If objGsmIn.LastError = 0 Then
     objGsmIn.GetFirstMessage()
     While objGsmIn.LastError = 0
       WScript.Echo "Message received from: " & objGsmIn.MessageSender & " at " & objGsmIn.MessageTime
       WScript.Echo "  Type: "                & objGsmIn.MessageType
       WScript.Echo "  Message: "             & objGsmIn.MessageData
       objGsmIn.GetNextMessage() 
     WEnd
   End If

Delete messages from the GSM storage after receive

By default, messages are NOT deleted from storage (usually: SIM card or device). To delete messages from storage after receive, you must set the 'DeleteAfterReceive' property:
   Set objGsmIn                = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device             = "Nokia 6310i Modem"  ' Use the Nokia telephony device
   objGsmIn.DeleteAfterReceive = True                 ' Delete from storage after calling 'Receive'
   objGsmIn.Receive()
   If objGsmIn.LastError = 0 Then
     objGsmIn.GetFirstMessage()
     While objGsmIn.LastError = 0
       ...
       objGsmIn.GetNextMessage() 
     WEnd
   End If
NOTE: As an alternative, "Nokia 6310i Modem" can be replaced by "COM1", assuming that the Nokia phone is connected on COM1.



7.2 GsmIn 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 Boolean In/Out O Hardware flow control
DeviceSwFlowControl Boolean In/Out O Software flow control
DeviceInitString String In/Out O Initialization string for the device
Storage Number In/Out O Preferred storage
DeleteAfterReceive Boolean In/Out O Delete message from storage after receive
MessageSender String Out n/a Received message: SMS number of the sender
MessageSMSC String Out n/a Received message: SMSC number of the sending provider (in case SMS was sent by an SMSC provider)
MessageTime String Out n/a Received message: Time (friendly string) at which message was received
MessageTimeSeconds Number Out n/a Received message: Time (in seconds from 1/1/1970) at which message was received
MessageType Number Out n/a Received message: Message Type
MessageData String Out n/a Received message: Message Data
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)
Receive Read all SMS messages from device storage
SendCommand Send a special command to the GSM device and read the response
GetFirstMessage Get the first SMS message
GetNextMessage Get the next SMS message
GetErrorDescription Lookup error description of the given error code



7.3. GsmIn 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 objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   WScript.Echo "Version: " & objGsmIn.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 objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   WScript.Echo "ExpirationDate: " & objGsmIn.ExpirationDate

 Device property

Type:
String

Description:
The preferred device for 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 retrieve Windows telephony device names;
  • 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 objGsmIn    = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device = "Standard 19200 bps Modem"  ' Use a Windows telephony device (recommended)
Example:
   Set objGsmIn    = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.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).
This default is indicated by the asDEVICESETTINGS_DEFAULT value.

To overwrite the default value, assign one of the following values to the 'DeviceSettings' property: It's recommended to overwrite the default only when using a dialup provider; most dial-in providers require fixed settings; see also the online list of SMSC dial-up providers around the world.

NOTE: When assigning 'DeviceSettings' to a Windows telephony device, the settings are overwritten.

Example:
   Set objGsmIn            = CreateObject( "ActiveXperts.GsmIn" )
   Set objConstants        = CreateObject( "ActiveXperts.SmsConstants" )
   objGsmIn.Device         = "COM3"
   objGsmIn.DeviceSettings = objConstants.asDEVICESETTINGS_7E1
Example:
   Set objGsmIn            = CreateObject( "ActiveXperts.GsmIn" )
   Set objConstants        = CreateObject( "ActiveXperts.SmsConstants" )
   objGsmIn.Device         = "Standard 9600 bps Modem"
   objGsmIn.DeviceSettings = objConstants.asDEVICESETTINGS_7E1  ' Overwrite Windows telephony device settings

 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 objGsmIn              = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device           = "Standard 19200 bps Mode"
   objGsmIn.DeviceSpeed      = 4800  ' This will overwrite the Windows telephony device speed

 DeviceHwFlowControl property

Type:
Boolean

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. The default is True; it's very uncommon to change these values for modem communications. 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).
If a Windows telephony device is used (for instance: "Standard 19200 bps modem"), the 'DeviceHwFlowControl' property will be ignored because it is configured through the Control Panel.

Example:
   Set objGsmIn                  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device               = "COM2"
   objGsmIn.DeviceHwFlowControl  = True

 DeviceSwFlowControl property

Type:
Boolean

Description:
Software flow control regulates communication between communication device and communication device (in this case: modem to modem). Special characters are sent when a modem cannot receive fast enough; in this way handshaking is done. By default, software flow control is disabled. Usually, software flow control is enabled only if data is transmitted from one site to the other. The 'DeviceSwFlowControl' property 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 'DeviceSwFlowControl' will be discarded because it is configured through the Control Panel.

Example:
   Set objGsmIn                  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device               = "COM2"
   objGsmIn.DeviceSwFlowControl  = False

 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;AT&C1&K0" 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 objGsmIn                  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device               = "COM1"
   objGsmIn.DeviceInitString     = "AT&F;AT&C1&K0"

 Storage property

Type:
Number

Description:
SMS messages can be received from different types of storage. The storage location depends on the type of hardware: GSM phones usually store incoming SMS messages in the internal device memory; GSM modems usually store SMS messages on the SIM card. It is recommended to read from the default storage.
Some devices (including WaveCom GSM modems) have a special storage for delivery reports. This enables you to verify the delivery of a message.
Click here to see the list of GSM storage types.

Example:
   Set objGsmIn                  = CreateObject( "ActiveXperts.GsmIn" )
   Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
   objGsmIn.Device               = "Nokia 6310i GSM"
   objGsmIn.Storage              = objConstantsasSTORAGE_DEVICE  ' Receive from device instead from default storage
   objGsmIn.Receive()

 DeleteAfterReceive property

Type:
Boolean

Description:
Delete message from storage after receive. By default, message are NOT deleted from storage after the function is called.

Example:
   Set objGsmIn                  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Device               = "Nokia 6310i GSM"
   objGsmIn.DeleteAfterReceive   = True    ' Delete message from storage after receive
   objGsmIn.Receive()
   If( objGsmIn.LastError = 0 ) Then
     objGsmIn.GetFirstMessage()
     While( objGsmIn.LastErrror = 0 ) Then
       ...
       objGsmIn.GetNextMessage()
     WEnd
   End If

 MessageSender,
 MessageSMSC,
 MessageTime,
 MessageTimeSeconds,
 MessageType,
 MessageData properties


Type:
String

Description:
After a successfull call of the GetFirstMessage or GetNextMessage function, the following properties contain information about the current received message:
  • MessageSender - Sender's SMS number;
  • MessageSMSC - SMSC number of the provider that sent the message (only applies to messages that were sent through an SMSC provider);
  • MessageTime - Time (friendly string) when message was received;
  • MessageTimeSeconds - Time (in seconds from 1/1/1970) when message was received;
  • MessageType - Message type. For a list of valid message types, click here;
  • MessageData - Message data. Can be plain ASCII text, Unicode data or binary data (depends on 'MessageType')

Example:
   Set objGsmIn  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Receive()
   If( objGsmIn.LastError = 0 ) Then
     objGsmIn.GetFirstMessage()
     While( objGsmIn.LastErrror = 0 ) Then
       WScript.Echo "Received Message at: " & objGsmIn.MessageTime
       WScript.Echo "  Type: "              & objGsmIn.MessageType
       WScript.Echo "  Sender: "            & objGsmIn.MessageSender
       WScript.Echo "  Message: "           & objGsmIn.MessageData
       objGsmIn.GetNextMessage()
     WEnd
   End If

 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:
   Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Receive()
   WScript.Echo "LastError: " & objGsmIn.LastError

 LogFile property

Type:
String

Description:
By default, LogFile holds the empty string and nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output is always appended.

Example:
   Set objGsmIn      = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.LogFile  = "c:\temp\mylogfile.log"
   objGsmIn.Receive()


7.4 GsmIn Object - Functions


 Activate function

Description:
This functions activates the SMS and Pager Toolkit product. A valid registration code should be passed as parameter.

Parameters:
  • The registration code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmIn  = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Activate "xxxxx-xxxxx-xxxxx"  ' replace xxxxx-xxxxx-xxxxx by your personal registration code.

 Clear function

Description:
This function resets all Properties to their initial, default values.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Receive()
   objGsmIn.Clear()
   objGsmIn.Receive()
   objGsmIn.Clear()

 GetDeviceCount function

Description:
Returns the number of installed Windows telephony devices on the local computer.

Parameters:
  • None
Return value:
The number of installed Windows telephony devices. Check the LastError property to see if the function was completed successfully.

NOTE: The number of Windows telephony devices does not include the number installed COM ports.

Example:
   Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   WScript.Echo "Number of installed Windows telephony devices: " & objGsmIn.GetDeviceCount()

 GetDevice function

Description:
Returns the n-th Windows telephony device of the system. The number n can be between 0 and GetDeviceCount()-1.

Parameters:
  • Zero based index, to iterate over all Windows telephony devices.
Return value:
The name of the device. Call the LastError function to see if the function was completed successfully.
The name of the device can be assigned to the Device property to open a Windows telephony device.

Example:
   Set objGsmIn  = CreateObject( "ActiveXperts.GsmIn" )
   n = objGsmIn.GetDeviceCount()
   For i = 0 to n-1
     WScript.Echo "Device " & i & ": " & objGsmIn.GetDevice( i )
   Next
Example:
   Set objGsmIn  = CreateObject( "ActiveXperts.GsmIn" )
   If( objGsmIn.GetDeviceCount() > 0 )
     objGsmIn.Device = objGsmIn.GetDevice( 0 )  ' Use the first Windows telephony device
     objGsmIn.Receive()
   End If

 EnterPin function

Description:
Enter the PIN code. Required for PIN protected SIM cards.

Parameters:
  • PIN code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.EnterPin( "1234" )
   ....
   objGsmIn.Receive()
  Next

 Receive function

Description:
Retrieve all incoming SMS messages (read and unread) from the device storage (i.e. SIM card and/or device memory).
Messages are queued internally by the Toolkit and can be fetched one-by-one by calling the GetFirstMessage and GetNextMessage functions. The number of received messages is indicated by the return value. The function requires one parameter, to indicate whether messages should be deleted on the SIM card or not. If you pass True, all messages will be deleted from the SIM card.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully
Example: Receive SMS messages without removing them from the SIM card
   Set objGsmIn    = CreateObject( "ActiveXperts.GsmIn" )
   numMessages     = objGsmIn.Receive()
   If( objGsmOut.LastError = 0 And numMessages > 0 ) Then
     objGsmIn.GetFirstMessage()
     While( objGsmIn.LastError = 0 )
       WScript.Echo "Message received from " & objGsmIn.MessageSender & " at " & objGsmIn.MessageTime
       WScript.Echo "  Type: "               & objGsmIn.MessageType
       WScript.Echo "  Message: "            & objGsmIn.MessageData
       objGsmIn.GetNextMessage()
     WEnd
   End If
Example: Receive SMS messages; delete them after you've listed them all
   Set objGsmIn                = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.DeleteAfterReceive = True  ' To delete all messages from storage after receive
   numMessages = objGsmIn.Receive()
   If( objGsmIn.LastError = 0 And numMessages > 0 ) Then
     objGsmIn.GetFirstMessage()
     While( objGsmIn.LastError = 0 )
       ...        
       objGsmIn.GetNextMessage()
     WEnd
   End If

 SendCommand function

Description:
Send a special command to the GSM device, and read the response.
'SendCommand' is often used to check the signal strength of the device, but also be used for other purposes.

Parameters:
  • Command - the AT command
  • TimeOut - the timeout (in milliseconds) to wait for the response
Return value:
Always 0. Check LastError property to see if the function was completed successfully. The function works exactly the same as the GsmOut:SendCommand function. GsmOut:SendCommand has a good example that demonstrates how to use the function.


 GetFirstMessage and GetNextMessage functions

Description:
After a successfull call of the Receive function, you can retrieve the SMS messages one-by-one.

Parameters:
  • None.
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objGsmIn  = CreateObject( "ActiveXperts.GsmIn" )
   numMessages   = objGsmIn.Receive()
   If( objGsmIn.LastError = 0 And numMessages > 0 ) Then
     objGsmIn.GetFirstMessage()
       While( objGsmIn.LastError = 0 )
       WScript.Echo "Message received from " & objGsmIn.MessageSender & " at " & objGsmIn.MessageTime
       WScript.Echo "  Type: "               & objGsmIn.MessageType
       WScript.Echo "  Message: "            & objGsmIn.MessageData 
       objGsmIn.GetNextMessage()
     WEnd
   End If

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objGsmIn = CreateObject( "ActiveXperts.GsmIn" )
   objGsmIn.Receive()
   If objGsmIn.LastError <> 0 Then
     WScript.Echo "Error description: " & objGsmIn.GetErrorDescription( objGsmIn.LastError )
   End If




8. Smpp Object


8.1. Smpp Object - Introduction

The Smpp object enables high volumes and corporate SMS messaging. You must sign-up with an SMPP-compliant SMSC provider before you can actually use the SMPP object.

The Smpp object connects to the remote SMPP-compliant SMSC provider using the SMPP network protocol. SMPP ('Short Message Peer-to-Peer') is a Layer-7 TCP/IP protocol, which allows you to send high volumes SMS messages, usually 10 SMS messages per second or more. Messages can be 'acknowledged', which means that delivery can be guaranteed.

The Smpp object only allows sending of SMS messages.

The Smpp object supports both v.3.3 and v.3.4 of SMPP.
You can send different types of SMS messages:
  • Text - Plain text (default)
  • Unicode - Unicode message
  • Ringtones
  • Logo's
  • Data - Data message (raw, 8 bits)
  • Data - Data message (UDH)
  • WAP Push - Propagate a URL to the remote recipient's WAP phone
  • WAP Bookmark - Propagate a bookmark to the remote recipient's WAP phone

Send SMS message through SMPP by the use of the Smpp object

The following sample demonstrates how to deliver an SMS message through an SMPP-compliant SMSC provider by the use of the Smpp object:
   Set objSmpp                = CreateObject( "ActiveXperts.Smpp" )

   ' SMSC Server properties
   objSmpp.Server             = "smpp.activexperts-labs.com"   ' ActiveXperts SMPP Demo server
   objSmpp.ServerPort         = 2775                           ' TCP port
   objSmpp.SystemID           = "AX005"                        ' Account to logon to the SMSC provider
   objSmpp.SystemPassword     = "812056"                       ' Password to logon to the SMSC provider

   objSmpp.Connect                                             ' Establish a TCP/IP based SMPP session
   If objSmpp.IsConnected = True Then
     objSmpp.MessageRecipient = "+31647134225"                 ' Recipient SMS number
     objSmpp.MessageData      = "Hello World via SMPP"         ' SMS message text
     objSmpp.Send
     If( objSmpp.LastError <> 0 ) Then
        WScript.Echo "Failed to send message, error: " & objSmpp.LastError 
     Else
        WScript.Echo "Message successfully delivered" 
     End If

     objSmpp.Disconnect
   End If


8.2. Smpp 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 - if any
Server String In/Out M Hostname or IP address of the SMPP provider
ServerPort Number In/Out M TCP port used for connection to SMPP provider
ServerTimeout Number In/Out O Server timeout in milliseconds, used for all network operations
ServerKeepAlive Number In/Out O Keep alive time in seconds, to keep a communication channel open
SystemVersion Number In/Out O Specify version of your SMPP provider
SystemID String In/Out M Account used to login to the SMPP provider's system
SystemPassword String In/Out M Password used to login to the SMSC provider's system
SystemType String In/Out O Type of SMSC provider. Default: "SMPP"
SystemCharSet Number In/Out O Selected character set
SystemSourceAddress String In/Out O The SMS mobile number associated with your SMPP account. Only used for outgoing messages to indicate the sender.
SystemSourceTON Number In/Out O SMPP client's TON (Type Of Number) used during SMPP server session
SystemSourceNPI Number In/Out O SMPP client's NPI (Numbering Plan Indicator) used during SMPP server session
SystemDestinationTON Number In/Out O SMPP server's TON (Type Of Number) used during SMPP server session
SystemDestinationNPI Number In/Out O SMPP server's NPI (Numbering Plan Indicator) used during SMPP server session
ValidityPeriod Number In/Out O Retry period in minutes that the SMPP provider will use to deliver the message
IsConnected Boolean Out n/a Indicates if a connection to the remote SMPP provider is still estalished
MessageSender String In/Out O Sender of the message (incoming messages only)
MessageRecipient String In/Out M Recipient SMS number
MessageData String In/Out M SMS data to send to the recipient
MessageType Number In/Out O Message Type (like: plain text, unicode, etc.)
MessageServiceType String In/Out O Message Service Type (advanced use only); use it to indicate an SMS Application Service
MessageReference String Out n/a Message ID of the last sent message, returned by the SMPP provider
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 SMPP communication commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
Connect Establish an SMPP connection to the remote SMPP provider. Based on TCP/IP
Disconnect Disconnect current SMPP connection
Send Send an SMS message
QueryStatus Query message status of an outgoing message
Cancel Remove an outgoing pending message from SMPP provider
GetFirstMessage Get first incoming message
GetNextMessage Get next incoming message
GetStatusDescription Lookup status description of the given status code
GetErrorDescription Lookup error description of the given error code


8.3. Smpp 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 objSmpp = CreateObject( "ActiveXperts.Smpp" )
   WScript.Echo "Version: " & objSmpp.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 objSmpp = CreateObject( "ActiveXperts.Smpp" )
   WScript.Echo "ExpirationDate: " & objSmpp.ExpirationDate

 Server property

Type:
String

Description:
Sets the hostname or TCP/IP address of the SMPP server provider. When assigning a hostname, a DNS lookup will be performed.

Example:
   Set objSmpp        = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server     = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort = "2775"                        ' TCP port number
   ...
   objSmpp.Connect()                                  ' Connect to the remote SMPP provider

 ServerPort property

Type:
Number

Description:
Sets the TCP port for SMPP connection. This property is optional, the default value is 2775.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   ...
   objSmpp.Connect()                                       ' Connect to the remote SMPP provider

 ServerTimeOut property

Type:
Number

Description:
Maximum time (in milliseconds) before a Connect, Send or Query operation will timeout. Default value: 2000 milliseconds.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   objSmpp.ServerTimeout   = 4000                          ' 4000 milliseconds before an operation times out
   ...
   objSmpp.Connect()                                       ' Connect to the remote SMPP provider

 ServerKeepAlive property

Type:
Number

Description:
The 'ServerKeepAlive' value is used to keep the current SMPP session alive. It is a good practise to keep a session opened until you don't want to send SMS messages anymore. You can keep the session open for hours, or for days, or even longer.
Some providers don't accept a connect/disconnect for each bunch of SMS messages; they require the session to remain opened until you have completed sending your messages.

The default value is 60 seconds, which means that the SMS and Pager Toolkit sends an 'alive' packet to the remote SMPP server to tell that the session must be remained open.
It is recommended to use 60 seconds, unless your connection drops within 60 seconds; you should then decrease this value.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   objSmpp.ServerKeepAlive = 4000                          ' 4000 milliseconds before an operation times out
   ...
   objSmpp.Connect()                                       ' Connect to the remote SMPP provider

 SystemVersion property

Type:
Number

Description:
The 'SystemVersion' value makes sure that both parties (i.e. the ActiveXperts SMS & Pager Toolkit and the SMPP provider) communicate using the same protocol.

Most providers support v.3.3 or higher. By default, ActiveXperts SMS and Pager Toolkit communicates using the SMPP v.3.3 specifications. Use can assign one of the following values: asSMPPVERSION_33, asSMPPVERSION_34 or asSMPPVERSION_50.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   objSmpp.SystemVersion   = objSmpp.asSMPPVERSION_34      ' Remote SMPP provider operates in v.3.4 mode
   ...
   objSmpp.Connect()                                       ' Connect to the remote SMPP provider

 SystemID property

Type:
String

Description:
Account information that is required to logon to the remote SMPP-compliant SMSC provider. After you sign up with such an SMSC provider, the provider provides you with a valid 'SystemID' and SystemPassword.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   objSmpp.SystemID        = "AX005"                       ' Login
   objSmpp.SystemPassword  = "812056"                      ' Password
   ...
   objSmpp.Connect()

 SystemPassword property

Type:
String

Description:
Account information that is required to logon to the remote SMPP-compliant SMSC provider. After you sign up with such an SMSC provider, the provider provides you with a valid SystemID and 'SystemPassword'.

Example:
   Set objSmpp             = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server          = "smpp.activexperts-labs.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort      = "2775"                        ' TCP port number
   objSmpp.SystemID        = "AX005"                       ' Login
   objSmpp.SystemPassword  = "812056"                      ' Password
   ...
   objSmpp.Connect()

 SystemType property

Type:
String

Description:
The only valid values are: "SMPP", "VMS", "OTA" or an empty string. Ask your SMPP provider which value to use.


 SystemCharSet property

Type:
Number

Description:
Selected character set. You should leave this property to its default asSMPPCHARSET_DEFAULT, unless special characters (like @[]€^~{}|) are not displayed properly.
You should set the property before you connect to your SMPP SMSC provider.
For a list of valid Character Set values, click here.

Example:
   Set objSmpp                = CreateObject( "ActiveXperts.Smpp" )
   Set objConstants           = CreateObject( "ActiveXperts.SmsConstants" )
   objSmpp.SystemCharSet      = objConstants.asSMPPCHARSET_GSM     ' Change character set
   objSmpp.Connect()
   ...
   objSmpp.Disconnect()

 SystemSourceAddress property

Type:
String

Description:
SMS number associated with your SMPP provider account. It is not always necessary to set the SystemSourceAddress property: some providers will automatically show your associated SMS number on the recipient's phone, but some don't. Also, if you have multiple SMS numbers reserved at your SMPP providers for different purposes, you may want to indicate the right orginator SMS address when sending SMS messages.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.SystemSourceAddress = "+447797882390"           ' ActiveXperts' virtual SMS number at HSL Systems
   ...
   objSmpp.MessageData = "Hello, world!"                   
   objSmpp.MessageRecipient = "+31624896641"              
   ...
   objSmpp.Send()

 SystemSourceTON, SystemSourceNPI, SystemDestinationNPI and SystemDestinationNPI properties

Type:
Number

Description:
'SystemSourceTON' and 'SystemDestinationTON' (Type of Numbering) indicate the type of SMS numbers to use during an SMPP session. Usually, the default value (0, auto-detect) will suffice. If you want to use a different value, you must set it before you call the Connect function. Valid numbers are:
  • 0 - Auto-detect;
  • 1 - International;
  • 2 - National;
  • 3 - Network Specific;
  • 4 - Subscriber Number;
  • 5 - Alphanumeric;
  • 6 - Abbreviated ;
'SystemSourceNPI' and 'SystemDestinationNPI' (Numbering Plan Indicator) indicate which numbering plan to use during an SMPP session. Usually, the default value (0, auto-detect) will suffice. If you want to use a different value, you must set it before you call the Connect function. Valid numbers are:
  • 0 - Auto-detect;
  • 1 - Telephone/ISDN (E163/E164);
  • 3 - Data (X.121);
  • 4 - Telex (F.69) ;
  • 6 - Land Mobile (E.212);
  • 8 - National;
  • 9 - Private;
For more information about Type of Numbering (TON) and Numbering Plan Indicator (NPI), click here: www.activexperts.com/support/activsms/tonnpi.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.SystemSourceTON      = 1                        ' Force International Number format
   objSmpp.SystemDestinationTON = 1                        ' Force International Number format
   objSmpp.SystemSourceNPI      = 1                        ' Force Telephone/ISDN
   objSmpp.SystemDestinationNPI = 1                        ' Force Telephone/ISDN
   objSmpp.Connect()
   ...
   objSmpp.Disconnect()

 ValidityPeriod property

Type:
Number

Description:
Retry period in minutes that the SMPP provider will retry to deliver the message.
When - for instance - the recipient's mobile phone is switched off, it is not able to receive SMS messages. The SMPP provider will retry for a certain time, indicated by the 'ValidityPeriod' property.
Default value: 0, which means that the default SMPP provider's validity period will be used.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Connect()
   ...
   objSmpp.ValidityPeriod = 180                            ' Retry for 180 minutes when message cannot be delivered
   ...
   objSmpp.Send()

 IsConnected property

Type:
Boolean

Description:
Indicates whether a connection to a remote SMPP server is still established or not.
Use it when you have previously connected to the remote SMPP provider. If the connection is still established, 'IsConnected' will be True, otherwise it will be False.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   If( objSmpp.IsConnected = False ) Then
     objSmpp.Connect()
   End If
   ...
   objSmpp.Send()

 MessageSender property

Type:
String

Description:
The Sender address (incoming messages only)

Example:
   Set objSmpp              = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Connect()
   ...
   objSmpp.GetFirstMessage
   While ( objSmpp.LastError = 0 )
     WScript.Echo "Message received, sender: & objSmpp.MessageSender
         ...
     objSmpp.GetNextMessage
   WEnd
   ...
   objSmpp.Disconnect()

 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 Smpp object supports two SMS number formats:
  1. 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

  2. Special service format - To send messages to special services, shortcut numbers etc.
    Use the TON and NPI System Properties to make use of special services or shortcut numbers.

Example:
   Set objSmpp              = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Connect()
   ...
   objSmpp.MessageData      = "Hello, world!"
   objSmpp.MessageRecipient = "+4412345678"                ' Send message to UK recipient 12345678
   ...
   objSmpp.Send()

 MessageType property

Type:
Number

Description:
The Smpp object can send different kind of data, including: plain text, unicode, ringtones and logo's.
The 'MessageType' property specifies 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:

Example: Send a ringtone SMS
   ' Ringtone Data Header contents :
   '   06		Length of header
   '   05		Application Port addressing 16 bit
   '   04		Datalength of information element
   '   15 81  Source Port ( Ringtones supply )
   '   15 81  Dest Port	( Ringtones supply )
   Set objSmpp                   = CreateObject( "ActiveXperts.Smpp" )
   Set objConstants              = CreateObject( "ActiveXperts.SmsConstants" )
   strRingData                   = "06 05 04 15 81 15 81 02 4A 3A 51 D1 95 CD D0 08 00 1B 20 55 05"
   arrRingData                   = Split ( strRingData, " " )
   objSmpp.Server                = "smpp.activexperts-labs.com"
   objSmpp.ServerPort            =  2775
   objSmpp.SystemID              = "AX005"
   objSmpp.SystemPassword        = "812056"
   objSmpp.SystemType            = "SMPP"
   objSmpp.Connect
   If objSmpp.IsConnected = True Then
     For i = 0 To UBound ( ringData ) 
       objSmpp.MessageData        = objSmpp.MessageData & Chr("&H" & arrRingData(i)) ' Create ringtone data
     Next
     objSmpp.MessageType           = objConstants.asMESSAGETYPE_DATA_UDH  ' Data type: User Data
     objSmpp.MessageRecipient      = "+31624896641"                       ' Recipient's mobile number
     objSmpp.Send()                                                       ' Send
     objSmpp.Disconnect()                                                 ' Disconnect
   End If

 MessageServiceType property

Type:
String

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 'MessageServiceType' 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 objSmpp                   = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server                = "..."
   objSmpp.SystemID              = "login"
   objSmpp.SystemPassword        = "password
   objSmpp.SystemType            = "..."
   objSmpp.Connect
   If objSmpp.IsConnected = True Then
     objSmpp.MessageServiceType    = "CMT"
     objSmpp.MessageRecipient      = "+31624896641"                       ' Recipient's mobile number
     objSmpp.Send()                                                       ' Send
     objSmpp.Disconnect()                                                 ' Disconnect
   End If

 MessageData property

Type:
String

Description:
The actual message data; this can be binary data or plain ASCII data (depends on the MessageType property).

Example: Send a plain text SMS
   Set objSmpp            = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server         = "smpp.activexperts.com"
   objSmpp.ServerPort     =  8011
   objSmpp.SystemID       = "8888sdsad"
   objSmpp.SystemPassword = "add34dfa8"
   objSmpp.SystemType     = "SMPP"
   objSmpp.Connect
   
   If objSmpp.IsConnected = True Then
      objSmpp.MessageType      = asMESSAGETYPE_TEXT
      objSmpp.MessageData      = "Hello, world"
      objSmpp.MessageRecipient = "+31624896641"
      objSmpp.Send              ' Send the message
      objSmpp.Disconnect        ' Disconnect 
   End if

 MessageReference property

Type:
Number

Description:
The message ID, assigned by the Send function, can be used after submission to verify delivery of the SMS message. 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. Or maybe the message can't be delivered at all because the recipient number does not exist.
To verify delivery, query the status of this MessageReference using the QueryStatus function.


 StatusCode property

Type:
Number

Description:
This property holds the status of a message that was queried by the QueryStatus function.
Click here for a list of status codes.
For a description of a status code, you can call the GetStatusDescription function.
The StatusTimeSeconds and StatusTime properties hold the time that the status code was updated by the SMPP provider.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   If objSmpp.IsConnected = True Then
     objSmpp.MessageReference  = "FABCFACD" ' A message reference that was a result of a previous submission
     objSmpp.QueryStatus()                  ' Query the status of the message
     If( objSmpp.LastError = 0 )
       WScript.Echo "Status: "             & objSmpp.StatusCode
       WScript.Echo "Status description: " & objSmpp.GetStatusDescription( objSmpp.StatusCode )
       WScript.Echo "Status updated at: "  & objSmpp.StatusTime
       WScript.Echo "Status updated at (in seconds after 1/1/1970): " & objSmpp.StatusTimeSeconds
     End If
   End if

 StatusTimeSeconds and StatusTime properties

Type:
Number

Description:
These properties hold the time that the status code was updated by the SMPP provider.
'StatusTimeSeconds' holds the time in seconds after 1/1/1970, 'StatusTime' shows the time as a friendly string in US date notation.

Example:
      See also StatusCode.



 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store their result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Connect()
   WScript.Echo "LastError: " & objSmpp.LastError

 LogFile property

Type:
String

Description:
By default, 'LogFile' holds an empty string and - as a result - nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output is always appended.

Example:
   Set objSmpp     = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.LogFile = "c:\temp\mylogfile.log"
   objSmpp.Connect()



8.4. Smpp Object - Functions


 Activate function

Description:
This functions activates the SMS and Pager Toolkit product. A valid registration code should be passed as parameter.

Parameters:
  • The registration code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Activate "xxxxx-xxxxx-xxxxx"    ' replace xxxxx-xxxxx-xxxxx by your personal registration code

 Clear function

Description:
This function resets all Properties to their initial, default values.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Send()
   objSmpp.Clear()
   ...
   objSmpp.Send()
   objSmpp.Clear()

 Connect function

Description:
Establish an SMPP connection to the remote SMPP-compliant SMSC provider. Based on TCP/IP.
If you already connected to the SMPP provider, you can simply check if the connection is still established by checking the IsConnected property.
You must first sign-up with an SMPP-compliant SMSC provider before you can connect to it. The function requires a Server and Port specification, as well as a valid SystemID and SystemPassword to log on.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp            = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server         = "smpp.yoursmppprovder.com"  ' DNS name of the remote SMPP provider
   objSmpp.ServerPort     = "8011"                      ' TCP port number
   objSmpp.SystemID       = "yourlogin"                 ' SystemID provided by the SMSC provider
   objSmpp.SystemPassword = "yourpassword"              ' Password provided by the SMSC provider
   ...
   If( objSmpp.IsConnected = False )
     objSmpp.Connect()                                  ' Connect to the remote SMPP provider
   End If

 Disconnect function

Description:
Disconnect a connection that was established by the Connect function.
You can call 'Disconnect' even when there is no connection, to make sure the session gets disconnected.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   If( objSmpp.IsConnected = False )
     objSmpp.Disconnect() 
   End If

 Send function

Description:
Send an SMS message. The contents of the message is indicated by the MessageData and MessageType properties.
You must first connect to the SMPP provider before you actually send the message.
The provider returns a message ID which is stored in the MessageReference property after a successfull submission.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp            = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server         = "smpp.activexperts.com"
   objSmpp.ServerPort     =  8011
   objSmpp.SystemID       = "8888sdsad"
   objSmpp.SystemPassword = "add34dfa8"
   objSmpp.SystemType     = "SMPP"
   objSmpp.Connect
   
   If objSmpp.IsConnected = True Then
   
     objSmpp.MessageData      = "Hello, world (1)"
     objSmpp.MessageRecipient = "+31624896641"
     objSmpp.Send                  ' Send a message
     If( objSmpp.LastError = 0 )
       WScript.Echo "MessageReference: " & objSmpp.MessageReference
     End If
   
     objSmpp.MessageData      = "Hello, world (2)"
     objSmpp.MessageRecipient = "+3162910877"
     objSmpp.Send                  ' Send another message
     If( objSmpp.LastError = 0 )
       WScript.Echo "MessageReference: " & objSmpp.MessageReference
     End If
   
     objSmpp.Disconnect            ' Disconnect
   End if

 QueryStatus function

Description:
Query the status of a message that was successfully submitted by the Send function.
The function querie the messages that is indicated by the MessageReference property. If the function completes successfully (i.e. if the LastError is 0 after the call), you can check the StatusCode property to check the status of the message.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp            = CreateObject( "ActiveXperts.Smpp" )
   objSmpp.Server         = "smpp.activexperts.com"
   objSmpp.ServerPort     =  8011
   objSmpp.SystemID       = "8888sdsad"
   objSmpp.SystemPassword = "add34dfa8"
   objSmpp.SystemType     = "SMPP"

   objSmpp.Connect
   If objSmpp.IsConnected = True Then
   
     objSmpp.MessageReference = "FABCFACD" ' A message ID that was a result of a previous submission
     objSmpp.QueryStatus                   ' Query the status of the message
     If( objSmpp.LastError = 0 )
       WScript.Echo "Status: "             & objSmpp.StatusCode
       WScript.Echo "Status description: " & objSmpp.GetStatusDescription( objSmpp.StatusCode )
        WScript.Echo "Status updated at: " & objSmpp.StatusTime
     End If
     objSmpp.Disconnect        ' Disconnect 
   End if

 Cancel function

Description:
Cancel a message that was previously submitted by the Send function.
The function will only work for SMS message that were not yet delivered to the recipient (i.e. pending at the SMSC provider).

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Connect
   If objSmpp.IsConnected = True Then
     objSmpp.MessageData      = "Hello, world (1)"
     objSmpp.MessageRecipient = "+31624896641"
     objSmpp.Send               ' Send a message
     If( objSmpp.LastError = 0 )
       objSmpp.Cancel           ' Try to cancel the message that has just been sent
     End If
     objSmpp.Disconnect         ' Disconnect 
   End if

 GetFirstMessage and GetNextMessage functions

Description:
Use the 'GetFirstMessage' and 'GetNextMessage' functions to retrieve incoming messages - one by one - from the SMPP provider. Call 'GetFirstMessage' and 'GetNextMessage' as long as LastError is 0.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Connect                          ' Connect to SMPP provider 
   If objSmpp.IsConnected = True Then
     While( True )
       objSmpp.GetFirstMessage()            ' Get frist incoming message - if any 
       While objSmpp.LastError = 0
         WScript.Echo "Message received from " & objSmpp.MessageSender
         WScript.Echo "  Message body: " & objSmpp.MessageData
         ...
         objSmpp.GetNextMessage()           ' Get the next message
       WEnd 
       ...
       objSmpp.Sleep( 5000 )                ' Wait for 5 seconds to check for incoming messages again 
     WEnd
     objSmpp.Disconnect                     ' Disconnect 
   End if

 GetStatusDescription function

Description:
Retrieve the description of a status code.

Parameters:
  • Status code. Click here for a list of valid status codes
Return value:
The status string.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.MessageReference = "FEBBACDA"
   objSmpp.QueryStatus()
   If objSmpp.LastError <> 0 Then
     WScript.Echo "Status code: "      & objSmpp.StatusCode
     WScript.Echo "Status description: " & objSmpp.GetStatusDescription( objSmpp.StatusCode )
   End If

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objSmpp = CreateObject( "ActiveXperts.Smpp" )
   ...
   objSmpp.Send()
   If objSmpp.LastError <> 0 Then
     WScript.Echo "Error description: " & objSmpp.GetErrorDescription( objSmpp.LastError )
   End If






9. DialUp Object


9.1. DialUp Object - Introduction

The DialUp object enables you to send SMS messages using a normal Hayes compatible modem (1200 bps or higher). The modem connects to an SMSC dial-in Service Provider to deliver the SMS message.
You can use the DialUp object to send SMS messages; receiving messages is not supported by the nature of SMSC Service Providers.
The DiaUp object can only send messages one-by-one.

There are many SMSC dial-in service providers around the world; click here for a list of supported SMS providers.

The DialUp object communicates with a normal modem using either a direct COM port, or using a Windows telephony device.
It is recommended to use Windows telephony devices, for instance 'Standard 5600 bps Modem'.
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:
  • Open the Windows Control Panel from the Start menu;
  • Double-click on 'Phone and Modem Options' and select the 'Modems' tab;
  • Select the preferred modem and click on 'Properties'; from here, you can change the settings.
To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:
  • Device - the literal Windows telephony device string, for instance: 'Standard 9600 Modem'.
Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be configured properly before sending messages:
  • Device - The actual COM port, formatted as COMx, where x represents the COM port number;
  • DeviceHwFlowControl - Hardware flow control is used to regulate commands from PC to device and visa versa; default: On;
  • DeviceSwFlowControl - Software flow control is used to regulate data from device to device; default: Off;
  • DeviceSpeed - The speed to be used to communicate with the GSM modem or GSM phone; default: 0 (which means that factory defaults are used for modem communications);
  • DeviceSettings - The number of databits, paritybits and stopbits; default: 8 databits, no parity, 1 stopbit;
  • DeviceInitString - The modem initialization string is used to initialize the modem; default value: '' (which means a generic initialization string will be used).
You can set the Sender address to indicate the originator of the message. (this is different from the GsmOut object, where the Sender address is inherited from the SIM card and - as a result - cannot be overwritten). To set the Sender address, assign the following property:
  • Sender - the SMS address of the sender. Default value: "00000000000"
To indicate the Recipient of the message, you must set the 'MessageRecipient' property:
  • MessageRecipient - the SMS number of the person that should receive the message. The length of the field must be between 4 and 20 digits.
You can only send plain text messages. To send advanced SMS messages (like: flash, multi-part messages, data, ringtones, unicode, etc.) you must use the GsmOut object. This object requires a GSM modem or GSM phone to deliver its messages.

There are two types of SMSC dial-in providers:
  • TAP/XIO providers
  • UCP providers
The DialUp object supports them both. Our list of supported SMSC providers shows the type of provider (TAP/XIO or UDP) for each provider. You must tell the DialUp object what type of provider you are going to dial:
  • ProviderType - type of provider: TAP/XIO or UCP. Default: UCP

Send an SMS message through an SMSC dial-in provider

The following sample demonstrates how to send an SMS message though an SMSC provider. A standard 19200 modem is used to connect to the remote SMSC dial-in provider:
   Set objDialUp                = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device             = "Standard 19200 bps modem"  ' Use a standard modem
   objDialUp.Sender             = "0627308601"                ' Your mobile number (if you have one, otherwise leave it blanc)
   objDialUp.MessageRecipient   = "012345678"                 ' Recipient's mobile number
   objDialUp.MessageText        = "Hello, world !"            ' Message body
   objDialUp.ProviderType       = asPROVIDER_TYPE_UCP         ' Provider is UCP
   objDialUp.ProviderDialString = "0,0653141414"              ' Dial-in number, dial a 0 first
   objDialUp.Send()                                           ' Deliver the message to the provider
   If( objDialUp.LastError <> 0 ) Then
      WScript.Echo "Failed to send message, error: " & objDialUp.LastError
   Else
      WScript.Echo "Message successfully sent"
   End If 
NOTE: As an alternative, "Standard 19200 bps modem" can be replaced by "COM1", assuming that the modem is connected on COM1. However, we recommend to use Windows telephony devices.



9.2. DialUp 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 String In/Out O Identifier string indicating databits, parity and stopbits
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceHwFlowControl Boolean In/Out O Hardware flow control
DeviceSwFlowControl Boolean In/Out O Software flow control
DeviceInitString String In/Out O Initialization string for the device
DialMode Number In/Out O Tone or Pulse. Default: Tone
Sender String In/Out n/a SMS number of the Sender
MessageRecipient String In/Out M SMS number of the Recipient
MessageType Number In/Out O Message type
MessageText String In/Out M The message body
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
Send Deliver the message to the SMSC provider. The SMSC provider will send the SMS message to the recipient
GetErrorDescription Lookup error description of the given error code



9.3. DialUp 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 objDialUp = CreateObject( "ActiveXperts.DialUp" )
   WScript.Echo "Version: " & objDialUp.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 objDialUp = CreateObject( "ActiveXperts.DialUp" )
   WScript.Echo "ExpirationDate: " & objDialUp.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 exact 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 retrieve Windows telephony device names;
  • 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 objDialUp    = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device = "Standard 19200 bps Modem"  ' Use a Windows telephony device (recommended)
Example:
   Set objDialUp    = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.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).
This default is indicated by the asDEVICESETTINGS_DEFAULT value.

To overwrite the default value, assign one of the following values to the 'DeviceSettings' property: The DeviceSettings propery is an important property of the DialUp object. Settings may vary among different providers; therefore it is important to specify the right settings. most dial-in providers require specific settings; see also the online list of SMSC dial-up providers around the world.

NOTE: When assigning 'DeviceSettings' to a Windows telephony device, the settings are overwritten.

Example:
   Set objDialUp                = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device             = "COM3"
   objDialUp.DeviceSettings     = asDEVICESETTINGS_7E1   ' This provider requires 7,e,1
   objDialUp.DeviceSpeed        = 4800                   ' This provider requires 4800 bps
   objDialUp.ProviderDialString = "11223344"
   objDialUp.ProviderType       = asPROVIDERTYPE_UCP     ' This provider supports: UCP
   objDialUp.MessageRecipient   = "0624896641"
   objDialUp.Send()
Example:
   Set objDialUp                = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device             = "COM3"
   objDialUp.DeviceSettings     = asDEVICESETTINGS_8N1  ' This provider requires 8,n,1
   objDialUp.DeviceSpeed        = 4800                  ' This provider requires 4800 bps
   objDialUp.ProviderDialString = "22334455"
   objDialUp.ProviderType       = asPROVIDERTYPE_TAP    ' This provider supports: TAP
   objDialUp.MessageRecipient   = "0624896641"
   objDialUp.Send()

 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 objDialUp             = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device          = "Standard 19200 bps Mode"
   objDialUp.DeviceSpeed     = 4800  ' This will overwrite the Windows telephony device speed

 DeviceHwFlowControl property

Type:
Boolean

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. The default is True; it's very uncommon to change these values for modem communications. 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).
If a Windows telephony device is used (for instance: "Standard 19200 bps modem"), the 'DeviceHwFlowControl' property will be ignored because it is configured through the Control Panel.

Example:
   Set objDialUp                 = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device              = "COM2"
   objDialUp.DeviceHwFlowControl = True

 DeviceSwFlowControl property

Type:
Boolean

Description:
Software flow control regulates communication between communication device and communication device (in this case: modem to modem). Special characters are sent when a modem cannot receive fast enough; in this way handshaking is done. By default, software flow control is disabled. Usually, software flow control is enabled only if data is transmitted from one site to the other. The 'DeviceSwFlowControl' property 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 'DeviceSwFlowControl' will be discarded because it is configured through the Control Panel.

Example:
   Set objDialUp                 = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device              = "COM2"
   objDialUp.DeviceSwFlowControl = False

 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;AT&C1&K0" 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 objDialUp                 = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Device              = "COM1"
   objDialUp.DeviceInitString    = "AT&F;AT&C1&K0"

 DialMode property

Type:
Boolean

Description:
Set the 'DialMode' property to specify 'Tone' or 'Pulse' dialing:

Example:
   Set objConstants   = CreateObject( "ActiveXperts.SmsConstants" )
   Set objDialUp      = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.DialMode = objConstants.asDIALMODE_PULSE  ' Use pulse instead of tone

 Sender property

Type:
String

Description:
The Sender address of the message. Unlike the Sender's address in the GsmOut object, the Sender address is not defined by the SMSC protocol and should be entered manually. The length of the field must be between 4 and 20 digits.
If not assigned, "00000000000" is used.
The 'Sender' property is used by the Send function to indicate the Sender of the message.

Example:
   Set objDialUp                 = CreateObject( "ActiveXperts.DialUp" )
   ...
   objDialUp.Sender              = "0624896641"   ' Overwrite default
   objDialUp.MessageRecipient    = "004412345678"
   objDialUp.Send()

 MessageRecipient property

Type:
String

Description:
The Recipient address, which means: the SMS number of the person that should receive the message.
Be aware of the different requirements of service providers. If you want to send an SMS message to 12345678 in the UK, some providers require 12345678, while others require 4412345678 or 004412345678. Basically, you should use the format:
    4412345678 (assuming 44 is the country code and 12345678 is the recipient number without leading 0).

Example:
   Set objDialUp              = CreateObject( "ActiveXperts.DialUp" )
   ...
   objDialUp.MessageRecipient = "004412345678"
   objDialUp.Send()

 MessageType property

Type:
String

Description:
The message type. The DialUp object only supports plain text messages, so the only valid value is asMESSAGETYPE_TEXT. This is also the default valuel. To send unicode messages, flash messages, ringtones and other types of messages, you must use the GsmOut object.

Example:
   Set objDialUp         = CreateObject( "ActiveXperts.DialUp" )
   ...
   objDialUp.MessageType = asMESSAGETYPE_TEXT  ' plain text is the only supported format
   objDialUp.MessageText = "Hello, world!"
   objDialUp.Send()

 MessageText property

Type:
String

Description:
The body text of the message. It can contain up to 160 characters. Unicode characters are NOT allowed. To send unicode message, you must use the GsmOut object object.

Example:
   Set objDialUp                 = CreateObject( "ActiveXperts.DialUp" )
   ...
   objDialUp.MessageText         = "Hello, world!"
   objDialUp.Send()

 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store their result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Receive()
   WScript.Echo "LastError: " & objDialUp.LastError

 LogFile property

Type:
String

Description:
By default, LogFile holds the empty string and nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output is always appended.

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.LogFile = "c:\temp\mylogfile.log"
   objDialUp.Receive()


9.4. DialUp Object - Functions


 Activate function

Description:
This functions activates the SMS and Pager Toolkit product. A valid registration code should be passed as parameter.

Parameters:
  • The registration code
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Activate "xxxxx-xxxxx-xxxxx"    ' replace xxxxx-xxxxx-xxxxx by your personal registration code.

 Clear function

Description:
This function resets all Properties to their initial, default values.

Parameters:
  • None
Return value:
Always 0. Check LastError property to see if the function was completed successfully

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Receive()
   objDialUp.Clear()
   objDialUp.Receive()
   objDialUp.Clear()

 GetDeviceCount function

Description:
Returns the number of installed Windows telephony devices on the local computer.

Parameters:
  • None
Return value:
The number of installed Windows telephony devices. Check the LastError property to see if the function was completed successfully.

NOTE: The number of Windows telephony devices does not include the number installed COM ports.

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   WScript.Echo "Number of installed Windows telephony devices: " & objDialUp.GetDeviceCount()

 GetDevice function

Description:
Returns the n-th Windows telephony device of the system. The number n can be between 0 and GetDeviceCount()-1.

Parameters:
  • Zero based index, to iterate over all Windows telephony devices.
Return value:
The name of the device. Call the LastError function to see if the function was completed successfully.
The name of the device can be assigned to the Device property to open a Windows telephony device.

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   n = objDialUp.GetDeviceCount()
   For i = 0 to n-1
      WScript.Echo "Device " & i & ": " & objDialUp.GetDevice( i )
   Next
Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   If( objDialUp.GetDeviceCount() > 0 )
      objDialUp.Device = objDialUp.GetDevice( 0 )  ' Use the first Windows telephony device
      objDialUp.Send()
   End If

 Send function

Description:
Deliver the SMS message to the SMSC provider. The provider will send the actual SMS to the recipient

Parameters:
  • None
Return value:
Always 0. Check the LastError property to see if the function was completed successfully

Example:
   Set objDialUp                = CreateObject( "ActiveXperts.DialUp" )
   Set objConstants             = CreateObject( "ActiveXperts.SmsConstants" )
   objDialUp.Device             = "COM3"
   objDialUp.DeviceSettings     = objConstants.asDEVICESETTINGS_7E1  ' The provider requires 7,e,1
   objDialUp.DeviceSpeed        = 4800                               ' Provider requires 4800 bps
   objDialUp.ProviderDialString = "11223344"
   objDialUp.ProviderType       = asPROVIDERTYPE_UCP                 ' Provider type: UCP
   objDialUp.MessageRecipient   = "0624896641"
   objDialUp.Send()

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objDialUp = CreateObject( "ActiveXperts.DialUp" )
   objDialUp.Send()
   If objDialUp.LastError <> 0 Then
      WScript.Echo "Error description: " & objDialUp.GetErrorDescription( objDialUp.LastError )
   End If





10. Pager Object


10.1. Pager Object - Introduction

The Pager object enables you to send pager messages using a normal Hayes compatible modem (1200 bps or higher). The modem connects to the remote pager directly.

The Pager object communicates with a normal modem using either a direct COM port, or using a Windows telephony device.
It is recommended to use Windows telephony devices, for instance 'Standard 5600 bps Modem'.
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:
  • Open the Windows Control Panel from the Start menu;
  • Double-click on 'Phone and Modem Options' and select the 'Modems' tab;
  • Select the preferred modem and click on 'Properties'; from here, you can change the settings.
To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:
  • Device - the literal Windows telephony device string, for instance: 'Standard 9600 Modem'.
Send a Pager message

The following sample demonstrates how to send a Pager message:
   Set objPager              = CreateObject( "ActiveXperts.Pager" )
   objPager.Device           = "Standard 19200 bps modem"  ' Use a standard modem
   objPager.MessageRecipient = "0742781722,,66#"           ' Pager recipient: 0742781722, extension number 66
   objPager.Send()                                         ' Deliver the message to the recipient
   If( objPager.LastError <> 0 ) Then
      WScript.Echo "Failed to send message, error: " & objPager.LastError
   Else
      WScript.Echo "Message successfully sent"
   End If 
NOTE: As an alternative, "Standard 19200 bps modem" can be replaced by "COM1", assuming that the modem is connected on COM1. However, we recommend to use Windows telephony devices.



10.2. Pager 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 indicating databits, parity and stopbits
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceHwFlowControl Boolean In/Out O Hardware flow control
DeviceSwFlowControl Boolean In/Out O Software flow control
DeviceInitString String In/Out O Initialization string for the device
DialMode Number In/Out O Tone or Pulse. Default: Tone
MessageRecipient String In/Out M Recipient number
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
Send Deliver the message to the SMSC provider. The SMSC provider will send the SMS message to the recipient
GetErrorDescription Lookup error description of the given error code


10.3. Pager Object - Properties

Most of the properties of the 'Pager' object are identical to the properties of the 'DialUp' object. A description of these properties can be found here. The Pager specific properties are described below.


 DialMode property

Type:
Number

Description:
Set the 'DialMode' property to specify 'Tone' or 'Pulse' dialing:

Example:
   Set objPager              = CreateObject( "ActiveXperts.Pager" )
   Set objConstants          = CreateObject( "ActiveXperts.SmsConstants" )
   objPager.DialMode         = objConstants.asDIALMODE_PULSE  ' Use pulse instead of tone

 MessageRecipient property

Type:
String

Description:
The Recipient address specifies the number to be dialed. Use a comma [,] character to specify a pause, and a pound [#] character to indicate the termination of the recipient string.

Example:
   Set objPager              = CreateObject( "ActiveXperts.Pager" )
   Set objConstants          = CreateObject( "ActiveXperts.SmsConstants" )
   ...
   objPager.MessageRecipient = "0742781722,,66#"  ' Send a pager message to 0742781722, extension number 66
   objPager.Send()

 TimeOut property

Type:
Number

Description:
The number of seconds the Send function will wait before it will timeout.
Default value: 60 seconds.

Example:
   Set objPager              = CreateObject( "ActiveXperts.Pager" )
   Set objConstants          = CreateObject( "ActiveXperts.SmsConstants" )
   ...
   objPager.TimeOut          = 120                ' Timeout after 120 seconds
   objPager.MessageRecipient = "0742781722,,66#"  ' Send a pager message to 0742781722, extension number 66
   objPager.Send()


10.4. Pager - Functions

Most of the functions of the 'Pager' object are identical to the properties of the 'DialUp' object. A description of these functions can be found here. The Pager specific functions are described below.


 Send function

Description:
Send a pager message to the recipient.

Parameters:
  • None
Return value:
Always 0. Check the 'LastError' property to see if the function was completed successfully

Example:
   Set objPager              = CreateObject( "ActiveXperts.Pager" )
   objPager.Device           = "COM3"
   objPager.MessageRecipient = "0624896641"
   objPager.Send()
   If( objPager.LastError <> 0 ) Then 
      WScript.Echo "Error description: " & objPager.GetErrorDescription( objPager.LastError )
   End If




11. WapPush and WapBookmark objects


11.1. Introduction

WAP Push messages are specially formatted SMS messages that display an alert message to the user, and give the user the option of connecting directly to a particular URL via the mobile phone’s WAP browser.

The WAP specifications define a format for applications to create XML-based "PAP" (Push Access Protocol) documents that can be posted to an operator’s “PPG” (Push Proxy Gateway), in order to deliver a WAP Push message to a mobile device. The complexity of the WAP format has made it difficult for developers to deploy WAP Push in their applications in the past.

The SMS and Pager Toolkit makes it easy to generate and deliver WAP Push messages. You can send WAP Push messages using a GSM modem (or GSM phone), or using an SMPP messages. Use the WapPush object to format the message of the SMS, and use the regular GsmOut or Smpp functions to send the Wap Push formatted message.

Sending Wap Bookmarks is just like sending Wap Push messages: use the WapBookmark object to encode the Wap Bookmark message, and send out this meessage using GsmOut or Smpp.


Send a WAP Push message using a GSM modem

The following sample demonstrates how to send a WAP Push message:
   Set objWapPush                 = CreateObject ( "ActiveXperts.WapPush" )
   Set objGsmOut                  = CreateObject ( "ActiveXperts.GsmOut" )
   Set objConstants               = CreateObject ( "ActiveXperts.SmsConstants" )

   ' Encode Wap Message
   objWapPush.URL                 = "http://wap.yahoo.com"
   objWapPush.Description         = "WAP Push"
   objWapPush.SignalAction        =  objConstants.asWAPPUSHSIGNAL_MEDIUM

   nParts = objWapPush.Encode
   WScript.Echo "Encoding WAP Push, result:" & objWapPush.LastError & " ( " & _
                 objWapPush.GetErrorDescription( objWapPush.LastError ) & ")"
   If( objWapPush.LastError <> 0 ) Then
      WScript.Quit
   End If


   ' Initialize SMS and Pager toolkit
   objGsmOut.Device            = "COM1"
   objGsmOut.MessageRecipient  = "+31625044454"                       ' Mobile number
   objGsmOut.MessageType       =  objConstants.asMESSAGETYPE_DATA_UDH ' Data + UDH messagetype
   objGsmOut.LogFile           = "c:\WapPushDemo.txt"                 ' Logfile

   ' Send the message
   i = 0
   While( i < nParts And objGsmOut.LastError = 0 )
      objGsmOut.MessageData = objWapPush.GetMessagePart( i )
      objGsmOut.Send
      WScript.Echo "Sending part " & i + 1 & " of " & nParts & ", result: " & _
                   objGsmOut.LastError & " (" & objGsmOut.GetErrorDescription( objGsmOut.LastError ) & ")"
      i = i + 1
   WEnd
   NOTE: You can also use SMPP instead of GSM to send out the WAP Push message.

WAP Bookmarks are like WAP Push messages: they are special "WAP" formatted messages. You can use the WapBookmark object to format the message as a Wap Bookmark, use the regular GsmOut or Smpp functions to send the Wap Push formatted message.


Send a WAP Bookmark message using a GSM modem

The following sample demonstrates how to send a WAP Bookmark message:
   Set objWapBookmark         = CreateObject ( "ActiveXperts.WapBookmark" )
   Set objGsmOut              = CreateObject ( "ActiveXperts.GsmOut" )
   Set objConstants           = CreateObject ( "ActiveXperts.SmsConstants" )

   objWapBookmark.URL         = "http://www.activexperts.com"
   objWapBookmark.Description = "ActiveXperts"

   objGsmOut.Device           = "COM1"
   objGsmOut.MessageRecipient = "+31647134225"
   objGsmOut.MessageType      =  objConstants.asMESSAGETYPE_DATA_UDH
   objGsmOut.LogFile          = "c:\WapBookmarkDemo.txt"

   nParts = objWapBookmark.Encode
   WScript.Echo "Encoding WAP Bookmark, result: " & objWapBookmark.LastError & " ( " & _
                 objWapBookmark.GetErrorDescription( objWapBookmark.LastError ) & ")"

   If( objWapBookmark.LastError <> 0 ) Then
      WScript.Quit
   End If

   i = 0
   While( i < nParts And objGsmOut.LastError = 0 )
     
      objGsmOut.MessageData = objWapBookmark.GetMessagePart ( i )
      objGsmOut.Send
      WScript.Echo "Sending part " & i + 1 & " of " & nParts & ", result: " & _
                   objGsmOut.LastError & " (" & objGsmOut.GetErrorDescription( objGsmOut.LastError ) & ")"
      i = i + 1
   WEnd
   NOTE: You can also use SMPP instead of GSM to send out the WAP Bookmark message.


11.2. WapPush Object - Overview of Properties and Functions


Property Type In/Out Mand/Opt Description
URL String In/Out M The URL to push
Description String In/Out M Description text, as it will appear on the recipient's mobile phone
SignalReference String In/Out O Reference that can be used to delete the message at a later stage
SignalAction Number In/Out O Priority of the WAP Push message
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode the WAP Push message
GetMessagePart Get an encoded data block (140 bytes)
GetErrorDescription Lookup error description of the given error code



11.3. WapPush Object - Properties


 URL property

Type:
String

Description:
The URL that you want to push to the recipient's mobile phone

Example:
   Set objWapPush         = CreateObject( "ActiveXperts.WapPush" )
   objWapPush.URL         = "http://wap.yahoo.com"
   objWapPush.Description = "..."
   ...

 Description property

Type:
String

Description:
The Description text, as it will appear on the recipient's mobile phone.

Example:
   Set objWapPush         = CreateObject( "ActiveXperts.WapPush" )
   objWapPush.URL         = "http://wap.yahoo.com"
   objWapPush.Description = "This is a WAP Push message"
   ...

 SignalReference property

Type:
String

Description:
Reference that can be used to delete the message at a later stage.
You can assign any alpha-numeric string to it.

Example: High priority WAP Push message
   Set objWapPush             = CreateObject( "ActiveXperts.WapPush" )
   Set objSmsConstants        = CreateObject( "ActiveXperts.SmsConstants" )
   ...
   objWapPush.URL             = "http://wap.yahoo.com"
   objWapPush.Description     = "This is a WAP Push message"
   objWapPush.SignalReference = "0000A0"
   ...
   objWapPush.Encode
   ...

 SignalAction property

Type:
Number

Description:
The type of WAP Push action. Either defines a message priority, or a delete action.
Click here for a list of valid signal actions.

Example: High priority WAP Push message
   Set objWapPush          = CreateObject( "ActiveXperts.WapPush" )
   Set objSmsConstants     = CreateObject( "ActiveXperts.SmsConstants" )
   ...
   objWapPush.URL          = "http://wap.yahoo.com"
   objWapPush.Description  = "This is a WAP Push message"
   objWapPush.SignalAction = objSmsConstants.asWAPPUSHSIGNAL_HIGH
   ...
   objWapPush.Encode
   ...

 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store their result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

Click here to read more about SMS and Pager Toolkit Error Codes.

Example:
  Set objWap = CreateObject( "ActiveXperts.WapPush" )
  ...
  objWap.Encode()
  WScript.Echo "LastError: " & objWap.LastError

11.4. WapPush - Functions


 Encode function

Description:
Encode a WAP Push message, so that it can be assigned to Smpp's MessageData property or GsmOut's MessageData property. The 'Encode' function returns a number; this number indicates the number of 140-byte parts. Call GetMessagePart to retrieve a data block of 140 bytes

Parameters:
  • None
Return value:
Number of 140 bytes data blocks, produced by the encoding algorithm. Check the 'LastError' property to see if the function was completed successfully

Example:
   Set objWapPush = CreateObject( "ActiveXperts.WapPush" )
   ...
   nParts = objWapPush.Encode()
   If( objWapPush.LastError = 0 ) Then
      WScript.Echo "Number of data blocks produced by the encoding algorithm: " & objWapPush.LastError
   End If

 GetMessagePart function

Description:
This function retrieves a 140-byte data block.
The Encode function encodes a stream of WAP message data, and stores 140 bytes data blocks in an internal data queue. The 'GetMessagePart' function retrieves such a data block.

Parameters:
  • Index - zero based index in the internal data queue
Return value:
Data block

Example:
   Set objWapPush = CreateObject( "ActiveXperts.WapPush" )
   ...
   nParts = objWapPush.Encode()
   If( objWapPush.LastError = 0 ) Then
      For i = 0 To nParts - 1
        WScript.Echo objWapPush.GetMessagePart( i )
      Next
   End If

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objWapPush = CreateObject( "ActiveXperts.WapPush" )
   ...
   nParts = objWapPush.Encode()
   WScript.Echo "Result: " & objWapPush.GetErrorDescription( objWapPush.LastError )


11.5. WapBookmark Object - Overview of Properties and Functions


Property Type In/Out Mand/Opt Description
URL String In/Out M The URL to set as bookmark
Description String In/Out M Description text, as it will appear on the recipient's mobile phone
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode the WAP Bookmark message
GetMessagePart Get an encoded data block (140 bytes)
GetErrorDescription Lookup error description of the given error code



11.6. WapBookmark Object - Properties


 URL property

Type:
String

Description:
The URL that you want to set as bookmark on the recipient's mobile phone

Example:
   Set objWapBookmark         = CreateObject( "ActiveXperts.WapBookmark" )
   objWapBookmark.URL         = "http://www.activexperts.com"
   objWapBookmark.Description = "..."
   ...

 Description property

Type:
String

Description:
The Description text, as it will appear on the recipient's mobile phone.

Example:
   Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" )
   objWapBookmark.URL          = "http://www.activexperts.com"
   objWapBookmark.Description  = "ActiveXperts Software - Home Page"
   ...

 LastError property

Type:
Number

Description:
The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) will store their result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

Click here to read more about SMS and Pager Toolkit Error Codes.

Example:
  Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" )
  ...
  objWapBookmark.Encode()
  WScript.Echo "LastError: " & objWapBookmark.LastError


11.7. WapBookmark - Functions


 Encode function

Description:
Encode a WAP Bookmark message, so that it can be assigned to Smpp's MessageData property or GsmOut's MessageData property. The 'Encode' function returns a number; this number indicates the number of 140-byte parts. Call GetMessagePart to retrieve a data block of 140 bytes

Parameters:
  • None
Return value:
Number of 140 bytes data blocks, produced by the encoding algorithm. Check the 'LastError' property to see if the function was completed successfully

Example:
   Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" )
   ...
   nParts = objWapBookmark.Encode()
   If( objWapBookmark.LastError = 0 ) Then
      WScript.Echo "Number of data blocks produced by the encoding algorithm: " & nParts
   End If


 GetMessagePart function

Description:
This function retrieves a 140-byte data block.
The Encode function encodes a stream of WAP message data, and stores 140 bytes data blocks in an internal data queue. The 'GetMessagePart' function retrieves such a data block.

Parameters:
  • Index - zero based index in the internal data queue
Return value:
Data block

Example:
   Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" )
   ...
   nParts = objWapBookmark.Encode()
   If( objWapBookmark.LastError = 0 ) Then
      For i = 0 To nParts - 1
        WScript.Echo objWapBookmark.GetMessagePart( i )
      Next
   End If

 GetErrorDescription function

Description:
Function to retrieve the explanation of an error code.

Parameters:
  • Error code.
Return value:
The Error string.

Example:
   Set objWapBookmark = CreateObject( "ActiveXperts.WapBookmark" )
   ...
   nParts = objWapBookmark.Encode()
   WScript.Echo "Result: " & objWapBookmark.GetErrorDescription( objWap.LastError )





12. Samples

Samples for Visual Basic, Visual Basic .NET, Visual C++, Visual C# .NET, ASP and VBScript are included as part of the installation. You can also find the samples on our website at http://www.activexperts.com/activsms/samples/.





13. Troubleshooting


FAQ's

Visit our website for a complete list of FAQ's at:
    http://www.activexperts.com/support


Contact us

Please contact our website for support questions about this product, or send an email to our support-staff:

Website: http://www.activexperts.com/support
Email: support@activexperts.com




14. License Agreement

You should carefully read the following terms and conditions before using this software. Your use of this software indicates your acceptance of this license agreement and warranty.

Shareware Version

You are hereby licensed to:
Use the shareware version of the software for a 30 day evaluation period; make as many copies of the unregistered shareware version of this software as you wish; give exact copies of the original unregistered shareware version to anyone; and distribute the unregistered shareware version of the software in its unmodified form via electronic means. There is no charge for any of the above.
The software may be not be sold for a fee on diskette or CD-ROM, either alone or as part of a collection with other products, without prior permission of ActiveXperts Software. (with the exception of magazine cover CD-ROMs that are sold with a magazine, which require no permission).
Unregistered use of ActiveXperts software after the 30-day evaluation period is in violation of federal copyright laws.


Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program. ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.

Copyright 1999-2003 ActiveXperts software. http://www.activexperts.com




15. Purchase and Product Activation


Purchase

Please visit www.activexperts.com/sales to buy the product. Here, you can also find the latest prices.

You can also contact us via email: sales@activexperts.com

After you purchase the product, you will receive your product registration key.


Product Activation

After you purchase the product, you will receive a registration code. This code must be entered in the registry on your machine(s). There are three ways to accomplish this:


1. Automatic installation

The SMS & Pager Toolkit automatic installation performs all necessary steps to install and register the component. It will ask for the registration code during installation and will enter the registration code in the registry.


2. 'Activate' function

You can use the Activate function of any of the objects:, for instance

   Set objGsmOut = CreateObject("ActiveXperts.GsmOut")
   objGsmOut.Activate "<your registrationkey>"
If you prefer, you can also use the Activate function of the GsmIn, SMPPm Dialup or Pager objects.
The Activate function of any of the objects writes the following entry to the registry, which will actually activate the product:
    Key: HKEY_LOCAL_MACHINE\Software\ActiveXperts\SMS and Pager Toolkit\RegistrationKey  Type: REG_SZ  Value: XXXXX-XXXXX-XXXXX
where 'XXXXX-XXXXX-XXXXX' is the registration code issued to you.


3. Manually insert code in the registry

You can activate the product by editing the registry manually:
  1. Start the registry editor (either REGEDT32.EXE or REGEDIT.EXE);
  2. Open the 'HKEY_LOCAL_MACHINE\Software\ActiveXperts\SMS and Pager Toolkit' key;
  3. Add/modify the 'RegistrationKey' value: Type: REG_SZ, Value: XXXXX-XXXXX-XXXXX