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

How to add optional parameters in a PDU #17

Closed
skytreader opened this issue Oct 9, 2014 · 2 comments
Closed

How to add optional parameters in a PDU #17

skytreader opened this issue Oct 9, 2014 · 2 comments

Comments

@skytreader
Copy link

Are optional parameters currently supported? I've been looking at the PDU class and it seems that the optionalParams field is initialized but not used for anything else. Maybe I'm looking at the wrong place?

(I'm willing to contribute if this is not yet supported but just making sure I don't reinvent anything. :) )

@theduderog
Copy link
Contributor

Yes, optional parameters are supported. For SubmitSM, for example, you can see the list here:

https://github.com/mozes/smpp.pdu/blob/master/smpp/pdu/operations.py#L120-L148

To create a PDU with an optional parameter, you can pass the optional param as a keyword argument in the same way that you pass mandatory parameters.

pdu = SubmitSM(9284,
    service_type='',
    source_addr_ton=AddrTon.ALPHANUMERIC,
    source_addr_npi=AddrNpi.UNKNOWN,
   ...
  user_message_reference=9999 #this is an optional parameter
)

@skytreader
Copy link
Author

Great. Thanks for that pointer!

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