Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The support for SubmitMulti is not complete #8

Closed
armonge opened this issue Sep 7, 2011 · 2 comments
Closed

The support for SubmitMulti is not complete #8

armonge opened this issue Sep 7, 2011 · 2 comments

Comments

@armonge
Copy link
Contributor

armonge commented Sep 7, 2011

When trying to encode a SubmitMulti PDU there's a KeyError, also there seems to be no way to define the dest_address param

import binascii
from smpp.pdu.pdu_types import *
from smpp.pdu.operations import *
from smpp.pdu.pdu_encoding import PDUEncoder

pdu = SubmitMulti(
    service_type=None,
    esm_class=EsmClass(EsmClassMode.DEFAULT, EsmClassType.DEFAULT),
    protocol_id=0,
    priority_flag=PriorityFlag.LEVEL_0,
    schedule_delivery_time=None,
    validity_period=None,
    registered_delivery=RegisteredDelivery(RegisteredDeliveryReceipt.NO_SMSC_DELIVERY_RECEIPT_REQUESTED),
    replace_if_present_flag=ReplaceIfPresentFlag.DO_NOT_REPLACE,
    data_coding=DataCoding(DataCodingScheme.GSM_MESSAGE_CLASS, DataCodingGsmMsg(DataCodingGsmMsgCoding.DEFAULT_ALPHABET, DataCodingGsmMsgClass.CLASS_2)),
    sm_default_msg_id=None,
    source_addr_ton=AddrTon.ALPHANUMERIC,
    source_addr_npi=AddrNpi.UNKNOWN,
    source_addr='mobileway',
    dest_addr_ton=AddrTon.INTERNATIONAL,
    dest_addr_npi=AddrNpi.ISDN,
    number_of_dests=1,
    short_message = 'Hello World!',
)

binary = PDUEncoder().encode(pdu)

This has the following traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "smpp/pdu/pdu_encoding.py", line 865, in encode
    body = self.encodeBody(pdu)
  File "smpp/pdu/pdu_encoding.py", line 906, in encodeBody
    body += self.encodeRequiredParams(pdu.mandatoryParams, self.getRequiredParamEncoders(pdu), pdu.params)
  File "smpp/pdu/pdu_encoding.py", line 943, in encodeRequiredParams
    return string.join([encoderMap[paramName].encode(params[paramName]) for paramName in paramList], '')
KeyError: 'number_of_dests'
@theduderog
Copy link
Contributor

The application that I wrote this library for did not need the SubmitMulti command and I didn't have time to fully implement it. If you're willing to do it, I think it wouldn't be too much work.

@theduderog
Copy link
Contributor

Closing this. No plans for implement this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants