How to use the smpplib.client function in smpplib

To help you get started, we’ve selected a few smpplib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ernw / insinuator-snippets / gsm_troopers / smpp_example_listener.py View on Github external
for part in parts:
        pdu = client.send_message(
            source_addr_ton=smpplib.consts.SMPP_TON_INTL,
            source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
            source_addr=src,
            dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
            dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
            destination_addr=dest,
            short_message=part,
            data_coding=encoding_flag,
            esm_class=msg_type_flag,
            registered_delivery=False,
    )


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

# Print Output and Start Handler
client.set_message_sent_handler(
    lambda pdu: logging.info('sent {} {}\n'.format(pdu.sequence, pdu.message_id)))
client.set_message_received_handler(handle_incoming_sms)

client.connect()

client.bind_transceiver(system_id='YourESME', password='123456')
print "MYSERVICE: Successfully bound SMPP"



while True:
    try:
        client.listen()

smpplib

SMPP library for python

LGPL-3.0
Latest version published 12 months ago

Package Health Score

65 / 100
Full package analysis