Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > SMS Component > Objects > Smpp

ActiveXperts SMS Component Add SMS capabilities to any Windows or .NET application

Quicklinks


SMS Component - Smpp object

Overview

The Short Message Peer to Peer protocol (SMPP) is used for sending and receiving SMS messages. It's a TCP/IP based binary application protocol which was specifically developed for high volume, low latency sending of SMS messages. The protocol supports all SMS features like delivery reports / binary SMS messages etc..

An SMPP client, such as the SMS Component, will connect directly to an SMPP based SMSC interface. It will connect either directly through the internet or through VPN software. Most SMPP providers support connecting directly through the internet.

Some advantages for using SMPP instead of a GSM modem:

  • Direct connection through internet/VPN. No other hardware or SIM card is required
  • Users can send SMS to a simple shortcode, this is not possible when sending to a GSM phone
  • The name of your company can be used as a sender ID instead of a phone number
  • High throughput, 200 or 300 message per second on a normal desktop class PC

The Smpp object features the following:

  • Send and receive SMS messages through SMPP 3.3 / 3.4 and 5.0 providers
  • Send and receive alphanumeric, Unicode and binary SMS messages
  • Templates for WAP Push messages and vCard messages
  • Delivery can be verified through delivery reports
  • Supports automatically splitting up / re-assembling multipart messages

The Smpp object is part of the ActiveXperts SMS Component. Overview of all SMS Component objects:

  • Gsm - Send and receive SMS messages using a GSM modem or a modem-capable GSM phone.
  • Smpp - Send and receive SMS messages via an SMPP provider.
  • SmppServer - Accept incoming SMPP connections.
  • Http - Send SMS messages through an HTTP based SMSC provider interface over the internet.
  • Dialup - Send SMS messages using a Hayes compatible modem through TAP/XIO or UCP.
  • Snpp - Send pager messages via an SNPP provider through the internet/VPN.

Sample code

VBScript sample: Send a simple SMS message via SMPP

Option Explicit

' Declare objects
Dim objSmpp, objMessage, objSmsConstants

' Create objects
Set objSmpp                   = CreateObject ( "AxSms.Smpp" )
Set objMessage                = CreateObject ( "AxSms.Message" )
Set objSmsConstants           = CreateObject ( "AxSms.Constants" )

' Connect to smpp provider
objSmpp.Connect "smpp.activexperts-labs.com", 2775, 10000
WScript.Echo "Connect, result: " & objSmpp.LastError
If ( objSmpp.LastError <> 0 ) Then 
  WScript.Sleep 3000
  WScript.Quit
End If 

objSmpp.Bind objSmsConstants.SMPP_BIND_TRANSCEIVER, "myaccount", "topsecret", 
             "", objSmsConstants.SMPP_VERSION_34, 0, 0, "", 10000
WScript.Echo "Bind, result: " & objSmpp.LastError 
If ( objSmpp.LastError <> 0 ) Then
  objSmpp.Disconnect
  WScript.Quit
End If

' Message: set all properties
objMessage.Clear
objMessage.FromAddress        = "+31612134567"
objMessage.ToAddress          = "+31612345678"
objMessage.Body               = "Hello, world!"
objMessage.RequestDeliveryReport = False

' Submit the message to the SMSC
objSmpp.SubmitSms( objMessage )
Wscript.Echo "SubmitSms, result: " & objSmpp.LastError

' Wait for the SMSC response to acknowledge the message
objSmpp.WaitForSmsUpdate(1000)
Set objMessage = objsmpp.FetchSmsUpdate
Wscript.Echo "FetchSmsUpdate, result: " & objSmpp.LastError

' If this is '0' the message is accepted by the SMSC
Wscript.Echo "Command status: " & objMessage.SmppCommandStatus

objSmpp.Unbind
objSmpp.Disconnect

WScript.Echo "Disconnected."

VB .NET sample: Send a simple SMS message via SMPP

Imports Microsoft.Win32
Imports System.IO
Imports AxSms
Imports System.Threading

Module SmppProgram

Sub Main()
  Dim objSmpp As Smpp = New Smpp() ' Create instance of COM Object
  Dim objSmsMessage As SmsMessage = New SmsMessage() ' Create instance of COM Object
  Dim objSmsConstants As SmsConstants = New SmsConstants() ' Create instance of COM Object

  ' Connect to the SMPP server using host/IP-addess, a specific TCP port and a timeout
  objSmpp.Connect("smpp.activexperts-labs.com", 2775, 10000)
  Console.WriteLine(String.Format("Connect, result: {0})", objSmpp.LastError.ToString() ))
  If (objSmpp.LastError <> 0) Then
    GoTo _EndMain
  End If

  objSmpp.Bind( objSmsConstants.SMPP_BIND_TRANSCEIVER, "myaccount", "topsecret", 
                "", objSmsConstants.SMPP_VERSION_34, 0, 0, String.Empty, 10000 )
  Console.WriteLine(String.Format("Bind, result: {0})", objSmpp.LastError.ToString))
  If (objSmpp.LastError <> 0) Then
      GoTo _EndMain
  End If

  objSmsMessage.Clear()
  objSmsMessage.ToAddress = "+31612345678"
  objSmsMessage.Body = ReadInput("Type SMS text", False)
  objSmsMessage.RequestDeliveryReport = False

  objSmpp.SubmitSms(objSmsMessage, objSmsConstants.MULTIPART_OK)
  Console.WriteLine("SubmitSms, result: " & objSmpp.LastError.ToString)
  If (objSmpp.LastError <> 0) Then
    GoTo _EndMain
  End If

  ' Wait for the SMSC response to acknowledge the message
  objSmpp.WaitForSmsUpdate(1000)
  Set objMessage = objsmpp.FetchSmsUpdate
  Console.WriteLine("FetchSmsUpdate, result: " & objSmpp.LastError.ToString)

  ' If this is '0' the message is accepted by the SMSC
  Console.WriteLine("Command status, result: " & objMessage.SmppCommandStatus.ToString)
  
_EndMain:
  ' Unbind and Disconnect
  objSmpp.Unbind()
  objSmpp.Disconnect()

  Console.WriteLine("Disconnected.")
  Console.WriteLine("Ready.")
  Console.WriteLine("Press  to continue.")
  Console.ReadLine()
End Sub

End Module

More samples

Samples are available for: C# .NET, Visual Basic .NET, Visual C/C++, VBA, ASP, ASP .NET, Java, Javascript, PHP, HTML, ColdFusion, Delphi and more.

On ftp.activexperts-labs.com, you can find many SMS Component samples. Samples are also part of the SMS Component installation.