Code examples
Example clients for connecting, sending SMS, receiving callbacks, and keeping the session alive.
Setup and dependencies
pip install smpplib<dependency>
<groupId>com.cloudhopper</groupId>
<artifactId>ch-smpp</artifactId>
<version>5.0.8</version>
</dependency>dotnet add package ArdaXi.SmppSharpConnect and send SMS
import smpplib
import smpplib.client
import smpplib.consts
client = smpplib.client.Client("smpp.ecall.ch", 2776, allow_unknown_opt_params=True)
client.connect()
client.bind_transceiver(system_id="your_username", password="your_password")
pdu = client.send_message(
source_addr_ton=smpplib.consts.SMPP_TON_INTL,
source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
source_addr="eCall",
dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
destination_addr="0041791234567",
short_message="Hello from eCall SMPP!".encode("utf-8"),
registered_delivery=1,
)
print(f"Message ID: {pdu.message_id}")
client.unbind()
client.disconnect()Receive delivery receipts
Keep-alive
Last updated
Was this helpful?
