ℹ️ The Auron SMS Server is now Auron Omni. Learn more here.

How can we help?

AxSms.SmppSession


Introduction

Skip to properties and methods

The SmppSession object represents an SMPP client connected to the SmppServer. The client can be in one of these states: Connected, Binding, Bound, or Disconnected. You can only obtain a valid connected SmppSession object through the SmppServer.

Use SmppSession instances to send SMS messages to and receive SMS messages from SMPP clients that are connected to your SMPP server.

To connect to an existing SMPP server, use the Smpp object instead.

Properties and Methods

Property Type Read/Write Description
LastError Number Read Result of the last called method
LogFile String Read/Write The path to a logfile for troubleshooting
LogPduDetails Boolean Read/Write Enable detailed PDU logging
LogLevel Integer Read/Write Set how much information will be logged
Id Number Read The ID for this session
Ip String Read The IP address of the remote client
Port Number Read The port number of the remote client
Version Number Read The SMPP version of the remote client
SystemId String Read The system ID of the remote client
Password String Read The password of the remote client
SystemType String Read The system type of the remote client
AddressRange String Read The address range of the remote client
AddressRangeNpi Number Read The address range NPI of the remote client
AddressRangeTon Number Read The address range TON of the remote client
ConnectionState Number Read The connection state for this session
IsConnected Boolean Read Whether the SMPP session is connected
IsBound Boolean Read Whether the SMPP session is bound
RequestedBind Number Read The bind type this client requested
PduTimeout Number Read/Write Number of milliseconds before an outstanding PDU times out
EnquireInterval Number Read/Write Number of milliseconds between enquire commands
MultipartTimeout Number Read/Write Number of seconds before an incomplete multipart message is returned
UseGsmEncoding Number Read/Write Use GSM encoding for text messages
MultipartMode Number Read/Write Specify how multipart messages should be sent
ExtractApplicationPort Boolean Read/Write Whether the application port is extracted from the message
ExtractLanguageShift Boolean Read/Write Whether language shift tables should be applied
DeliverMode Number Read/Write Specify how SMS messages should be submitted to the client
SmsSentPerSecond Number Read Number of SMS messages sent per second
SmsReceivedPerSecond Number Read Number of SMS messages received per second
MaxSmsDeliveries Number Read/Write Maximum size of the SMS delivery queue
MaxSmsSubmission Number Read/Write Maximum size of the SMS submission queue
MaxSmsQueries Number Read/Write Maximum size of the SMS query queue
MaxOutPendingPdus Number Read/Write Maximum number of outstanding PDUs

Method Description
GetErrorDescription Get the description of the given error
RespondToBind Respond to a bind request
GetFirstBindTlv Get the first TLV from the last bind request
GetNextBindTlv Get the next TLV from the last bind request
GetBindTlv Get a specific TLV from the last bind request
RespondToSubmitSms Respond to an SMS submission
ReceiveSubmitSms Receive an SMS submission
RespondToQuerySms Respond to an SMS query
ReceiveQuerySms Receive an SMS Query request
DeliverSms Deliver an SMS message to the remote client
DeliverReport Deliver a delivery report to the remote client
ReceiveDeliverResponse Receive a response on an SMS delivery or delivery report
Disconnect Disconnect this session
CountSmsSubmissions Count the number of received SMS messages in the submission queue
CountSmsQueries Count the number of received SMS queries in the query queue
CountSmsDeliverySpace Count the space available in the delivery queue
FetchNotResponded Fetch a message that was delivered but received no response
FetchNotDelivered Fetch a message that was submitted but not delivered to the client
GetFirstPart Split a multipart message and get the first part
GetNextPart Get the next part of a split multipart message
CountParts Count the number of parts required for a message
AssembleSms Assemble a multipart SMS from its parts
GetAssembledSms Get the first available assembled SMS

LastError property

Completion code of the last called method. To see the description of an error code, visit the online error codes page.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objMessage = New-Object -ComObject AxSms.Message
  $objMessage.ToAddress = "+31122334455"
  $objMessage.FromAddress = "+35544332211"
  $objMessage.Body = "Hello from the Auron Gateway !"
  $objMessage.UserTag = 1 # To identify this message when the client responds
  $objSmppSession.DeliverSms($objMessage)
  if ($objSmppSession.LastError -ne 0) {
    Write-Host ("Error while delivering: " + `
      $objSmppSession.GetErrorDescription($objSmppSession.LastError))
    exit 1
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var objMessage = new AxSms.Message();
  objMessage.ToAddress = "+31122334455";
  objMessage.FromAddress = "+35544332211";
  objMessage.Body = "Hello from the Auron Gateway !";
  objMessage.UserTag = 1; // To identify this message when the client responds
  objSmppSession.DeliverSms(objMessage);
  if (objSmppSession.LastError != 0)
  {
    Console.WriteLine("Error while delivering: " + 
      objSmppSession.GetErrorDescription(objSmppSession.LastError));
    Environment.Exit(1);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  Set objMessage = CreateObject("AxSms.Message")
  objMessage.ToAddress = "+31122334455"
  objMessage.FromAddress = "+35544332211"
  objMessage.Body = "Hello from the Auron Gateway !"
  objMessage.UserTag = 1 ' To identify this message when the client responds
  objSmppSession.DeliverSms objMessage
  If objSmppSession.LastError <> 0 Then
    WScript.Echo "Error while delivering: " & _
      objSmppSession.GetErrorDescription(objSmppSession.LastError)
    WScript.Quit 1
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

LogFile property

By default LogFile is empty and nothing is logged. Assign a valid filename to write debug information. New data is appended to the file.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

LogPduDetails property

SMPP protocol primitives are called Protocol Data Units (PDUs). Set this property to true to log a detailed description of every PDU sent or received, including a HEX dump.

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogPduDetails = $true
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogPduDetails = true;
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogPduDetails = True
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

LogLevel property

The log level determines how much information is written to the logfile when logging is enabled. Use one of these constants.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogLevel = $objConstants.SMPP_LOGLEVEL_VERBOSE
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogLevel = objConstants.SMPP_LOGLEVEL_VERBOSE;
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogLevel = objConstants.SMPP_LOGLEVEL_VERBOSE
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Id property

The unique ID for this session. A new ID is assigned automatically when a session connects. Use this ID to identify the session in the SmppServer.

IDs for disconnected sessions are not reused until the value wraps around the maximum of an unsigned 32-bit integer (4,294,967,295).

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Session Id: " + $objSmppSession.Id)
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Session Id: " + objSmppSession.Id);
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Session Id: " & objSmppSession.Id
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Ip property

The IP address of the remote client. This can be either an IPv4 or IPv6 address, depending on how the SMPP server was started.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Port property

The port number of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Version property

The SMPP version used by the remote client. One of these constants.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SMPP Version: " + $objSmppSession.Version)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SMPP Version: " + objSmppSession.Version);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SMPP Version: " & objSmppSession.Version
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

SystemId property

The system ID of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Password property

The password of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    if ($objSmppSession.Password -eq "Secret") {
      $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
      $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
    } else {
      $objSmppSession.RespondToBind($objConstants.SMPP_ESME_RINVPASWD)
    }
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    if (objSmppSession.Password == "Secret")
    {
      objSmppSession.LogFile = objSmppSession.SystemId + ".log";
      objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
    }
    else
    {
      objSmppSession.RespondToBind(objConstants.SMPP_ESME_RINVPASWD);
    }
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    If objSmppSession.Password = "Secret" Then 
      objSmppSession.LogFile = objSmppSession.SystemId & ".log"
      objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
    Else
      objSmppSession.RespondToBind objConstants.SMPP_ESME_RINVPASWD
    End If
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

SystemType property

The system type of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

AddressRange property

The address range of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

AddressRangeNpi property

The address range NPI (Numbering Plan Indicator) of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    Write-Host ("AddressRange NPI: " + $objSmppSession.AddressRangeNpi)
    Write-Host ("AddressRange TON: " + $objSmppSession.AddressRangeTon)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    Console.WriteLine("AddressRange NPI: " + objSmppSession.AddressRangeNpi);
    Console.WriteLine("AddressRange TON: " + objSmppSession.AddressRangeTon);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    WScript.Echo "AddressRange NPI: " & objSmppSession.AddressRangeNpi
    WScript.Echo "AddressRange TON: " & objSmppSession.AddressRangeTon
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

AddressRangeTon property

The address range TON (Type of Number) of the remote client.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    Write-Host ("AddressRange NPI: " + $objSmppSession.AddressRangeNpi)
    Write-Host ("AddressRange TON: " + $objSmppSession.AddressRangeTon)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    Console.WriteLine("AddressRange NPI: " + objSmppSession.AddressRangeNpi);
    Console.WriteLine("AddressRange TON: " + objSmppSession.AddressRangeTon);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    WScript.Echo "AddressRange NPI: " & objSmppSession.AddressRangeNpi
    WScript.Echo "AddressRange TON: " & objSmppSession.AddressRangeTon
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

ConnectionState property

The current connection state for this session. One of these constants.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

IsConnected property

True while the session is connected to the client. Becomes false when the connection is interrupted or Disconnect is called.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if (-not $objSmppSession.IsConnected) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (!objSmppSession.IsConnected)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If Not objSmppSession.IsConnected Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

IsBound property

True while the session is bound to the client. Becomes false when the client unbinds, disconnects, or the connection is interrupted.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if (-not $objSmppSession.IsBound) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (!objSmppSession.IsBound)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If Not objSmppSession.IsBound Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

RequestedBind property

If the client requested a bind, this property contains the requested bind type. One of these constants.

This property is only meaningful when ConnectionState is SMPP_SESSIONSTATE_BINDING.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

PduTimeout property

The number of milliseconds the remote client has to respond to a PDU before the connection is closed.

Default is 5000 milliseconds.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

EnquireInterval property

The number of milliseconds between enquire_link commands sent to keep the connection alive.

Default is 30000 milliseconds.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

MultipartTimeout property

The number of seconds the session waits for a multipart message to complete. If not all parts arrive in time, the message is returned anyway.

Missing parts are marked with ‘**Missing Part!**’ and the Incomplete property is set to true.

This setting applies to AssembleSms and GetAssembledSms.

Default is 300 seconds.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

UseGsmEncoding property

Determines whether GSM encoding is used for incoming or outgoing text messages. Use one of these constants.

This only applies when the DataCoding property is DATACODING_DEFAULT.

Default is SMPP_USEGSMENCODING_DISABLED.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

MultipartMode property

In combination with the multipart flag this property controls how multipart messages are formatted when sent automatically.

This setting does not affect how incoming multipart messages are received. Incoming messages using UDH, SAR TLV, or Payload TLV are always recognized correctly.

Default is SMPP_MULTIPARTMODE_UDH.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

ExtractApplicationPort property

This property affects incoming SMS messages that contain an application port. For example, WAP Push messages use destination port 2948.

When true, the component appends the source port to FromAddress and the destination port to ToAddress (separated by ‘:’) and removes the port header.

When false, the port header stays in the message and is not added to the address fields.

Default is true.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

ExtractLanguageShift property

Controls whether national language shift tables are applied to incoming messages that include a language shift UDH.

When true, the UDH is removed and the appropriate national language tables are used automatically.

When false, the UDH remains and the message is returned as HEX.

To send messages using language shift tables, use the LanguageLockingShift and LanguageSingleShift properties on the Message object.

Make sure UseGsmEncoding is set to 7-bit or 8-bit for language shift tables to work on incoming messages.

Default is true.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
    $objSmppSession.ExtractLanguageShift = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
    objSmppSession.ExtractLanguageShift = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
    objSmppSession.ExtractLanguageShift = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

DeliverMode property

Determines how SMS messages are delivered to the client.

If SMPP_DELIVERMODE_DATASM is selected, set MultipartMode to SMPP_MULTIPARTMODE_PAYLOADTLV.

Incoming messages (data_sm or submit_sm) are always received regardless of this setting.

Default is SMPP_DELIVERMODE_SUBMITSM.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    
    $objSmppSession.PduTimeout = 10000
    $objSmppSession.EnquireInterval = 30000
    $objSmppSession.MultipartTimeout = 300000
    $objSmppSession.UseGsmEncoding = $objConstants.SMPP_USEGSMENCODING_INANDOUT
    $objSmppSession.MultipartMode = $objConstants.SMPP_MULTIPARTMODE_UDH
    $objSmppSession.DeliverMode = $objConstants.SMPP_DELIVERMODE_DELIVERSM
    $objSmppSession.ExtractApplicationPort = $true
  
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    
    objSmppSession.PduTimeout = 10000;
    objSmppSession.EnquireInterval = 30000;
    objSmppSession.MultipartTimeout = 300000;
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT;
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH;
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM;
    objSmppSession.ExtractApplicationPort = true;
  
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    
    objSmppSession.PduTimeout = 10000
    objSmppSession.EnquireInterval = 30000
    objSmppSession.MultipartTimeout = 300000
    objSmppSession.UseGsmEncoding = objConstants.SMPP_USEGSMENCODING_INANDOUT
    objSmppSession.MultipartMode = objConstants.SMPP_MULTIPARTMODE_UDH
    objSmppSession.DeliverMode = objConstants.SMPP_DELIVERMODE_DELIVERSM
    objSmppSession.ExtractApplicationPort = True
  
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
WEnd

SmsSentPerSecond property

The number of SMS messages sent per second. This includes messages rejected by the client.

This value is for performance monitoring.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  Write-Host ("Sent: " + $objSmppSession.SmsSentPerSecond)
  Write-Host ("Received: " + $objSmppSession.SmsReceivedPerSecond)
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  Console.WriteLine("Sent: " + objSmppSession.SmsSentPerSecond);
  Console.WriteLine("Received: " + objSmppSession.SmsReceivedPerSecond);
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  WScript.Echo "Sent: " & objSmppSession.SmsSentPerSecond
  WScript.Echo "Received: " & objSmppSession.SmsReceivedPerSecond
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

SmsReceivedPerSecond property

The number of SMS messages received per second.

This value is for performance monitoring.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  Write-Host ("Sent: " + $objSmppSession.SmsSentPerSecond)
  Write-Host ("Received: " + $objSmppSession.SmsReceivedPerSecond)
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  Console.WriteLine("Sent: " + objSmppSession.SmsSentPerSecond);
  Console.WriteLine("Received: " + objSmppSession.SmsReceivedPerSecond);
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  WScript.Echo "Sent: " & objSmppSession.SmsSentPerSecond
  WScript.Echo "Received: " & objSmppSession.SmsReceivedPerSecond
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

MaxSmsDeliveries property

SMS messages delivered with DeliverSms are queued and sent when possible. This property limits the maximum number of messages kept in the delivery queue.

Default is 100 messages.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    $objSmppSession.MaxSmsDeliveries = 50
    $objSmppSession.MaxSmsSubmission = 100
    $objSmppSession.MaxSmsQueries = 100
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    objSmppSession.MaxSmsDeliveries = 50;
    objSmppSession.MaxSmsSubmission = 100;
    objSmppSession.MaxSmsQueries = 100;
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    objSmppSession.MaxSmsDeliveries = 50
    objSmppSession.MaxSmsSubmission = 100
    objSmppSession.MaxSmsQueries = 100
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

MaxSmsSubmission property

Incoming SMS submissions are queued until read with ReceiveSubmitSms. This sets the maximum queue size. New messages are rejected with SMPP_ESME_RMSGQFUL when full.

Default is 15 messages.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    $objSmppSession.MaxSmsDeliveries = 50
    $objSmppSession.MaxSmsSubmission = 100
    $objSmppSession.MaxSmsQueries = 100
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    objSmppSession.MaxSmsDeliveries = 50;
    objSmppSession.MaxSmsSubmission = 100;
    objSmppSession.MaxSmsQueries = 100;
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    objSmppSession.MaxSmsDeliveries = 50
    objSmppSession.MaxSmsSubmission = 100
    objSmppSession.MaxSmsQueries = 100
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

MaxSmsQueries property

Incoming SMS queries are queued until read with ReceiveQuerySms. This sets the maximum queue size. New queries are rejected with SMPP_ESME_RMSGQFUL when full.

Default is 15 messages.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    $objSmppSession.MaxSmsDeliveries = 50
    $objSmppSession.MaxSmsSubmission = 100
    $objSmppSession.MaxSmsQueries = 100
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    objSmppSession.MaxSmsDeliveries = 50;
    objSmppSession.MaxSmsSubmission = 100;
    objSmppSession.MaxSmsQueries = 100;
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    objSmppSession.MaxSmsDeliveries = 50
    objSmppSession.MaxSmsSubmission = 100
    objSmppSession.MaxSmsQueries = 100
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

MaxOutPendingPdus property

The maximum number of PDUs that can be waiting for a reply from the client.

Default is 10 PDUs.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    $objSmppSession.MaxOutPendingPdus = 10
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    objSmppSession.MaxOutPendingPdus = 10;
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    objSmppSession.MaxOutPendingPdus = 10
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

GetErrorDescription method

Returns a readable description for a given error code.

Parameters:

  • The error code

Return value:

The error description string.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objMessage = New-Object -ComObject AxSms.Message
  $objMessage.ToAddress = "+31122334455"
  $objMessage.FromAddress = "+35544332211"
  $objMessage.Body = "Hello from the Auron Gateway !"
  $objMessage.UserTag = 1 # To identify this message when the client responds
  $objSmppSession.DeliverSms($objMessage)
  if ($objSmppSession.LastError -ne 0) {
    Write-Host ("Error while delivering: " + `
      $objSmppSession.GetErrorDescription($objSmppSession.LastError))
    exit 1
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var objMessage = new AxSms.Message();
  objMessage.ToAddress = "+31122334455";
  objMessage.FromAddress = "+35544332211";
  objMessage.Body = "Hello from the Auron Gateway !";
  objMessage.UserTag = 1; // To identify this message when the client responds
  objSmppSession.DeliverSms(objMessage);
  if (objSmppSession.LastError != 0)
  {
    Console.WriteLine("Error while delivering: " + 
      objSmppSession.GetErrorDescription(objSmppSession.LastError));
    Environment.Exit(1);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  Set objMessage = CreateObject("AxSms.Message")
  objMessage.ToAddress = "+31122334455"
  objMessage.FromAddress = "+35544332211"
  objMessage.Body = "Hello from the Auron Gateway !"
  objMessage.UserTag = 1 ' To identify this message when the client responds
  objSmppSession.DeliverSms objMessage
  If objSmppSession.LastError <> 0 Then
    WScript.Echo "Error while delivering: " & _
      objSmppSession.GetErrorDescription(objSmppSession.LastError)
    WScript.Quit 1
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

RespondToBind method

Responds to an incoming bind request with the given SMPP status code. Use one of these constants.

Call this method when ConnectionState is SMPP_SESSIONSTATE_BINDING.

If the status is not 0 (ROK), the connection is dropped immediately and the session state becomes Disconnected.

Parameters:

  • The status code

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  if ($objSmppSession.ConnectionState -eq $objConstants.SMPP_SESSIONSTATE_BINDING) {
    Write-Host ("Client IP: " + $objSmppSession.Ip + ":" + $objSmppSession.Port)
    Write-Host ("SystemId: " + $objSmppSession.SystemId)
    Write-Host ("AddressRange: " + $objSmppSession.AddressRange)
    $objSmppSession.LogFile = $objSmppSession.SystemId + ".log"
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  if (objSmppSession.ConnectionState == objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    Console.WriteLine("Client IP: " + objSmppSession.Ip + ":" + objSmppSession.Port);
    Console.WriteLine("SystemId: " + objSmppSession.SystemId);
    Console.WriteLine("AddressRange: " + objSmppSession.AddressRange);
    objSmppSession.LogFile = objSmppSession.SystemId + ".log";
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  If objSmppSession.ConnectionState = objConstants.SMPP_SESSIONSTATE_BINDING Then
    WScript.Echo "Client IP: " & objSmppSession.Ip & ":" & objSmppSession.Port
    WScript.Echo "SystemId: " & objSmppSession.SystemId
    WScript.Echo "AddressRange: " & objSmppSession.AddressRange
    objSmppSession.LogFile = objSmppSession.SystemId & ".log"
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

GetFirstBindTlv method

Clients can send optional TLV parameters during bind. Use this method with GetNextBindTlv to iterate over all TLVs from the last bind request.

Parameters:

  • None

Return value:

A Tlv object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  
  if ($objSmppSession.ConnectionState -eq `
      $objConstants.SMPP_SESSIONSTATE_BINDING) {
    
    # iterate over all bind TLV values
    $objTlv = $objSmppSession.GetFirstBindTlv()
    while ($objSmppSession.LastError -eq 0) {
      
      # ...
      
      $objTlv = $objSmppSession.GetNextBindTlv()
    }

    # ...     
      
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  
  if (objSmppSession.ConnectionState == 
      objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    // iterate over all bind TLV values
    var objTlv = objSmppSession.GetFirstBindTlv();
    while (objSmppSession.LastError == 0)
    {
      // ...
      
      objTlv = objSmppSession.GetNextBindTlv();
    }

    // ...     
      
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  
  If objSmppSession.ConnectionState = 
     objConstants.SMPP_SESSIONSTATE_BINDING Then
    
    ' iterate over all bind TLV values
    Set objTlv = objSmppSession.GetFirstBindTlv()
    While objSmppSession.LastError = 0
      
      ...
      
      Set objTlv = objSmppSession.GetNextBindTlv()
    WEnd 

    ...     
      
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If      
  
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

GetNextBindTlv method

Clients can send optional TLV parameters during bind. Use this method with GetFirstBindTlv to iterate over all TLVs from the last bind request.

Parameters:

  • None

Return value:

A Tlv object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  
  if ($objSmppSession.ConnectionState -eq `
      $objConstants.SMPP_SESSIONSTATE_BINDING) {
    
    # iterate over all bind TLV values
    $objTlv = $objSmppSession.GetFirstBindTlv()
    while ($objSmppSession.LastError -eq 0) {
      
      # ...
      
      $objTlv = $objSmppSession.GetNextBindTlv()
    }

    # ...     
      
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  
  if (objSmppSession.ConnectionState == 
      objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    // iterate over all bind TLV values
    var objTlv = objSmppSession.GetFirstBindTlv();
    while (objSmppSession.LastError == 0)
    {
      // ...
      
      objTlv = objSmppSession.GetNextBindTlv();
    }

    // ...     
      
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  
  If objSmppSession.ConnectionState = 
     objConstants.SMPP_SESSIONSTATE_BINDING Then
    
    ' iterate over all bind TLV values
    Set objTlv = objSmppSession.GetFirstBindTlv()
    While objSmppSession.LastError = 0
      
      ...
      
      Set objTlv = objSmppSession.GetNextBindTlv()
    WEnd 

    ...     
      
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If      
  
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

GetBindTlv method

Clients can send optional TLV parameters during bind. Use this method to retrieve a specific TLV by its tag number.

Parameters:

  • Tag number

Return value:

A Tlv object, or nothing if not found (check LastError).

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  
  if ($objSmppSession.ConnectionState -eq `
      $objConstants.SMPP_SESSIONSTATE_BINDING) {
    
    # Get TLV with tag number 101
    $objTlv = $objSmppSession.GetBindTlv(101)
    if ($objSmppSession.LastError -eq 0) {
      # Found TLV object
      # ...
    }

    # ...     
      
    $objSmppSession.RespondToBind($objConstants.SMPP_ESME_ROK)
  }
  
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  
  if (objSmppSession.ConnectionState == 
      objConstants.SMPP_SESSIONSTATE_BINDING)
  {
    // Get TLV with tag number 101
    var objTlv = objSmppSession.GetBindTlv(101);
    if (objSmppSession.LastError == 0)
    {
      // Found TLV object
      // ...
    }

    // ...     
      
    objSmppSession.RespondToBind(objConstants.SMPP_ESME_ROK);
  }
  
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  
  If objSmppSession.ConnectionState = 
     objConstants.SMPP_SESSIONSTATE_BINDING Then
    
    ' Get TLV with tag number 101
    Set objTlv = objSmppSession.GetBindTlv(101)    
    If objSmppSession.LastError = 0 Then
      ' Found TLV object
      ...
      
    EndIf

    ...     
      
    objSmppSession.RespondToBind objConstants.SMPP_ESME_ROK
  End If      
  
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

RespondToSubmitSms method

Respond to an incoming SMS submission. Use ReceiveSubmitSms to receive submissions, then call this method with a status code.

Every received SMS requires a response: 0 to accept, or one of these codes to reject.

Parameters:

  • Message object

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objMessage = $objSmppSession.ReceiveSubmitSms()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Receive SMS from: " + $objSmppSession.SystemId + "; to: " + `
      $objMessage.ToAddress + "; suggested reference: " + $objMessage.Reference)
    
    # Accept the incoming message with the suggested message reference
    $objSmppSession.RespondToSubmitSms($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while responding: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    # Send a successful delivery report for the incoming message
    $objMessage.SmppStatus = $objConstants.SMPP_MESSAGESTATE_DELIVERED
    $objSmppSession.DeliverReport($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while sending delivery report: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    $objMessage = $objSmppSession.ReceiveSubmitSms()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var objMessage = objSmppSession.ReceiveSubmitSms();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Receive SMS from: " + objSmppSession.SystemId + 
      "; to: " + objMessage.ToAddress + 
      "; suggested reference: " + objMessage.Reference);
    
    // Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while responding: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    // Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED;
    objSmppSession.DeliverReport(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while sending delivery report: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    objMessage = objSmppSession.ReceiveSubmitSms();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  Set objMessage = objSmppSession.ReceiveSubmitSms
  While objSmppSession.LastError = 0
    WScript.Echo "Receive SMS from: " & objSmppSession.SystemId & "; to: " & _
      objMessage.ToAddress & "; suggested reference: " & objMessage.Reference
    
    ' Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while responding: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    ' Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED
    objSmppSession.DeliverReport objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while sending delivery report: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    Set objMessage = objSmppSession.ReceiveSubmitSms
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

ReceiveSubmitSms method

Receives an SMS submission from the connected client. Every received SMS must be responded to with RespondToSubmitSms.

If no more submissions are pending, nothing is returned and LastError is set.

Parameters:

  • None

Return value:

A Message object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objMessage = $objSmppSession.ReceiveSubmitSms()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Receive SMS from: " + $objSmppSession.SystemId + "; to: " + `
      $objMessage.ToAddress + "; suggested reference: " + $objMessage.Reference)
    
    # Accept the incoming message with the suggested message reference
    $objSmppSession.RespondToSubmitSms($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while responding: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    # Send a successful delivery report for the incoming message
    $objMessage.SmppStatus = $objConstants.SMPP_MESSAGESTATE_DELIVERED
    $objSmppSession.DeliverReport($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while sending delivery report: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    $objMessage = $objSmppSession.ReceiveSubmitSms()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var objMessage = objSmppSession.ReceiveSubmitSms();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Receive SMS from: " + objSmppSession.SystemId + 
      "; to: " + objMessage.ToAddress + 
      "; suggested reference: " + objMessage.Reference);
    
    // Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while responding: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    // Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED;
    objSmppSession.DeliverReport(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while sending delivery report: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    objMessage = objSmppSession.ReceiveSubmitSms();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  Set objMessage = objSmppSession.ReceiveSubmitSms
  While objSmppSession.LastError = 0
    WScript.Echo "Receive SMS from: " & objSmppSession.SystemId & "; to: " & _
      objMessage.ToAddress & "; suggested reference: " & objMessage.Reference
    
    ' Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while responding: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    ' Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED
    objSmppSession.DeliverReport objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while sending delivery report: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    Set objMessage = objSmppSession.ReceiveSubmitSms
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

RespondToQuerySms method

Respond to an SMS query request. Use ReceiveQuerySms to receive queries, then respond with a status code.

Pass the original queried message and make sure its status reflects the current state.

Every query requires a response.

Parameters:

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  # Don't support query_sm
  $objMessage = $objSmppSession.ReceiveQuerySms()
  while ($objSmppSession.LastError -eq 0) {
    $objMessage.SmppCommandStatus = $objConstants.SMPP_ESME_RINVCMDID
    $objSmppSession.RespondToQuerySms($objMessage)
    $objMessage = $objSmppSession.ReceiveQuerySms()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  // Don't support query_sm
  var objMessage = objSmppSession.ReceiveQuerySms();
  while (objSmppSession.LastError == 0)
  {
    objMessage.SmppCommandStatus = objConstants.SMPP_ESME_RINVCMDID;
    objSmppSession.RespondToQuerySms(objMessage);
    objMessage = objSmppSession.ReceiveQuerySms();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  'Don't support query_sm
  Set objMessage = objSmppSession.ReceiveQuerySms
  While objSmppSession.LastError = 0
    objMessage.SmppCommandStatus = objConstants.SMPP_ESME_RINVCMDID
    objSmppSession.RespondToQuerySms objMessage
    Set objMessage = objSmppSession.ReceiveQuerySms
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

ReceiveQuerySms method

Receives an SMS query from the connected client. The client sends a message reference to query. Every query must be responded to with RespondToQuerySms.

If no more queries are pending, nothing is returned and LastError is set.

Parameters:

  • None

Return value:

A Message object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  # Don't support query_sm
  $objMessage = $objSmppSession.ReceiveQuerySms()
  while ($objSmppSession.LastError -eq 0) {
    $objMessage.SmppCommandStatus = $objConstants.SMPP_ESME_RINVCMDID
    $objSmppSession.RespondToQuerySms($objMessage)
    $objMessage = $objSmppSession.ReceiveQuerySms()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  // Don't support query_sm
  var objMessage = objSmppSession.ReceiveQuerySms();
  while (objSmppSession.LastError == 0)
  {
    objMessage.SmppCommandStatus = objConstants.SMPP_ESME_RINVCMDID;
    objSmppSession.RespondToQuerySms(objMessage);
    objMessage = objSmppSession.ReceiveQuerySms();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  'Don't support query_sm
  Set objMessage = objSmppSession.ReceiveQuerySms
  While objSmppSession.LastError = 0
    objMessage.SmppCommandStatus = objConstants.SMPP_ESME_RINVCMDID
    objSmppSession.RespondToQuerySms objMessage
    Set objMessage = objSmppSession.ReceiveQuerySms
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

DeliverSms method

Delivers an SMS message to the remote client. The client should respond to every delivered message. Receive responses with ReceiveDeliverResponse.

Parameters:

  • A Message object
  • (Optional) Multipart flag – one of these constants

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  # Deliver a new message to the client
  $objMessage = New-Object -ComObject AxSms.Message
  $objMessage.ToAddress = "+31122334455"
  $objMessage.FromAddress = "+35544332211"
  $objMessage.Body = "Hello from the Auron Gateway !"
  $objMessage.UserTag = 1 # To identify this message when the client responds
  $objSmppSession.DeliverSms($objMessage)
  if ($objSmppSession.LastError -ne 0) {
    Write-Host ("Error while delivering: " + `
      $objSmppSession.GetErrorDescription($objSmppSession.LastError))
    exit 1
  }
  
  # Check if the client accepted any messages
  $objMessage = $objSmppSession.ReceiveDeliverResponse()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Response: " + $objMessage.SmppCommandStatus + `
      " for UserTag: " + $objMessage.UserTag)
    $objMessage = $objSmppSession.ReceiveDeliverResponse()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  // Deliver a new message to the client
  var objMessage = new AxSms.Message();
  objMessage.ToAddress = "+31122334455";
  objMessage.FromAddress = "+35544332211";
  objMessage.Body = "Hello from the Auron Gateway !";
  objMessage.UserTag = 1; // To identify this message when the client responds
  objSmppSession.DeliverSms(objMessage);
  if (objSmppSession.LastError != 0)
  {
    Console.WriteLine("Error while delivering: " + 
      objSmppSession.GetErrorDescription(objSmppSession.LastError));
    Environment.Exit(1);
  }
  
  // Check if the client accepted any messages
  objMessage = objSmppSession.ReceiveDeliverResponse();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Response: " + objMessage.SmppCommandStatus + 
      " for UserTag: " + objMessage.UserTag);
    objMessage = objSmppSession.ReceiveDeliverResponse();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  ' Deliver a new message to the client
  Set objMessage = CreateObject("AxSms.Message")
  objMessage.ToAddress = "+31122334455"
  objMessage.FromAddress = "+35544332211"
  objMessage.Body = "Hello from the Auron Gateway !"
  objMessage.UserTag = 1 ' To identify this message when the client responds
  objSmppSession.DeliverSms objMessage
  If objSmppSession.LastError <> 0 Then
    WScript.Echo "Error while delivering: " & _
      objSmppSession.GetErrorDescription(objSmppSession.LastError)
    WScript.Quit 1
  End If
  
  ' Check if the client accepted any messages
  Set objMessage = objSmppSession.ReceiveDeliverResponse
  While objSmppSession.LastError = 0
    WScript.Echo "Response: " & objMessage.SmppCommandStatus & _
      " for UserTag: " & objMessage.UserTag
    Set objMessage = objSmppSession.ReceiveDeliverResponse
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

DeliverReport method

Delivers a delivery report to the remote client. This method formats a delivery report based on the original message. Set the final status before calling.

The client should respond to every delivery report. Receive responses with ReceiveDeliverResponse.

Parameters:

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objMessage = $objSmppSession.ReceiveSubmitSms()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Receive SMS from: " + $objSmppSession.SystemId + "; to: " + `
      $objMessage.ToAddress + "; suggested reference: " + $objMessage.Reference)
    
    # Accept the incoming message with the suggested message reference
    $objSmppSession.RespondToSubmitSms($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while responding: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    # Send a successful delivery report for the incoming message
    $objMessage.SmppStatus = $objConstants.SMPP_MESSAGESTATE_DELIVERED
    $objSmppSession.DeliverReport($objMessage)
    if ($objSmppSession.LastError -ne 0) {
      Write-Host ("Error while sending delivery report: " + `
        $objSmppSession.GetErrorDescription($objSmppSession.LastError))
      exit 1
    }
    
    $objMessage = $objSmppSession.ReceiveSubmitSms()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var objMessage = objSmppSession.ReceiveSubmitSms();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Receive SMS from: " + objSmppSession.SystemId + 
      "; to: " + objMessage.ToAddress + 
      "; suggested reference: " + objMessage.Reference);
    
    // Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while responding: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    // Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED;
    objSmppSession.DeliverReport(objMessage);
    if (objSmppSession.LastError != 0)
    {
      Console.WriteLine("Error while sending delivery report: " + 
        objSmppSession.GetErrorDescription(objSmppSession.LastError));
      Environment.Exit(1);
    }
    
    objMessage = objSmppSession.ReceiveSubmitSms();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  Set objMessage = objSmppSession.ReceiveSubmitSms
  While objSmppSession.LastError = 0
    WScript.Echo "Receive SMS from: " & objSmppSession.SystemId & "; to: " & _
      objMessage.ToAddress & "; suggested reference: " & objMessage.Reference
    
    ' Accept the incoming message with the suggested message reference
    objSmppSession.RespondToSubmitSms objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while responding: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    ' Send a successful delivery report for the incoming message
    objMessage.SmppStatus = objConstants.SMPP_MESSAGESTATE_DELIVERED
    objSmppSession.DeliverReport objMessage
    If objSmppSession.LastError <> 0 Then
      WScript.Echo "Error while sending delivery report: " & _
        objSmppSession.GetErrorDescription(objSmppSession.LastError)
      WScript.Quit 1
    End If
    
    Set objMessage = objSmppSession.ReceiveSubmitSms
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

ReceiveDeliverResponse method

Receives the client’s response to a previously delivered SMS or delivery report. The response contains the same UserTag used when sending the original message.

Parameters:

  • None

Return value:

The original Message object that was responded to.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  # Deliver a new message to the client
  $objMessage = New-Object -ComObject AxSms.Message
  $objMessage.ToAddress = "+31122334455"
  $objMessage.FromAddress = "+35544332211"
  $objMessage.Body = "Hello from the Auron Gateway !"
  $objMessage.UserTag = 1 # To identify this message when the client responds
  $objSmppSession.DeliverSms($objMessage)
  if ($objSmppSession.LastError -ne 0) {
    Write-Host ("Error while delivering: " + `
      $objSmppSession.GetErrorDescription($objSmppSession.LastError))
    exit 1
  }
  
  # Check if the client accepted any messages
  $objMessage = $objSmppSession.ReceiveDeliverResponse()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Response: " + $objMessage.SmppCommandStatus + `
      " for UserTag: " + $objMessage.UserTag)
    $objMessage = $objSmppSession.ReceiveDeliverResponse()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  // Deliver a new message to the client
  var objMessage = new AxSms.Message();
  objMessage.ToAddress = "+31122334455";
  objMessage.FromAddress = "+35544332211";
  objMessage.Body = "Hello from the Auron Gateway !";
  objMessage.UserTag = 1; // To identify this message when the client responds
  objSmppSession.DeliverSms(objMessage);
  if (objSmppSession.LastError != 0)
  {
    Console.WriteLine("Error while delivering: " + 
      objSmppSession.GetErrorDescription(objSmppSession.LastError));
    Environment.Exit(1);
  }
  
  // Check if the client accepted any messages
  objMessage = objSmppSession.ReceiveDeliverResponse();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Response: " + objMessage.SmppCommandStatus + 
      " for UserTag: " + objMessage.UserTag);
    objMessage = objSmppSession.ReceiveDeliverResponse();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  ' Deliver a new message to the client
  Set objMessage = CreateObject("AxSms.Message")
  objMessage.ToAddress = "+31122334455"
  objMessage.FromAddress = "+35544332211"
  objMessage.Body = "Hello from the Auron Gateway !"
  objMessage.UserTag = 1 ' To identify this message when the client responds
  objSmppSession.DeliverSms objMessage
  If objSmppSession.LastError <> 0 Then
    WScript.Echo "Error while delivering: " & _
      objSmppSession.GetErrorDescription(objSmppSession.LastError)
    WScript.Quit 1
  End If
  
  ' Check if the client accepted any messages
  Set objMessage = objSmppSession.ReceiveDeliverResponse
  While objSmppSession.LastError = 0
    WScript.Echo "Response: " & objMessage.SmppCommandStatus & _
      " for UserTag: " & objMessage.UserTag
    Set objMessage = objSmppSession.ReceiveDeliverResponse
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

Disconnect method

Disconnects this session. The client connection is dropped immediately.

Parameters:

  • None

Return value:

Always 0.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $objSmppSession.Disconnect()
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  objSmppSession.Disconnect();
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  objSmppSession.Disconnect
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

CountSmsSubmissions method

Returns the number of messages received but not yet collected with ReceiveSubmitSms.

Parameters:

  • None

Return value:

The number of pending SMS submissions.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  Write-Host ("In submit queue: " + $objSmppSession.CountSmsSubmissions())
  Write-Host ("In query queue: " + $objSmppSession.CountSmsQueries())
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  Console.WriteLine("In submit queue: " + objSmppSession.CountSmsSubmissions());
  Console.WriteLine("In query queue: " + objSmppSession.CountSmsQueries());
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  WScript.Echo "In submit queue: " & objSmppSession.CountSmsSubmissions
  WScript.Echo "In query queue: " & objSmppSession.CountSmsQueries
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

CountSmsQueries method

Returns the number of queries received but not yet collected with ReceiveQuerySms.

Parameters:

  • None

Return value:

The number of pending SMS queries.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  Write-Host ("In submit queue: " + $objSmppSession.CountSmsSubmissions())
  Write-Host ("In query queue: " + $objSmppSession.CountSmsQueries())
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  Console.WriteLine("In submit queue: " + objSmppSession.CountSmsSubmissions());
  Console.WriteLine("In query queue: " + objSmppSession.CountSmsQueries());
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  WScript.Echo "In submit queue: " & objSmppSession.CountSmsSubmissions
  WScript.Echo "In query queue: " & objSmppSession.CountSmsQueries
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

CountSmsDeliverySpace method

Returns the number of additional SMS messages that can still be added to the delivery queue using DeliverSms.

Use MaxSmsDeliveries to set the queue limit.

Parameters:

  • None

Return value:

The number of messages that can still be added.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $iMax = $objSmppSession.CountSmsDeliverySpace()
  $strQ = "SELECT TOP($iMax) FROM Messages"
  $objRs = $objCon.Execute($strQ)
  # ...
  while (-not $objRs.EOF) {
    $objMessage.ToAddress = $objRs.Fields.Item("ToAddress").Value
    $objSmppSession.DeliverSms($objMessage)
    # ...
    $objRs.MoveNext()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var iMax = objSmppSession.CountSmsDeliverySpace();
  var strQ = "SELECT TOP(" + iMax + ") FROM Messages";
  var objRs = objCon.Execute(strQ);
  // ...
  while (!objRs.EOF)
  {
    objMessage.ToAddress = objRs["ToAddress"].ToString();
    objSmppSession.DeliverSms(objMessage);
    // ...
    objRs.MoveNext();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  iMax = objSmppSession.CountSmsDeliverySpace
  strQ = "SELECT TOP(" & iMax & ") FROM Messages"
  Set objRs = objCon.Execute(strQ)
  ...
  While Not objRs.EOF
    objMessage.ToAddress = objRs("ToAddress")
    objSmppSession.DeliverSms objMessage
    ...
    objRs.MoveNext
  WEnd    
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

FetchNotResponded method

Returns the next SMS that was delivered to the client but not acknowledged. The message has a sequence number but no command status. Use UserTag to identify it.

This method can only be called on a disconnected session (after Disconnect).

When no more messages are available, LastError is set.

Parameters:

  • None

Return value:

The next unacknowledged Message object.

Example:

$objSmppSession = $objSmppServer.GetClosedSession()
while ($objSmppServer.LastError -eq 0) {
  Write-Host ("Session closed: " + $objSmppSession.SystemId)
            
  Write-Host "Not responded:  "
  $objMessage = $objSmppSession.FetchNotResponded()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Usertag: " + $objMessage.UserTag + `
      "; SequenceNumber: " + $objMessage.SmppSequenceNumber)
    $objMessage = $objSmppSession.FetchNotResponded()
  }

  Write-Host "Not delivered (seq is 0):  "
  $objMessage = $objSmppSession.FetchNotDelivered()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Usertag: " + $objMessage.UserTag + `
      "; SequenceNumber: " + $objMessage.SmppSequenceNumber)
    $objMessage = $objSmppSession.FetchNotDelivered()
  }
    
  $objSmppSession = $objSmppServer.GetClosedSession()
}
var objSmppSession = objSmppServer.GetClosedSession();
while (objSmppServer.LastError == 0)
{
  Console.WriteLine("Session closed: " + objSmppSession.SystemId);
            
  Console.WriteLine("Not responded:  ");
  var objMessage = objSmppSession.FetchNotResponded();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Usertag: " + objMessage.UserTag + 
      "; SequenceNumber: " + objMessage.SmppSequenceNumber);
    objMessage = objSmppSession.FetchNotResponded();
  }

  Console.WriteLine("Not delivered (seq is 0):  ");
  objMessage = objSmppSession.FetchNotDelivered();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Usertag: " + objMessage.UserTag + 
      "; SequenceNumber: " + objMessage.SmppSequenceNumber);
    objMessage = objSmppSession.FetchNotDelivered();
  }
    
  objSmppSession = objSmppServer.GetClosedSession();
}
Set objSmppSession = objSmppServer.GetClosedSession
While objSmppServer.LastError = 0
  WScript.Echo "Session closed: " & objSmppSession.SystemId
            
  WScript.Echo "Not responded:  "
  Set objMessage = objSmppSession.FetchNotResponded
  While objSmppSession.LastError = 0
    WScript.Echo "Usertag: " & objMessage.UserTag & "; SequenceNumber: " & _
        objMessage.SmppSequenceNumber	
    Set objMessage = objSmppSession.FetchNotResponded
  WEnd

  WScript.Echo "Not delivered (seq is 0):  "
  Set objMessage = objSmppSession.FetchNotDelivered
  While objSmppSession.LastError = 0
    WScript.Echo "Usertag: " & objMessage.UserTag & "; SequenceNumber: " & _
        objMessage.SmppSequenceNumber	
    Set objMessage = objSmppSession.FetchNotDelivered
  WEnd
    
  Set objSmppSession = objSmppServer.GetClosedSession
WEnd

FetchNotDelivered method

Returns the next SMS that was placed in the submit queue but not sent to the remote client. The message has no sequence number and undefined command status. Use UserTag to identify it.

This method can only be called on a disconnected session.

When no more messages are available, LastError is set.

Parameters:

  • None

Return value:

The next undelivered Message object.

Example:

$objSmppSession = $objSmppServer.GetClosedSession()
while ($objSmppServer.LastError -eq 0) {
  Write-Host ("Session closed: " + $objSmppSession.SystemId)
            
  Write-Host "Not responded:  "
  $objMessage = $objSmppSession.FetchNotResponded()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Usertag: " + $objMessage.UserTag + `
      "; SequenceNumber: " + $objMessage.SmppSequenceNumber)
    $objMessage = $objSmppSession.FetchNotResponded()
  }

  Write-Host "Not delivered (seq is 0):  "
  $objMessage = $objSmppSession.FetchNotDelivered()
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Usertag: " + $objMessage.UserTag + `
      "; SequenceNumber: " + $objMessage.SmppSequenceNumber)
    $objMessage = $objSmppSession.FetchNotDelivered()
  }
    
  $objSmppSession = $objSmppServer.GetClosedSession()
}
var objSmppSession = objSmppServer.GetClosedSession();
while (objSmppServer.LastError == 0)
{
  Console.WriteLine("Session closed: " + objSmppSession.SystemId);
            
  Console.WriteLine("Not responded:  ");
  var objMessage = objSmppSession.FetchNotResponded();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Usertag: " + objMessage.UserTag + 
      "; SequenceNumber: " + objMessage.SmppSequenceNumber);
    objMessage = objSmppSession.FetchNotResponded();
  }

  Console.WriteLine("Not delivered (seq is 0):  ");
  objMessage = objSmppSession.FetchNotDelivered();
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Usertag: " + objMessage.UserTag + 
      "; SequenceNumber: " + objMessage.SmppSequenceNumber);
    objMessage = objSmppSession.FetchNotDelivered();
  }
    
  objSmppSession = objSmppServer.GetClosedSession();
}
Set objSmppSession = objSmppServer.GetClosedSession
While objSmppServer.LastError = 0
  WScript.Echo "Session closed: " & objSmppSession.SystemId
            
  WScript.Echo "Not responded:  "
  Set objMessage = objSmppSession.FetchNotResponded
  While objSmppSession.LastError = 0
    WScript.Echo "Usertag: " & objMessage.UserTag & "; SequenceNumber: " & _
        objMessage.SmppSequenceNumber	
    Set objMessage = objSmppSession.FetchNotResponded
  WEnd

  WScript.Echo "Not delivered (seq is 0):  "
  Set objMessage = objSmppSession.FetchNotDelivered
  While objSmppSession.LastError = 0
    WScript.Echo "Usertag: " & objMessage.UserTag & "; SequenceNumber: " & _
        objMessage.SmppSequenceNumber	
    Set objMessage = objSmppSession.FetchNotDelivered
  WEnd
    
  Set objSmppSession = objSmppServer.GetClosedSession
WEnd

GetFirstPart method

Splits a multipart message and returns the first part. If the message is not multipart, it returns the original message as HEX. Call GetNextPart for subsequent parts.

Each part receives a new multipart reference ID managed by the session.

The formatting follows the current MultipartMode.

Parameters:

  • Message object to split

Return value:

The first part as a Message object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $iCredits = $objSmpp.CountParts($objSms)

  $objPart = $objSmpp.GetFirstPart($objSms)
  while ($objSmpp.LastError -eq 0) {
    $objSmppSession.DeliverSms($objPart)
    $objPart = $objSmpp.GetNextPart()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var iCredits = objSmpp.CountParts(objSms);

  var objPart = objSmpp.GetFirstPart(objSms);
  while (objSmpp.LastError == 0)
  {
    objSmppSession.DeliverSms(objPart);
    objPart = objSmpp.GetNextPart();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  iCredits = objSmpp.CountParts(objSms)

  Set objPart = objSmpp.GetFirstPart(objSms)
  While objSmpp.LastError = 0
    objSmppSession.DeliverSms objPart
    Set objPart = objSmpp.GetNextPart()
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

GetNextPart method

Returns the next part after calling GetFirstPart. When no more parts are available, LastError is set.

Formatting follows the current MultipartMode.

Parameters:

  • None

Return value:

The next part as a Message object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $iCredits = $objSmpp.CountParts($objSms)

  $objPart = $objSmpp.GetFirstPart($objSms)
  while ($objSmpp.LastError -eq 0) {
    $objSmppSession.DeliverSms($objPart)
    $objPart = $objSmpp.GetNextPart()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var iCredits = objSmpp.CountParts(objSms);

  var objPart = objSmpp.GetFirstPart(objSms);
  while (objSmpp.LastError == 0)
  {
    objSmppSession.DeliverSms(objPart);
    objPart = objSmpp.GetNextPart();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  iCredits = objSmpp.CountParts(objSms)

  Set objPart = objSmpp.GetFirstPart(objSms)
  While objSmpp.LastError = 0
    objSmppSession.DeliverSms objPart
    Set objPart = objSmpp.GetNextPart()
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

CountParts method

Returns how many parts are needed to send the given Message object. The calculation uses the current MultipartMode.

Parameters:

  • The Message object

Return value:

The number of parts required.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # ...
  $iCredits = $objSmpp.CountParts($objSms)

  $objPart = $objSmpp.GetFirstPart($objSms)
  while ($objSmpp.LastError -eq 0) {
    $objSmppSession.DeliverSms($objPart)
    $objPart = $objSmpp.GetNextPart()
  }
  # ...
  $objSmppSession = $objSmppServer.GetNextSession()
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // ...
  var iCredits = objSmpp.CountParts(objSms);

  var objPart = objSmpp.GetFirstPart(objSms);
  while (objSmpp.LastError == 0)
  {
    objSmppSession.DeliverSms(objPart);
    objPart = objSmpp.GetNextPart();
  }
  // ...
  objSmppSession = objSmppServer.GetNextSession();
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ...
  iCredits = objSmpp.CountParts(objSms)

  Set objPart = objSmpp.GetFirstPart(objSms)
  While objSmpp.LastError = 0
    objSmppSession.DeliverSms objPart
    Set objPart = objSmpp.GetNextPart()
  WEnd
  ...
  Set objSmppSession = objSmppServer.GetNextSession
WEnd

AssembleSms method

Adds a part to the internal assembler. Use GetAssembledSms to retrieve completed messages.

Multiple multipart messages can be assembled simultaneously.

Parameters:

Return value:

None.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # Receive incoming messages
  $objMessage = $objSmppSession.ReceiveSubmitSms()
  while ($objSmppSession.LastError -eq 0) {
    $objSmppSession.AssembleSms($objMessage)
    $objSmppSession.RespondToSubmitSms($objMessage)
    # ...
    $objMessage = $objSmppSession.ReceiveSubmitSms()
  }

  # Get assembled messages
  $objMessage = $objSmppSession.GetAssembledSms($false)
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Received: " + $objMessage.Body)
    $objMessage = $objSmppSession.GetAssembledSms($false)
  }
  # ...  
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // Receive incoming messages
  var objMessage = objSmppSession.ReceiveSubmitSms();
  while (objSmppSession.LastError == 0)
  {
    objSmppSession.AssembleSms(objMessage);
    objSmppSession.RespondToSubmitSms(objMessage);
    // ...
    objMessage = objSmppSession.ReceiveSubmitSms();
  }

  // Get assembled messages
  objMessage = objSmppSession.GetAssembledSms(false);
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Received: " + objMessage.Body);
    objMessage = objSmppSession.GetAssembledSms(false);
  }
  // ...  
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ' Receive incoming messages
  Set objMessage = objSmppSession.ReceiveSubmitSms
  While objSmppSession.LastError = 0
    objSmppSession.AssembleSms objMessage
    objSmppSession.RespondToSubmitSms objMessage
    ...
    Set objMessage = objSmppSession.ReceiveSubmitSms
  WEnd

  ' Get assembled messages
  Set objMessage = objSmppSession.GetAssembledSms(false)
  While objSmppSession.LastError = 0
    WScript.Echo "Received: " & objMessage.Body
    Set objMessage = objSmppSession.GetAssembledSms(false)
  WEnd
  ...  
WEnd

GetAssembledSms method

Returns the first fully assembled multipart SMS. Messages are assembled from parts added with AssembleSms.

Call ResetSmsAssembler to clear incomplete messages.

Set the Force parameter to true to return the first incomplete message (it will have Incomplete set to true).

If no messages are ready, LastError is set.

Parameters:

  • Force assemble the first (possibly incomplete) message

Return value:

A Message object.

Example:

$objSmppSession = $objSmppServer.GetFirstSession()
while ($objSmppServer.LastError -eq 0) {
  # Receive incoming messages
  $objMessage = $objSmppSession.ReceiveSubmitSms()
  while ($objSmppSession.LastError -eq 0) {
    $objSmppSession.AssembleSms($objMessage)
    $objSmppSession.RespondToSubmitSms($objMessage)
    # ...
    $objMessage = $objSmppSession.ReceiveSubmitSms()
  }

  # Get assembled messages
  $objMessage = $objSmppSession.GetAssembledSms($false)
  while ($objSmppSession.LastError -eq 0) {
    Write-Host ("Received: " + $objMessage.Body)
    $objMessage = $objSmppSession.GetAssembledSms($false)
  }
  # ...  
}
var objSmppSession = objSmppServer.GetFirstSession();
while (objSmppServer.LastError == 0)
{
  // Receive incoming messages
  var objMessage = objSmppSession.ReceiveSubmitSms();
  while (objSmppSession.LastError == 0)
  {
    objSmppSession.AssembleSms(objMessage);
    objSmppSession.RespondToSubmitSms(objMessage);
    // ...
    objMessage = objSmppSession.ReceiveSubmitSms();
  }

  // Get assembled messages
  objMessage = objSmppSession.GetAssembledSms(false);
  while (objSmppSession.LastError == 0)
  {
    Console.WriteLine("Received: " + objMessage.Body);
    objMessage = objSmppSession.GetAssembledSms(false);
  }
  // ...  
}
Set objSmppSession = objSmppServer.GetFirstSession
While objSmppServer.LastError = 0
  ' Receive incoming messages
  Set objMessage = objSmppSession.ReceiveSubmitSms
  While objSmppSession.LastError = 0
    objSmppSession.AssembleSms objMessage
    objSmppSession.RespondToSubmitSms objMessage
    ...
    Set objMessage = objSmppSession.ReceiveSubmitSms
  WEnd

  ' Get assembled messages
  Set objMessage = objSmppSession.GetAssembledSms(false)
  While objSmppSession.LastError = 0
    WScript.Echo "Received: " & objMessage.Body
    Set objMessage = objSmppSession.GetAssembledSms(false)
  WEnd
  ...  
WEnd