How to Use Inetlab.SMPP 1.2.12.0 for Two-Way SMS Messaging
How to Use Inetlab.SMPP 1.2.12.0 for Two-Way SMS Messaging
Inetlab.SMPP 1.2.12.0 is a library that implements the SMPP protocol for two-way SMS messaging over TCP/IP. It allows you to communicate with the SMSC (Short Message Service Center) or SMS provider of your choice and send and receive SMS messages to and from your customers.
Inetlab.SMPP 1.2.12.0
In this article, we will show you how to use Inetlab.SMPP 1.2.12.0 to create a simple SMS application that can send messages, receive messages, and process delivery receipts.
Prerequisites
To use Inetlab.SMPP 1.2.12.0, you need the following:
A .NET Framework 4.5 or higher
An SMPP account from an SMSC or SMS provider that supports SMPP 3.4 or higher
The Inetlab.SMPP library, which you can download from here
Setting Up the SMPP Client
The first step is to create an instance of the SmppClient class, which represents the SMPP client that will connect to the SMSC or SMS provider.
using Inetlab.SMPP;
using Inetlab.SMPP.Common;
using Inetlab.SMPP.PDU;
//Create a new instance of SmppClient
SmppClient client = new SmppClient();
Next, you need to configure the connection parameters, such as the host name, port number, system ID, password, and bind type of the SMSC or SMS provider.
//Set the connection parameters
string host = "smpp.example.com"; //The host name of the SMSC or SMS provider
int port = 2775; //The port number of the SMSC or SMS provider
string systemId = "user"; //The system ID of your SMPP account
string password = "pass"; //The password of your SMPP account
BindType bindType = BindType.Transceiver; //The bind type (transmitter, receiver, or transceiver)
Finally, you need to register some event handlers that will handle the events raised by the SmppClient class, such as Connected, Disconnected, BindResp, SubmitSmResp, DeliverSm, and EnquireLinkResp.
//Register event handlers
client.Connected += OnConnected;
client.Disconnected += OnDisconnected;
client.BindResp += OnBindResp;
client.SubmitSmResp += OnSubmitSmResp;
client.DeliverSm += OnDeliverSm;
client.EnquireLinkResp += OnEnquireLinkResp;
Connecting to the SMSC or SMS Provider
To connect to the SMSC or SMS provider, you need to call the ConnectAsync method of the SmppClient class and pass the host name and port number as parameters.
//Connect to the SMSC or SMS provider
await client.ConnectAsync(host, port);
If the connection is successful, the Connected event will be raised and you can proceed to bind to the SMSC or SMS provider using the BindAsync method and passing the system ID, password, and bind type as parameters.
//Handle the Connected event
private void OnConnected(object sender, EventArgs e)
//Bind to the SMSC or SMS provider
await client.BindAsync(systemId, password, bindType);
If the binding is successful, the BindResp event will be raised and you can start sending and receiving SMS messages.
//Handle the BindResp event
private 0efd9a6b88
https://www.kolsephardicchoir.com/group/choir-member/discussion/db0ac8bf-1e8f-40fb-8e60-61c38aff443d
- +