All Projects → python-smpplib → Python Smpplib

python-smpplib / Python Smpplib

Licence: lgpl-3.0
SMPP library for Python

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects
python2
120 projects

Labels

Projects that are alternatives of or similar to Python Smpplib

Vonage Java Sdk
Vonage Server SDK for Java. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Stars: ✭ 75 (-33.04%)
Mutual labels:  sms
Jamspymer
SMS, Call, Mail, Telegram бомбер с открытым исходным кодом
Stars: ✭ 95 (-15.18%)
Mutual labels:  sms
React Native Sms Verifycode
A React Native component for filling in SMS verification codes or passwords, for android and iOS
Stars: ✭ 107 (-4.46%)
Mutual labels:  sms
Bomberthon
Best Bombing Tool with WhatsApp, Instagram, SMS bomber
Stars: ✭ 84 (-25%)
Mutual labels:  sms
Faxserver
Send and Receive Faxes Using The Twilio Programmable Fax API.
Stars: ✭ 92 (-17.86%)
Mutual labels:  sms
30 Days Of Python 3.6
This is a soon-to-be archived project version of 30 Days of Python. The original tutorial still works but we have an updated version in the works right now.
Stars: ✭ 98 (-12.5%)
Mutual labels:  sms
Twofactor gateway
🔑 Second factor provider using an external messaging gateway (SMS, Telegram, Signal)
Stars: ✭ 76 (-32.14%)
Mutual labels:  sms
Pygsm
Send and receive SMS via a GSM modem in Python
Stars: ✭ 110 (-1.79%)
Mutual labels:  sms
Smart sms
The easiest way to integrate SMS service in China
Stars: ✭ 92 (-17.86%)
Mutual labels:  sms
Django Notifs
Modular Notifications (InApp, Email, SMS, CustomBackend etc) for Django
Stars: ✭ 105 (-6.25%)
Mutual labels:  sms
Tbomb
This is a SMS And Call Bomber For Linux And Termux
Stars: ✭ 1,287 (+1049.11%)
Mutual labels:  sms
Sms Bomber
A very, very simple sms bomber written in python and now java. You can adjust the amount of texts sent, and the interval at which they are sent (if you want any). For educational purposes only.
Stars: ✭ 91 (-18.75%)
Mutual labels:  sms
Pulse Sms Web
The official web app for Pulse SMS - built on Vue.js.
Stars: ✭ 101 (-9.82%)
Mutual labels:  sms
Ni bomber
💥 advanced sms bomber in python to kill the phone
Stars: ✭ 77 (-31.25%)
Mutual labels:  sms
Pulse Sms Ios
The official iOS app for Pulse SMS.
Stars: ✭ 108 (-3.57%)
Mutual labels:  sms
Vonage Dotnet Sdk
Nexmo REST API client for .NET, ASP.NET, ASP.NET MVC written in C#. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Stars: ✭ 76 (-32.14%)
Mutual labels:  sms
Spamsms
SPAM SMS (-UPDATE 2020!-)
Stars: ✭ 94 (-16.07%)
Mutual labels:  sms
Cat Facts
Daily cat facts! 🐱
Stars: ✭ 110 (-1.79%)
Mutual labels:  sms
Raspisms
RaspiSMS est un système de gestion et d'envoi de SMS par ordinateur, initialement conçu pour les Raspberry Pi
Stars: ✭ 107 (-4.46%)
Mutual labels:  sms
Hpomb
HPomb closed-source project for SMS , Call & Mail bombing available for Window , Linux , MacOS And Android( Termux )
Stars: ✭ 102 (-8.93%)
Mutual labels:  sms

python-smpplib

Version Python versions PyPI downloads License CircleCI

SMPP library for Python. Forked from Google Code.

Example:

import logging
import sys

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

# if you want to know what's happening
logging.basicConfig(level='DEBUG')

# Two parts, UCS2, SMS with UDH
parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(u'Привет мир!\n'*10)

client = smpplib.client.Client('example.com', SOMEPORTNUMBER, allow_unknown_opt_params=True)

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

client.connect()
client.bind_transceiver(system_id='login', password='secret')

for part in parts:
    pdu = client.send_message(
        source_addr_ton=smpplib.consts.SMPP_TON_INTL,
        #source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
        # Make sure it is a byte string, not unicode:
        source_addr='SENDERPHONENUM',

        dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
        #dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
        # Make sure thease two params are byte strings, not unicode:
        destination_addr='PHONENUMBER',
        short_message=part,

        data_coding=encoding_flag,
        esm_class=msg_type_flag,
        registered_delivery=True,
    )
    print(pdu.sequence)
    
# Enters a loop, waiting for incoming PDUs
client.listen()

You also may want to listen in a thread:

from threading import Thread
t = Thread(target=client.listen)
t.start()

Note: When listening, the client will automatically send an enquire_link command when the socket timeouts. You may override that behavior by passing auto_send_enquire_link=False as an argument to listen(). In that case, socket.timeout exceptions will bubble up.

The client supports setting a custom generator that produces sequence numbers for the PDU packages. Per default a simple in memory generator is used which in conclusion is reset on (re)instantiation of the client, e.g. by an application restart. If you want to keep the sequence number to be persisted across restarts you can implement your own storage backed generator.

Example:

import smpplib.client

import mymodule

generator = mymodule.PersistentSequenceGenerator()
client = smpplib.client.Client('example.com', SOMEPORTNUMBER, sequence_generator=generator)
...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].