How to use the smspdu.SMS_DELIVER.fromPDU function in smspdu

To help you get started, we’ve selected a few smspdu 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 facebookarchive / CommunityCellularManager / client / core / fake_phone / _openbts.py View on Github external
def handle_request(self, message, addr):
        to = message.uri.username
        fromm = sip.parseAddress(message.headers['from'][0])[1].username
        if message.method == 'MESSAGE':
            rpdu = sms_utilities.rpdu.RPDU.fromPDU(message.body)
            sms_deliver = SMS_DELIVER.fromPDU(rpdu.user_data,
                                              rpdu.rp_originator_address)
            self.sms_h(to, fromm, sms_deliver.user_data)
            r = self.responseFromRequest(200, message)
        elif message.method == 'ACK':
            r = self.responseFromRequest(200, message)
        elif message.method == 'INVITE':
            self.call_h(to, fromm)
            # We don't know how to actually handle calls.
            r = self.responseFromRequest(487, message)
        else:
            raise Exception("Received unhandled request")
        self.deliverResponse(r)

smspdu

SMS PDU encoding and decoding, including GSM-0338 character set

BSD-2-Clause
Latest version published 13 years ago

Package Health Score

42 / 100
Full package analysis