How can we help?

AxSms.Message


Introduction

Skip to properties and methods

This object represents an SMS message. Any SMS Component protocol, Gsm, Smpp, SmppServer, Http and Dialup accept and return SMS message data by using this object.

Most properties and methods in the Message object are applicable to all or multiple protocols. Some properties will only be used in a specific protocol. The properties and methods that are specific to a protocol will be prefixed with the protocol name. For example: GsmFirstOctet or SmppPriority

Properties and Methods

Property Type Read/Write Description
LastError Number Read Result of the last called method
UserTag Number Read/Write User defined value to track this object
ToAddress String Read/Write The address to send this message to
FromAddress String Read/Write The address this message was received from
Body String Read/Write The body value of the SMS message
RequestDeliveryReport Boolean Read/Write Whether or not to request a delivery report
ToAddressTON String Read/Write Type of Number for the ‘ToAddress’
ToAddressNPI String Read/Write Number Plan Indicator for the ‘ToAddress’
FromAddressTON String Read/Write Type of Number for the ‘FromAddress’
FromAddressNPI String Read/Write Number Plan Indicator for the ‘FromAddress’
ProtocolId String Read/Write The protocol ID
ValidityPeriod Number Read/Write Validity Period in minutes
Reference String Read/Write Message reference
DataCoding Number Read/Write Data coding
LanguageLockingShift Number Read/Write Language locking shift table
LanguageSingleShift Number Read/Write Language single shift table
BodyFormat Number Read/Write Body format
HasUdh Boolean Read/Write Whether a User Data Header is present
ReceiveTime String Read Receive time
ReceiveTimeInSeconds Number Read Receive time in seconds
TotalParts Number Read The total number of message parts
PartNumber Number Read The part number for this message
MultipartRef Number Read The multipart reference
Incomplete Boolean Read Whether this message is complete
GsmFirstOctet Number Read/Write GSM specific, First octet
GsmSmscAddress String Read GSM specific, SMSC address
GsmSmscAddressTON Number Read GSM specific, Address TON
GsmSmscAddressNPI Number Read GSM specific, Address NPI
GsmMemoryIndex String Read/Write GSM specific, Memory index
GsmMemoryLocation String Read/Write GSM specific, Memory location
SmppPriority Number Read/Write SMPP specific, priority
SmppServiceType String Read/Write SMPP specific, service type
SmppEsmClass Number Read/Write SMPP specific, ESM class
SmppStatus Number Read SMPP specific, message status
SmppError Number Read SMPP specific, message error code
SmppIsDeliveryReport Number Read/Write SMPP specific, whether this SMS message is a delivery report
SmppCommandStatus Number Read/Write SMPP specific, command status
SmppSequenceNumber Number Read/Write SMPP specific, sequence number
SmppServerSubmitDate String Read SMPP Server specific, message submit timestamp
SmppServerFinalDate String Read SMPP Server specific, timestamp of the final status

Method Description
Clear Reset all properties to their default values
GetErrorDescription Get the description of the given error
ToJSon Serialize this message to a JSON string
FromJSon Deserialize into this message object from a JSON string
SmppAddTlv Add a TLV value to this message
SmppGetTlv Get a specific TLV value from this message
SmppGetFirstTlv Get the first TLV value attached to this message
SmppGetNextTlv Get the next TLV value attached to this message
SmppDeleteTlv Delete a TLV value from this message

LastError property

Completion code of the last called method. To find the error description of a given error code, go to the online error codes codes page.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objTlv = $objMessage.SmppGetFirstTlv()
While ($objMessage.LastError -eq 0) {
    Write-Host "Tag: $($objTlv.Tag); Value: $($objTlv.ValueAsHexString)"
    $objTlv = $objMessage.SmppGetNextTlv()
}
...
var objMessage = new AxSms.Message();
...
var objTlv = objMessage.SmppGetFirstTlv();
while (objMessage.LastError == 0)
{
    Console.WriteLine("Tag: " + objTlv.Tag + "; Value: " + objTlv.ValueAsHexString);
    objTlv = objMessage.SmppGetNextTlv();
}
...
Set objMessage = CreateObject("AxSms.Message")
...
Set objTlv = objMessage.SmppGetFirstTlv()
While objMessage.LastError = 0
    WScript.Echo "Tag: " & objTlv.Tag & "; Value: " & objTlv.ValueAsHexString
    Set objTlv = objMessage.SmppGetNextTlv()
Wend
...

UserTag property

This can be any value. Use this property to track an SMS message.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.UserTag = 1
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.UserTag = 1;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.UserTag = 1
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ToAddress property

This property contains the address to send the SMS Message to.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.UserTag = 1
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.UserTag = 1;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.UserTag = 1
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

FromAddress property

This property contains the address this message was received from.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.FromAddress = "ActvXprts"
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.FromAddress = "ActvXprts";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.FromAddress = "ActvXprts"
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

Body property

The body value of the SMS message. When setting or getting this property the format is determined by the BodyFormat property.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objMessage.FromAddress = "ActvXprts"
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
objMessage.FromAddress = "ActvXprts";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.FromAddress = "ActvXprts"
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

RequestDeliveryReport property

Use this property to request a delivery report when this message is sent. Setting this property to true has the same effect as setting SmppEsmClass to SMPP_ESM_2ESME_DELIVERY_RECEIPT when sending through SMPP or settings GsmFirstOctet to GSM_FO_STATUS_REPORT when sending through GSM.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objMessage.RequestDeliveryReport = $true
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
objMessage.RequestDeliveryReport = true;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
objMessage.RequestDeliveryReport = true
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ToAddressTON property

This is the type of number for the ToAddress property. Set this to one of these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.ToAddressTON = $objConst.TON_INTERNATIONAL
$objMessage.ToAddressNPI = $objConst.NPI_ISDN
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.ToAddressTON = objConst.TON_INTERNATIONAL;
objMessage.ToAddressNPI = objConst.NPI_ISDN;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.ToAddressTON = objConst.TON_INTERNATIONAL
objMessage.ToAddressNPI = objConst.NPI_ISDN
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ToAddressNPI property

This is the number plan indicator for the ToAddress property. Set this to one of these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.ToAddressNPI = $objConst.NPI_ISDN
$objMessage.ToAddressTON = $objConst.TON_INTERNATIONAL
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.ToAddressNPI = objConst.NPI_ISDN;
objMessage.ToAddressTON = objConst.TON_INTERNATIONAL;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.ToAddressNPI = objConst.NPI_ISDN
objMessage.ToAddressTON = objConst.TON_INTERNATIONAL
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

FromAddressTON property

This is the type of number for the FromAddress property. Set this to one of these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.FromAddressNPI = $objConst.NPI_ISDN
$objMessage.FromAddressTON = $objConst.TON_ALPHANUMERIC
$objMessage.FromAddress = "ActvXprts"
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.FromAddressNPI = objConst.NPI_ISDN;
objMessage.FromAddressTON = objConst.TON_ALPHANUMERIC;
objMessage.FromAddress = "ActvXprts";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.FromAddressNPI = objConst.NPI_ISDN
objMessage.FromAddressTON = objConst.TON_ALPHANUMERIC
objMessage.FromAddress = "ActvXprts"
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

FromAddressNPI property

This is the number plan indicator for the FromAddress property. Set this to one of these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.FromAddressNPI = $objConst.NPI_ISDN
$objMessage.FromAddressTON = $objConst.TON_ALPHANUMERIC
$objMessage.FromAddress = "ActvXprts"
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.FromAddressNPI = objConst.NPI_ISDN;
objMessage.FromAddressTON = objConst.TON_ALPHANUMERIC;
objMessage.FromAddress = "ActvXprts";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.FromAddressNPI = objConst.NPI_ISDN
objMessage.FromAddressTON = objConst.TON_ALPHANUMERIC
objMessage.FromAddress = "ActvXprts"
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ProtocolId property

This is the protocol ID that’s going to be sent with this SMS message.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.ProtocolId = ""
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.ProtocolId = "";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.ProtocolId = ""
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ValidityPeriod property

This is the validity period for the SMS message in minutes. The validity period is the time the SMSC will try to deliver this message. If the SMSC is unable to deliver the message within its validity period the message is failed.

The default value is ‘0’ which uses the SMSC default validity period.

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.ValidityPeriod = 300
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.ValidityPeriod = 300;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.ValidityPeriod = 300
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

Reference property

This is the message reference. When using SMPP this is the reference obtained from SMSC, when using GSM this will be the reference obtained from the GSM modem.

Example:

$objSmpp = New-Object -ComObject AxSms.Smpp
$objMessage = New-Object -ComObject AxSms.Message
...
While ($objSmpp.WaitForSmsUpdate) {
    $objMessage = $objSmpp.FetchSmsUpdate
    If ($objSmpp.LastError -eq 0) {
        Write-Host "Reference: $($objMessage.Reference); UserTag: $($objMessage.UserTag)"
        Start-Sleep -Milliseconds 1
    }
}
var objSmpp = new AxSms.Smpp();
var objMessage = new AxSms.Message();
...
while (objSmpp.WaitForSmsUpdate)
{
    objMessage = objSmpp.FetchSmsUpdate;
    if (objSmpp.LastError == 0)
    {
        Console.WriteLine("Reference: " + objMessage.Reference + 
            "; UserTag: " + objMessage.UserTag);
        System.Threading.Thread.Sleep(1);
    }
}
Set objSmpp = CreateObject("AxSms.Smpp")
Set objMessage = CreateObject("AxSms.Message")
...
While objSmpp.WaitForSmsUpdate
    Set objMessage = objsmpp.FetchSmsUpdate
    If objSmpp.LastError = 0 Then
        WScript.Echo "Reference: " & objMessage.Reference & "; UserTag: " & objMessage.UserTag
        WScript.Sleep 1
    End If
WEnd

DataCoding property

Data coding byte. This property should be used to set the required datacoding of the property field, for instance, when a message should be sent as Unicode instead of the normal 7 bit GSM character set.

When setting this property use these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.DataCoding = $objConst.DATACODING_UNICODE
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.DataCoding = objConst.DATACODING_UNICODE;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.DataCoding = objConst.DATACODING_UNICODE
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

LanguageLockingShift property

Get or set the national language locking shift table for this message. The locking shift table determines which character set is active by default.

Use this property when sending SMS messages in any of these languages instead of setting the datacoding to Unicode. When using the LanguageLockingShift / LanguageSingleShift properties you can sent up to 152 characters in a single SMS message instead of only 70 when using Unicode.

Use this property together with LanguageSingleShift on GSM, SMPP or SMPP Server. When using this property with SMPP please make sure that the UseGsmEncoding is not set to disabled.

When setting this property use these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.DataCoding = $objConst.DATACODING_DEFAULT
$objMessage.LanguageLockingShift = $objConst.LANGUAGE_LOCKINGSHIFT_HINDI
$objMessage.LanguageSingleShift = $objConst.LANGUAGE_SINGLESHIFT_HINDI
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.DataCoding = objConst.DATACODING_DEFAULT;
objMessage.LanguageLockingShift = objConst.LANGUAGE_LOCKINGSHIFT_HINDI;
objMessage.LanguageSingleShift = objConst.LANGUAGE_SINGLESHIFT_HINDI;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.DataCoding = objConst.DATACODING_DEFAULT
objMessage.LanguageLockingShift = objConst.LANGUAGE_LOCKINGSHIFT_HINDI
objMessage.LanguageSingleShift = objConst.LANGUAGE_SINGLESHIFT_HINDI
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

LanguageSingleShift property

Get or set the national language single shift table for this message. The single shift table determines which character set is available for extended (shifted) characters.

Use this property when sending SMS messages in any of these languages instead of setting the datacoding to Unicode. When using the LanguageLockingShift / LanguageSingleShift properties you can sent up to 152 characters in a single SMS message instead of only 70 when using Unicode.

Use this property together with LanguageLockingShift on GSM, SMPP or SMPP Server. When using this property with SMPP please make sure that the UseGsmEncoding is not set to disabled.

When setting this property use these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.DataCoding = $objConst.DATACODING_DEFAULT
$objMessage.LanguageLockingShift = $objConst.LANGUAGE_LOCKINGSHIFT_HINDI
$objMessage.LanguageSingleShift = $objConst.LANGUAGE_SINGLESHIFT_HINDI
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.DataCoding = objConst.DATACODING_DEFAULT;
objMessage.LanguageLockingShift = objConst.LANGUAGE_LOCKINGSHIFT_HINDI;
objMessage.LanguageSingleShift = objConst.LANGUAGE_SINGLESHIFT_HINDI;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.DataCoding = objConst.DATACODING_DEFAULT
objMessage.LanguageLockingShift = objConst.LANGUAGE_LOCKINGSHIFT_HINDI
objMessage.LanguageSingleShift = objConst.LANGUAGE_SINGLESHIFT_HINDI
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

BodyFormat property

The body format property. This specifies the format of the Body property. When setting this property use these constants

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.BodyFormat = $objConst.BODYFORMAT_TEXT
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.BodyFormat = objConst.BODYFORMAT_TEXT;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.BodyFormat = objConst.BODYFORMAT_TEXT
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

HasUdh property

Whether a User Data Header is present. This specifies if the SMS message has a UDH header prefixing the message.

Since a UDH header is always binary the BodyFormat will always be set to BODYFORMAT_HEX on incoming messages that have a UDH header. When sending a message with a UDH header the message should be specified in HEX.

Depending on the multipart or application port settings on either the GSM or the SMPP protocol the SMS Component may generate UDH headers when sending and splitting up multipart messages or application port messages. In the same way the SMS Component may interpret UDH headers when receiving multipart or application port headers. In these cases the hasUdh property will remain ‘false’ unless a UDH header cannot be interpreted or does not need to be generated and ends up in the Message object.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.BodyFormat = $objConst.BODYFORMAT_TEXT
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.BodyFormat = objConst.BODYFORMAT_TEXT;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.BodyFormat = objConst.BODYFORMAT_TEXT
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

ReceiveTime property

This property will contain the receive time of this message.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Receive time: $($objMessage.ReceiveTime)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Receive time: " + objMessage.ReceiveTime);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Receive time: " & objMessage.ReceiveTime
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

ReceiveTimeInSeconds property

This property will contain the receive time of this message in seconds.

The receive time is in seconds since 1/1/1970 (Unix time-stamp) format.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Receive time in seconds: $($objMessage.ReceiveTimeInSeconds)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Receive time in seconds: " + objMessage.ReceiveTimeInSeconds);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Receive time in seconds: " & objMessage.ReceiveTimeInSeconds
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

TotalParts property

If this message is part of a multipart message this property will be set to the total number of parts the multipart message consists of. The ‘PartNumber‘ property contains the part number for this message.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objGsm = New-Object -ComObject AxSms.Gsm
$objConst = New-Object -ComObject AxSms.Constants
...
$objGsm.AssembleMultipart = $false
$objGsm.Receive($objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD)
If ($objGsm.LastError -ne 0) {
    Write-Host "Error: $($objGsm.GetErrorDescription($objGsm.LastError))"
    exit 1
}
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host $objMessage.Body
    Write-Host "Part $($objMessage.PartNumber) from $($objMessage.TotalParts)"
    $objMessage = $objGsm.GetNextSms
}
var objMessage = new AxSms.Message();
var objGsm = new AxSms.Gsm();
var objConst = new AxSms.Constants();
...
objGsm.AssembleMultipart = false;
objGsm.Receive(objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD);
if (objGsm.LastError != 0)
{
    Console.WriteLine("Error: " + objGsm.GetErrorDescription(objGsm.LastError));
    return 1;
}
...
objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine(objMessage.Body);
    Console.WriteLine("Part " + objMessage.PartNumber + " from " + objMessage.TotalParts);
    objMessage = objGsm.GetNextSms;
}
Set objMessage = CreateObject("AxSms.Message")
Set objGsm = CreateObject("AxSms.Gsm")
Set objConst = CreateObject("AxSms.Constants")
...
objGsm.AssembleMultipart = false
objGsm.Receive objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD
If objGsm.LastError <> 0 Then
    WScript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
    WScript.Quit 1
End If
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo objMessage.Body
    WScript.Echo "Part " & objMessage.PartNumber & " from " & objMessage.TotalParts
    Set objMessage = objGsm.GetNextSms
Wend

PartNumber property

If this message is part of a multipart message this property will be set to the part number of this SMS message. The ‘TotalParts‘ property contains the total number of parts for the entire message

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objGsm = New-Object -ComObject AxSms.Gsm
$objConst = New-Object -ComObject AxSms.Constants
...
$objGsm.AssembleMultipart = $false
$objGsm.Receive($objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD)
If ($objGsm.LastError -ne 0) {
    Write-Host "Error: $($objGsm.GetErrorDescription($objGsm.LastError))"
    exit 1
}
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host $objMessage.Body
    Write-Host "Part $($objMessage.PartNumber) from $($objMessage.TotalParts)"
    $objMessage = $objGsm.GetNextSms
}
var objMessage = new AxSms.Message();
var objGsm = new AxSms.Gsm();
var objConst = new AxSms.Constants();
...
objGsm.AssembleMultipart = false;
objGsm.Receive(objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD);
if (objGsm.LastError != 0)
{
    Console.WriteLine("Error: " + objGsm.GetErrorDescription(objGsm.LastError));
    return 1;
}
...
objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine(objMessage.Body);
    Console.WriteLine("Part " + objMessage.PartNumber + " from " + objMessage.TotalParts);
    objMessage = objGsm.GetNextSms;
}
Set objMessage = CreateObject("AxSms.Message")
Set objGsm = CreateObject("AxSms.Gsm")
Set objConst = CreateObject("AxSms.Constants")
...
objGsm.AssembleMultipart = false
objGsm.Receive objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD
If objGsm.LastError <> 0 Then
    WScript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
    WScript.Quit 1
End If
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo objMessage.Body
    WScript.Echo "Part " & objMessage.PartNumber & " from " & objMessage.TotalParts
    Set objMessage = objGsm.GetNextSms
Wend

MultipartRef property

If the message is part of a multipart message this property will be set to the multipart reference number of this SMS message.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objGsm = New-Object -ComObject AxSms.Gsm
$objConst = New-Object -ComObject AxSms.Constants
...
$objGsm.AssembleMultipart = $false
$objGsm.Receive($objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD)
If ($objGsm.LastError -ne 0) {
    Write-Host "Error: $($objGsm.GetErrorDescription($objGsm.LastError))"
    exit 1
}
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host $objMessage.Body
    Write-Host "Multipart reference: $($objMessage.MultipartRef)"
    Write-Host "Part $($objMessage.PartNumber) from $($objMessage.TotalParts)"
    $objMessage = $objGsm.GetNextSms
}
var objMessage = new AxSms.Message();
var objGsm = new AxSms.Gsm();
var objConst = new AxSms.Constants();
...
objGsm.AssembleMultipart = false;
objGsm.Receive(objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD);
if (objGsm.LastError != 0)
{
    Console.WriteLine("Error: " + objGsm.GetErrorDescription(objGsm.LastError));
    return 1;
}
...
objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine(objMessage.Body);
    Console.WriteLine("Multipart reference: " + objMessage.MultipartRef);
    Console.WriteLine("Part " + objMessage.PartNumber + " from " + objMessage.TotalParts);
    objMessage = objGsm.GetNextSms;
}
Set objMessage = CreateObject("AxSms.Message")
Set objGsm = CreateObject("AxSms.Gsm")
Set objConst = CreateObject("AxSms.Constants")
...
objGsm.AssembleMultipart = false
objGsm.Receive objConst.GSM_MESSAGESTATE_RECEIVED_UNREAD
If objGsm.LastError <> 0 Then
    WScript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
    WScript.Quit 1
End If
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo objMessage.Body
    WScript.Echo "Multipart reference: " & objMessage.MultipartRef
    WScript.Echo "Part " & objMessage.PartNumber & " from " & objMessage.TotalParts
    Set objMessage = objGsm.GetNextSms
Wend

Incomplete property

This property is set to true when one or more of the parts of this message have not been received (yet). For instance, incomplete messages can appear on a SIM card (using a Gsm device) or when a multipart message times out (using Smpp).

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objGsm = New-Object -ComObject AxSms.Gsm
$objConst = New-Object -ComObject AxSms.Constants
...
$objGsm.AssembleMultipart = $true
$objGsm.Receive($objConst.GSM_MESSAGESTATE_ALL)
If ($objGsm.LastError -ne 0) {
    Write-Host "Error: $($objGsm.GetErrorDescription($objGsm.LastError))"
    exit 1
}
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Incomplete: $($objMessage.Incomplete)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objMessage = new AxSms.Message();
var objGsm = new AxSms.Gsm();
var objConst = new AxSms.Constants();
...
objGsm.AssembleMultipart = true;
objGsm.Receive(objConst.GSM_MESSAGESTATE_ALL);
if (objGsm.LastError != 0)
{
    Console.WriteLine("Error: " + objGsm.GetErrorDescription(objGsm.LastError));
    return 1;
}
...
objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Incomplete: " + objMessage.Incomplete);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objMessage = CreateObject("AxSms.Message")
Set objGsm = CreateObject("AxSms.Gsm")
Set objConst = CreateObject("AxSms.Constants")
...
objGsm.AssembleMultipart = true
objGsm.Receive objConst.GSM_MESSAGESTATE_ALL
If objGsm.LastError <> 0 Then
    WScript.Echo "Error: " & objGsm.GetErrorDescription(objGsm.LastError)
    WScript.Quit 1
End If
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Incomplete: " & objMessage.Incomplete
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

GsmFirstOctet property

This is the first octet value. This property is used when a specific first octet setting is required which can not be set using other properties like RequestDeliveryReport

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.GsmFirstOctet = $objConst.GSM_FO_UDHI
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.GsmFirstOctet = objConst.GSM_FO_UDHI;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.GsmFirstOctet = objConst.GSM_FO_UDHI
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

GsmSmscAddress property

The address for the SMSC that delivered this SMS. To specify a preferred SMS to delivery a message use the PreferredSmsc property on the Gsm object.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Smsc address: $($objMessage.GsmSmscAddress)"
    Write-Host "Smsc address TON: $($objMessage.GsmSmscAddressTON)"
    Write-Host "Smsc address NPI: $($objMessage.GsmSmscAddressNPI)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Smsc address: " + objMessage.GsmSmscAddress);
    Console.WriteLine("Smsc address TON: " + objMessage.GsmSmscAddressTON);
    Console.WriteLine("Smsc address NPI: " + objMessage.GsmSmscAddressNPI);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Smsc address: " & objMessage.GsmSmscAddress
    WScript.Echo "Smsc address TON: " & objMessage.GsmSmscAddressTON
    WScript.Echo "Smsc address NPI: " & objMessage.GsmSmscAddressNPI
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

GsmSmscAddressTON property

The Type of Number for the SmscAddress. This will always be one of these constants.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Smsc address: $($objMessage.GsmSmscAddress)"
    Write-Host "Smsc address TON: $($objMessage.GsmSmscAddressTON)"
    Write-Host "Smsc address NPI: $($objMessage.GsmSmscAddressNPI)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Smsc address: " + objMessage.GsmSmscAddress);
    Console.WriteLine("Smsc address TON: " + objMessage.GsmSmscAddressTON);
    Console.WriteLine("Smsc address NPI: " + objMessage.GsmSmscAddressNPI);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Smsc address: " & objMessage.GsmSmscAddress
    WScript.Echo "Smsc address TON: " & objMessage.GsmSmscAddressTON
    WScript.Echo "Smsc address NPI: " & objMessage.GsmSmscAddressNPI
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

GsmSmscAddressNPI property

The Numbering Plan Indicator for the SmscAddress. This will always be one of these constants.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Smsc address: $($objMessage.GsmSmscAddress)"
    Write-Host "Smsc address TON: $($objMessage.GsmSmscAddressTON)"
    Write-Host "Smsc address NPI: $($objMessage.GsmSmscAddressNPI)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Smsc address: " + objMessage.GsmSmscAddress);
    Console.WriteLine("Smsc address TON: " + objMessage.GsmSmscAddressTON);
    Console.WriteLine("Smsc address NPI: " + objMessage.GsmSmscAddressNPI);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Smsc address: " & objMessage.GsmSmscAddress
    WScript.Echo "Smsc address TON: " & objMessage.GsmSmscAddressTON
    WScript.Echo "Smsc address NPI: " & objMessage.GsmSmscAddressNPI
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

GsmMemoryIndex property

If this message was received through GSM this property will contain the memory index that holds this message. Together with the MemoryLocation this property identifies where this message is located in the device.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Memory index: $($objMessage.GsmMemoryIndex)"
    Write-Host "Memory location: $($objMessage.GsmMemoryLocation)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Memory index: " + objMessage.GsmMemoryIndex);
    Console.WriteLine("Memory location: " + objMessage.GsmMemoryLocation);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Memory index: " & objMessage.GsmMemoryIndex
    WScript.Echo "Memory location: " & objMessage.GsmMemoryLocation
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

GsmMemoryLocation property

If this message was received through GSM this property will contain the memory location that holds this message. Together with the MemoryIndex this property identifies where this message is located in the device.

Example:

$objGsm = New-Object -ComObject AxSms.Gsm
...
$objMessage = $objGsm.GetFirstSms
While ($objGsm.LastError -eq 0) {
    Write-Host "Received from: $($objMessage.FromAddress)"
    Write-Host "Memory index: $($objMessage.GsmMemoryIndex)"
    Write-Host "Memory location: $($objMessage.GsmMemoryLocation)"
    Write-Host $objMessage.Body
    $objMessage = $objGsm.GetNextSms
}
var objGsm = new AxSms.Gsm();
...
var objMessage = objGsm.GetFirstSms;
while (objGsm.LastError == 0)
{
    Console.WriteLine("Received from: " + objMessage.FromAddress);
    Console.WriteLine("Memory index: " + objMessage.GsmMemoryIndex);
    Console.WriteLine("Memory location: " + objMessage.GsmMemoryLocation);
    Console.WriteLine(objMessage.Body);
    objMessage = objGsm.GetNextSms;
}
Set objGsm = CreateObject("AxSms.Gsm")
...
Set objMessage = objGsm.GetFirstSms
While objGsm.LastError = 0
    WScript.Echo "Received from: " & objMessage.FromAddress
    WScript.Echo "Memory index: " & objMessage.GsmMemoryIndex
    WScript.Echo "Memory location: " & objMessage.GsmMemoryLocation
    WScript.Echo objMessage.Body
    Set objMessage = objGsm.GetNextSms
Wend

SmppPriority property

Set this property to the message priority. Use one of these constants

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.SmppPriority = $objConst.GSM_FO_UDHI
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.SmppPriority = objConst.GSM_FO_UDHI;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.SmppPriority = objConst.GSM_FO_UDHI
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

SmppServiceType property

Set this property to the service type. These are some service types that can be used:

  • “” – Empty string (default)
  • “CMT” – Cellular Messaging
  • “CPT” – Cellular Paging
  • “VMN” – Voice Mail Notification
  • “VMA” – Voice Mail Alerting
  • “WAP” – Wireless Application Protocol
  • “USSD” – Unstructured Supplementary Services Data
  • “CBS” – Cell Broadcast Service
  • “GUTS” – Generic UDP Transport Service

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.SmppServiceType = "USSD"
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "?*101#??"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.SmppServiceType = "USSD";
objMessage.ToAddress = "+31122334455";
objMessage.Body = "?*101#??";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.SmppServiceType = "USSD"
objMessage.ToAddress = "+31122334455"
objMessage.Body = "?*101#??"
...

SmppEsmClass property

This is the ESM class value. This property is used when a specific ESM class setting is required which can not be set using other properties like RequestDeliveryReport. Use one of these constants.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objConst = New-Object -ComObject AxSms.Constants
...
$objMessage.SmppEsmClass = $objConst.SMPP_ESM_2ESME_DELIVERY_RECEIPT
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
var objConst = new AxSms.Constants();
...
objMessage.SmppEsmClass = objConst.SMPP_ESM_2ESME_DELIVERY_RECEIPT;
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
Set objConst = CreateObject("AxSms.Constants")
...
objMessage.SmppEsmClass = objConst.SMPP_ESM_2ESME_DELIVERY_RECEIPT
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

SmppStatus property

This is the last known message status for an SMPP message. This property is always set to one of these constants.

Example:

$objSmpp = New-Object -ComObject AxSms.Smpp
$objMessage = New-Object -ComObject AxSms.Message
...
$objSmpp.QuerySms($objMessage)
While ($objSmpp.WaitForSmsUpdate) {
    $objMessage = $objSmpp.FetchSmsUpdate
    If ($objSmpp.LastError -eq 0) {
        Write-Host ("Reference: " + $objMessage.Reference + "; UserTag: " + `
            $objMessage.UserTag + $objMessage.SmppStatus)
        Start-Sleep -Milliseconds 1
    }
}
var objSmpp = new AxSms.Smpp();
var objMessage = new AxSms.Message();
...
objSmpp.QuerySms(objMessage);
while (objSmpp.WaitForSmsUpdate)
{
    objMessage = objSmpp.FetchSmsUpdate;
    if (objSmpp.LastError == 0)
    {
        Console.WriteLine("Reference: " + objMessage.Reference + "; UserTag: " + 
            objMessage.UserTag + objMessage.SmppStatus);
        System.Threading.Thread.Sleep(1);
    }
}
Set objSmpp = CreateObject("AxSms.Smpp")
Set objMessage = CreateObject("AxSms.Message")
...
objSmpp.QuerySms objMessage
While objSmpp.WaitForSmsUpdate
    Set objMessage = objsmpp.FetchSmsUpdate
    If objSmpp.LastError = 0 Then
        WScript.Echo "Reference: " & objMessage.Reference & "; UserTag: " & objMessage.UserTag & _
            objMessage.SmppStatus
        WScript.Sleep 1
    End If
WEnd

SmppError property

This is the error code for this message. This will only be set by querying a message.

Example:

$objSmpp = New-Object -ComObject AxSms.Smpp
$objMessage = New-Object -ComObject AxSms.Message
...
$objSmpp.QuerySms($objMessage)
While ($objSmpp.WaitForSmsUpdate) {
    $objMessage = $objSmpp.FetchSmsUpdate
    If ($objSmpp.LastError -eq 0) {
        Write-Host ("Reference: " + $objMessage.Reference + "; UserTag: " + `
            $objMessage.UserTag + $objMessage.SmppError)
        Start-Sleep -Milliseconds 1
    }
}
var objSmpp = new AxSms.Smpp();
var objMessage = new AxSms.Message();
...
objSmpp.QuerySms(objMessage);
while (objSmpp.WaitForSmsUpdate)
{
    objMessage = objSmpp.FetchSmsUpdate;
    if (objSmpp.LastError == 0)
    {
        Console.WriteLine("Reference: " + objMessage.Reference + "; UserTag: " + 
            objMessage.UserTag + objMessage.SmppError);
        System.Threading.Thread.Sleep(1);
    }
}
Set objSmpp = CreateObject("AxSms.Smpp")
Set objMessage = CreateObject("AxSms.Message")
...
objSmpp.QuerySms objMessage
While objSmpp.WaitForSmsUpdate
    Set objMessage = objsmpp.FetchSmsUpdate
    If objSmpp.LastError = 0 Then
        WScript.Echo "Reference: " & objMessage.Reference & "; UserTag: " & objMessage.UserTag & _
            objMessage.SmppError
        WScript.Sleep 1
    End If
WEnd

SmppIsDeliveryReport property

This property will be set to true if this message is a delivery report. Set this property to create a delivery report.

Using this property is equivalent to testing the ‘SmppEsmClass‘ property for the ‘SMPP_ESM_2ESME_DELIVERY_RECEIPT‘ bit.

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objSmpp = New-Object -ComObject AxSms.Smpp
...
$objMessage = $objSmpp.ReceiveMessage()
While ($objSmpp.LastError -eq 0) {
    If ($objMessage.SmppIsDeliveryReport) {
        $ref = $objMessage.Body.Substring(0, $objMessage.Body.IndexOf(" "))
        $statIdx = $objMessage.Body.IndexOf("stat:") + 5
        $stat = $objMessage.Body.Substring($statIdx, 7)
        Write-Host "Delivery rpt for: $ref State: $stat"
    } Else {
        Write-Host "Received toaddress: $($objMessage.ToAddress)"
        Write-Host "Body: $($objMessage.Body)"
    }
    $objMessage = $objSmpp.ReceiveMessage()
}
...
var objMessage = new AxSms.Message();
var objSmpp = new AxSms.Smpp();
...
objMessage = objSmpp.ReceiveMessage();
while (objSmpp.LastError == 0)
{
    if (objMessage.SmppIsDeliveryReport)
    {
        string body = objMessage.Body;
        string refPart = body.Substring(0, body.IndexOf(" "));
        string stat = body.Substring(body.IndexOf("stat:") + 5, 7);
        Console.WriteLine("Delivery rpt for: " + refPart + " State: " + stat);
    }
    else
    {
        Console.WriteLine("Received toaddress: " + objMessage.ToAddress);
        Console.WriteLine("Body: " + objMessage.Body);
    }
    objMessage = objSmpp.ReceiveMessage();
}
...
Set objMessage = CreateObject("AxSms.Message")
Set objSmpp = CreateObject("AxSms.Smpp")
...
Set objMessage = objSmpp.ReceiveMessage()
While objSmpp.LastError = 0
    If objMessage.SmppIsDeliveryReport Then
        WScript.Echo "Delivery rpt for: " & Left(objMessage.Body, InStr(objMessage.Body, " ")) & _
            "State: " & Mid(objMessage.Body, InStr(objMessage.Body, "stat:")+5, 7)
    Else
        WScript.Echo "Received toaddress: " & objMessage.ToAddress
        WScript.Echo "Body: " & objMessage.Body
    End If
    Set objMessage = objSmpp.ReceiveMessage()
Wend
...

SmppCommandStatus property

This is the command status from the ‘SUBMIT_SM_RESP’ command or the ‘QUERY_SM_RESP’ command if applicable. If an SMS message is rejected by the server this will contain a status code. This will always be set to one of these constants.

Example:

$objSmpp = New-Object -ComObject AxSms.Smpp
$objMessage = New-Object -ComObject AxSms.Message
...
$objSmpp.SubmitSms($objMessage)
While ($objSmpp.WaitForSmsUpdate) {
    $objMessage = $objSmpp.FetchSmsUpdate
    If (($objSmpp.LastError -eq 0) -and ($objMessage.SmppCommandStatus -eq 0)) {
        Write-Host "Reference: $($objMessage.Reference); UserTag: $($objMessage.UserTag)"
    } ElseIf ($objMessage.SmppCommandStatus -ne 0) {
        Write-Host "Status: $($objMessage.SmppCommandStatus)"
    }
    Start-Sleep -Milliseconds 1
}
var objSmpp = new AxSms.Smpp();
var objMessage = new AxSms.Message();
...
objSmpp.SubmitSms(objMessage);
while (objSmpp.WaitForSmsUpdate)
{
    objMessage = objSmpp.FetchSmsUpdate;
    if (objSmpp.LastError == 0 && objMessage.SmppCommandStatus == 0)
    {
        Console.WriteLine("Reference: " + objMessage.Reference + 
            "; UserTag: " + objMessage.UserTag);
    }
    else if (objMessage.SmppCommandStatus != 0)
    {
        Console.WriteLine("Status: " + objMessage.SmppCommandStatus);
    }
    System.Threading.Thread.Sleep(1);
}
Set objSmpp = CreateObject("AxSms.Smpp")
Set objMessage = CreateObject("AxSms.Message")
...
objSmpp.SubmitSms objMessage
While objSmpp.WaitForSmsUpdate
    Set objMessage = objsmpp.FetchSmsUpdate
    If objSmpp.LastError = 0 And objMessage.SmppCommandStatus = 0 Then
        WScript.Echo "Reference: " & objMessage.Reference & "; UserTag: " & objMessage.UserTag &
    ElsIf objMessage.SmppCommandStatus <> 0 Then
        WScript.Echo "Status: " & objMessage.SmppCommandStatus
    End
    WScript.Sleep 1
WEnd

SmppSequenceNumber property

This is the sequence number associated with the message. This property is only set in the messages received from FetchSmsUpdate

Example:

$objSmpp = New-Object -ComObject AxSms.Smpp
$objMessage = New-Object -ComObject AxSms.Message
...
$objSmpp.SubmitSms($objMessage)
While ($objSmpp.WaitForSmsUpdate) {
    $objMessage = $objSmpp.FetchSmsUpdate
    If (($objSmpp.LastError -eq 0) -and ($objMessage.SmppCommandStatus -eq 0)) {
        Write-Host "Sequence number: $($objMessage.SmppSequenceNumber)"
    } ElseIf ($objMessage.SmppCommandStatus -ne 0) {
        Write-Host "Status: $($objMessage.SmppCommandStatus)"
    }
    Start-Sleep -Milliseconds 1
}
var objSmpp = new AxSms.Smpp();
var objMessage = new AxSms.Message();
...
objSmpp.SubmitSms(objMessage);
while (objSmpp.WaitForSmsUpdate)
{
    objMessage = objSmpp.FetchSmsUpdate;
    if (objSmpp.LastError == 0 && objMessage.SmppCommandStatus == 0)
    {
        Console.WriteLine("Sequence number: " + objMessage.SmppSequenceNumber);
    }
    else if (objMessage.SmppCommandStatus != 0)
    {
        Console.WriteLine("Status: " + objMessage.SmppCommandStatus);
    }
    System.Threading.Thread.Sleep(1);
}
Set objSmpp = CreateObject("AxSms.Smpp")
Set objMessage = CreateObject("AxSms.Message")
...
objSmpp.SubmitSms objMessage
While objSmpp.WaitForSmsUpdate
    Set objMessage = objsmpp.FetchSmsUpdate
    If objSmpp.LastError = 0 And objMessage.SmppCommandStatus = 0 Then
        WScript.Echo "Sequence number: " & objMessage.SmppSequenceNumber
    ElsIf objMessage.SmppCommandStatus <> 0 Then
        WScript.Echo "Status: " & objMessage.SmppCommandStatus
    End
    WScript.Sleep 1
WEnd

SmppServerSubmitDate property

This is the submit timestamp of an SMS message. The property is automatically set by the SMS component when a submit is received.

This timestamp is used when automatically creating a delivery report for the client using DeliverReport.

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));
            return 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));
            return 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

SmppServerFinalDate property

The is the timestamp of the final status of the message. That is the timestamp of the message delivery or the timestamp of the delivery failure.

This timestamp value is set to the current time when automatically creating a delivery report for the client using DeliverReport.

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));
            return 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));
            return 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

Clear method

This method resets all properties to their default values.

Parameters:

  • None

Return value:

None

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objMessage.Clear()
$objMessage.ToAddress = "+31122334455"
$objMessage.Body = "Short SMS message"
...
var objMessage = new AxSms.Message();
...
objMessage.Clear();
objMessage.ToAddress = "+31122334455";
objMessage.Body = "Short SMS message";
...
Set objMessage = CreateObject("AxSms.Message")
...
objMessage.Clear
objMessage.ToAddress = "+31122334455"
objMessage.Body = "Short SMS message"
...

GetErrorDescription method

GetErrorDescription provides the error description of a given error code.

Parameters:

  • Error code

Return value:

The error string

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objTlv = $objSms.SmppGetFirstTlv()
While ($objSms.LastError -eq 0) {
    Write-Host "Tag: $($objTlv.Tag); Value: $($objTlv.ValueAsHexString)"
    $objTlv = $objSms.SmppGetNextTlv()
}
...
Write-Host $objSms.GetErrorDescription($objSmpp.LastError)
var objMessage = new AxSms.Message();
...
var objTlv = objSms.SmppGetFirstTlv();
while (objSms.LastError == 0)
{
    Console.WriteLine("Tag: " + objTlv.Tag + "; Value: " + objTlv.ValueAsHexString);
    objTlv = objSms.SmppGetNextTlv();
}
...
Console.WriteLine(objSms.GetErrorDescription(objSmpp.LastError));
Set objMessage = CreateObject("AxSms.Message")
...
Set objTlv = objSms.SmppGetFirstTlv()
While objSms.LastError = 0
    WScript.Echo "Tag: " & objTlv.Tag & "; Value: " & objTlv.ValueAsHexString
    Set objTlv = objSms.SmppGetNextTlv()
Wend
...
WScript.Echo objSms.GetErrorDescription(objSmpp.LastError)

ToJSon method

Serialize this message to JSON string. Deserialize this message using FromJSon.

Parameters:

  • none

Return value:

JSON formatted representation of this message contents

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objOtherMessage = New-Object -ComObject AxSms.Message
...
$sJSonDump = $objMessage.ToJSon()
Write-Host $sJSonDump
$objOtherMessage.FromJSon($sJSonDump)
...
var objMessage = new AxSms.Message();
var objOtherMessage = new AxSms.Message();
...
string sJSonDump = objMessage.ToJSon();
Console.WriteLine(sJSonDump);
objOtherMessage.FromJSon(sJSonDump);
...
Set objMessage = CreateObject("AxSms.Message")
Set objOtherMessage = CreateObject("AxSms.Message")
...
sJSonDump = objMessage.ToJSon()
WScript.Echo sJSonDump
objOtherMessage.FromJSon(sJSonDump)
...

FromJSon method

Deserialize into this message object from a JSON string. Serialize using ToJSon.

Parameters:

  • JSON formatted string

Return value:

None

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objOtherMessage = New-Object -ComObject AxSms.Message
...
$sJSonDump = $objMessage.ToJSon()
Write-Host $sJSonDump
$objOtherMessage.FromJSon($sJSonDump)
...
var objMessage = new AxSms.Message();
var objOtherMessage = new AxSms.Message();
...
string sJSonDump = objMessage.ToJSon();
Console.WriteLine(sJSonDump);
objOtherMessage.FromJSon(sJSonDump);
...
Set objMessage = CreateObject("AxSms.Message")
Set objOtherMessage = CreateObject("AxSms.Message")
...
sJSonDump = objMessage.ToJSon()
WScript.Echo sJSonDump
objOtherMessage.FromJSon(sJSonDump)
...

SmppAddTlv method

Add a Tlv (Tag, Length, Value) object to this message.

Parameters:

Return value:

None

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objTlv = New-Object -ComObject AxSms.Tlv
...
$objTlv.Tag = 100
$objTlv.ValueAsString = "Hello"
$objMessage.SmppAddTlv($objTlv)
...
var objMessage = new AxSms.Message();
var objTlv = new AxSms.Tlv();
...
objTlv.Tag = 100;
objTlv.ValueAsString = "Hello";
objMessage.SmppAddTlv(objTlv);
...
Set objMessage = CreateObject("AxSms.Message")
Set objTlv = CreateObject("AxSms.Tlv")
...
objTlv.Tag = 100
objTlv.ValueAsString = "Hello"
objMessage.SmppAddTlv objTlv
...

SmppGetTlv method

This method returns a specific TLV (Tag, Length, Value) object according to the Tag value. This is a list of common TLV Tag values.

Parameters:

  • The Tag value

Return value:

Tlv object

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objTlv = $objMessage.SmppGetTlv(100)
Write-Host $objTlv.ValueAsHexString
...
var objMessage = new AxSms.Message();
...
var objTlv = objMessage.SmppGetTlv(100);
Console.WriteLine(objTlv.ValueAsHexString);
...
Set objMessage = CreateObject("AxSms.Message")
...
Set objTlv = objMessage.SmppGetTlv(100)
WScript.Echo objTlv.ValueAsHexString
...

SmppGetFirstTlv method

This method return the first TLV value attached to this message.

Parameters:

  • None

Return value:

Tlv object

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objTlv = $objMessage.SmppGetFirstTlv()
While ($objMessage.LastError -eq 0) {
    Write-Host "Tag: $($objTlv.Tag); Value: $($objTlv.ValueAsHexString)"
    $objTlv = $objMessage.SmppGetNextTlv()
}
var objMessage = new AxSms.Message();
...
var objTlv = objMessage.SmppGetFirstTlv();
while (objMessage.LastError == 0)
{
    Console.WriteLine("Tag: " + objTlv.Tag + "; Value: " + objTlv.ValueAsHexString);
    objTlv = objMessage.SmppGetNextTlv();
}
Set objMessage = CreateObject("AxSms.Message")
...
Set objTlv = objMessage.SmppGetFirstTlv()
While objMessage.LastError = 0
    WScript.Echo "Tag: " & objTlv.Tag & "; Value: " & objTlv.ValueAsHexString
    Set objTlv = objMessage.SmppGetNextTlv()
Wend

SmppGetNextTlv method

This method return the next TLV value attached to this message

Parameters:

  • None

Return value:

Tlv object

Example:

$objMessage = New-Object -ComObject AxSms.Message
...
$objTlv = $objMessage.SmppGetFirstTlv()
While ($objMessage.LastError -eq 0) {
    Write-Host "Tag: $($objTlv.Tag); Value: $($objTlv.ValueAsHexString)"
    $objTlv = $objMessage.SmppGetNextTlv()
}
var objMessage = new AxSms.Message();
...
var objTlv = objMessage.SmppGetFirstTlv();
while (objMessage.LastError == 0)
{
    Console.WriteLine("Tag: " + objTlv.Tag + "; Value: " + objTlv.ValueAsHexString);
    objTlv = objMessage.SmppGetNextTlv();
}
Set objMessage = CreateObject("AxSms.Message")
...
Set objTlv = objMessage.SmppGetFirstTlv()
While objMessage.LastError = 0
    WScript.Echo "Tag: " & objTlv.Tag & "; Value: " & objTlv.ValueAsHexString
    Set objTlv = objMessage.SmppGetNextTlv()
WEnd

SmppDeleteTlv method

Delete a Tlv (Tag, Length, Value) object from this message.

Parameters:

  • Tag value

Return value:

None

Example:

$objMessage = New-Object -ComObject AxSms.Message
$objTlv = New-Object -ComObject AxSms.Tlv
...
$objTlv.Tag = 100
$objTlv.ValueAsString = "Hello"
$objMessage.SmppAddTlv($objTlv)
...
$objMessage.SmppDeleteTlv(100)
...
var objMessage = new AxSms.Message();
var objTlv = new AxSms.Tlv();
...
objTlv.Tag = 100;
objTlv.ValueAsString = "Hello";
objMessage.SmppAddTlv(objTlv);
...
objMessage.SmppDeleteTlv(100);
...
Set objMessage = CreateObject("AxSms.Message")
Set objTlv = CreateObject("AxSms.Tlv")
...
objTlv.Tag = 100
objTlv.ValueAsString = "Hello"
objMessage.SmppAddTlv objTlv
...
objMessage.SmppDeleteTlv 100
...