def _message_received(self, p): """Handler for received message event""" dsmr = smpp.make_pdu( 'deliver_sm_resp') #, message_id=args['pdu'].sm_default_msg_id) dsmr.sequence = p.sequence self.send_pdu(dsmr) self.message_received_handler(pdu=p)
def unbind(self): """Unbind from the SMSC""" #smppinst = smpp.get_instance() p = smpp.make_pdu('unbind') res = self.send_pdu(p) return self.read_pdu()
def _bind(self, command_name, **args): """Send bind_transmitter command to the SMSC""" if command_name in ['bind_receiver', 'bind_transceiver']: self.receiver_mode = True #smppinst = smpp.get_instance() p = smpp.make_pdu(command_name, **(args)) res = self.send_pdu(p) return self.read_pdu()
def send_message_async(self, **args): """Send message Required Arguments: source_addr_ton -- Source address TON source_addr -- Source address (string) dest_addr_ton -- Destination address TON destination_addr -- Destination address (string) short_message -- Message text (string)""" ssm = smpp.make_pdu('submit_sm', **(args)) self.send_pdu(ssm)
def _enquire_link_received(self): ler = smpp.make_pdu('enquire_link_resp')#, message_id=args['pdu'].sm_default_msg_id) self.send_pdu(ler) logger.debug("Link Enuiry...")
def _message_received(self, p): """Handler for received message event""" dsmr = smpp.make_pdu('deliver_sm_resp')#, message_id=args['pdu'].sm_default_msg_id) dsmr.sequence = p.sequence self.send_pdu(dsmr) return self.message_received_handler(pdu=p)