Skip to content

TAG: its_session_info, struct.error: required argument is not an integer #112

@drhidians

Description

@drhidians

Hi, I am using python3.6
Using this chunk of code

parts, encoding_flag, msg_type_flag = smpplib.gsm.make_parts(u'Привет мир!\n'*1)
r_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='******',
        service_type ="USSD",
        ussd_service_op = 0x11,

        its_session_info =b'\x00\x01',
        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:
        #Test Code
        destination_addr='******',
        short_message=parts[0],

        data_coding=encoding_flag,
        esm_class=msg_type_flag,
        registered_delivery=True,
    )

Getting this:

Traceback (most recent call last):
  File "main.py", line 77, in <module>
    client.listen()
  File "/home/pythonsmpp/smpplib/client.py", line 343, in listen
    self.read_once(ignore_error_codes, auto_send_enquire_link)
  File "/home/pythonsmpp/smpplib/client.py", line 315, in read_once
    self._message_received(pdu)
  File "/home/pythonsmpp/smpplib/client.py", line 244, in _message_received
    status = self.message_received_handler(pdu=pdu)
  File "main.py", line 31, in deliver_sm
    registered_delivery=True,
  File "/home/pythonsmpp/smpplib/client.py", line 357, in send_message
    self.send_pdu(ssm)
  File "/home/pythonsmpp/smpplib/client.py", line 181, in send_pdu
    generated = p.generate()
  File "/home/pythonsmpp/smpplib/pdu.py", line 136, in generate
    body = self.generate_params()
  File "/home/pythonsmpp/smpplib/command.py", line 126, in generate_params
    value = self._generate_int_tlv(field)
  File "/home/pythonsmpp/smpplib/command.py", line 202, in _generate_int_tlv
    value = struct.pack(">HH" + fmt, field_code, field_length, data)
struct.error: required argument is not an integer
WARNING:smpp.Client.139658711658224:<smpplib.client.Client object at 0x7f04d3e5eef0> was not closed

Could you help me?

Thanks in advance..

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions