-
-
Notifications
You must be signed in to change notification settings - Fork 143
Closed
Description
#!/usr/bin/env python3
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import smpplib.gsm
import smpplib.client
import smpplib.consts
def send_message(source, dest):
client = smpplib.client.Client('[127.0.0.1](https://127.0.0.1/)', 2775)
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='OSMO-SMPP', password='1234')
string = '\x02\x70\x00\x00\x0e\x0d\x00\x21\x00\x00\xb2\x00\x00\xaa\xbb\xcc\xdd\xee\x00'
coding = 0xf6
pdu = client.send_message(
msg_type=smpplib.consts.SMPP_MSGTYPE_USERACK,
source_addr_ton=smpplib.consts.SMPP_TON_INTL,
source_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
source_addr=source,
dest_addr_ton=smpplib.consts.SMPP_TON_INTL,
dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN,
destination_addr=dest,
short_message=string,
data_coding= sms_cod,
protocol_id = 0x41,
esm_class=smpplib.consts.SMPP_GSMFEAT_UDHI,
registered_delivery=False,
)
if name == "main":
source = sys.argv[1]
dest = sys.argv[2]
send_message(source, dest)
Hi , maybe someone has a working copy of this code ?
i need to send
010007919 32350591211 0026 44 0c919 32390026xxxx 7ff6117042711404e113 0270 00000e0d 0021 0000b20000aabbccddee00
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels