Send to Signal with SMPP using Python

Sending messages to Signal users with the SMPP API using the Python programming language

The python-smpplib library can be used to make SMPP requests using Python. This library can be used to submit messages to the Melrose Labs Signal API.

SMPP requirements and resources

SMPP is the Short Message Peer-to-Peer protocol and is used by applications for sending and receiving messages. An SMPP client can be used to connect to a messaging gateway using the SMPP protocol. The following are required to send a message via Signal with SMPP:

Signal API account
Account credentials for the Melrose Labs Signal API

SMPP Protocol [reference] (optional)
Short Message Peer-to-Peer Protocol v3.3, v3.4 and v5 specifications and guides

SMPP Client [tool] (optional)
Browser-based SMPP client supporting SMPP v3.x and v5 via Web Sockets

Python requirements and resources

Python is a programming language and can be used to quickly and easily add Signal support for programmatically sending messages. Use it for transactional messaging and notifications between your application and mobiles. The following are required to send a message via Signal using Python:

Python programming language

Requirements and resources

The following are required to send a message via Signal with SMPP using Python:

Python SMPPlib: SMPP library for Python.


$ git clone
$ cd python-smpplib
$ virtualenv --no-site-packages ve/
$ source ve/bin/activate
(ve)$ pip install six


Create the file containing the code below. Replace SYSTEMID and PASSWORD values with those from your Signal API account.

The following example Python code opens an SMPP transceiver bind to on port 2775 (SMPP port), and then sends the message Hello World #$£ to mobile number 447712345678. The SMPP system ID and password for the SMPP account are contained in SYSTEMID and PASSWORD respectively.

import logging
import sys

import smpplib.gsm
import smpplib.client
import smpplib.consts

# if you want to know what's happening

# Two parts, GSM default / UCS2, SMS with UDH
parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(u'Hello World €$£')

client = smpplib.client.Client('', 2775)

# Print when obtain message_id
    lambda pdu: sys.stdout.write('sent {} {}\n'.format(pdu.sequence, pdu.message_id)))

# Handle delivery receipts (and any MO SMS)
def handle_deliver_sm(pdu):
        sys.stdout.write('delivered {}\n'.format(pdu.receipted_message_id))
        return 0 # cmd status for deliver_sm_resp

client.set_message_received_handler(lambda pdu: handle_deliver_sm(pdu))

client.bind_transceiver(system_id='SYSTEMID', password='PASSWORD')

for part in parts:
    pdu = client.send_message(
        # Make sure it is a byte string, not unicode:

        # Make sure these two params are byte strings, not unicode:


# Enters a loop, waiting for incoming PDUs

The above shows a connection being made to on port 2775 and an SMPP transceiver bind (client.bind_transceiver()) being established. Once this has been done, a message is submitted to the Melrose Labs Signal API messaging gateway using client.send_message() (submit_sm PDU), and a response (submit_sm_resp PDU) is received from the gateway with the message ID for the submitted message. Shortly afterwards, the message is delivered and a delivery receipt contained in a deliver_sm PDU is received, to which our code responds with an acknowledgement (deliver_sm_resp PDU).