-
-
Notifications
You must be signed in to change notification settings - Fork 140
-
logging.basicConfig(level='DEBUG') parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(u'test') client = smpplib.client.Client('*********', **** allow_unknown_opt_params=True) 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.short_message))) client.connect() client.bind_transceiver(system_id='****', password='****') dist=['1', '2','3','4','5'] for phone in dist: for part in parts: pdu = client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_NWSPEC, source_addr_npi=smpplib.consts.SMPP_NPI_UNK, source_addr='****', dest_addr_ton=smpplib.consts.SMPP_TON_INTL, dest_addr_npi=smpplib.consts.SMPP_NPI_ISDN, destination_addr=phone, short_message=part, data_coding=encoding_flag, esm_class=msg_type_flag, registered_delivery=1, ) print(pdu.sequence) client.listen()
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
primeKal
Jul 2, 2021
You are passed with PDU object when setting the message received method so u can do what ever you want with the values . example source_address = pdu.source_addr .... pretty simple actually
Replies: 1 comment
-
You are passed with PDU object when setting the message received method so u can do what ever you want with the values . example source_address = pdu.source_addr .... pretty simple actually
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
0 replies
Answer selected by
eigenein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment