python-smpplib icon indicating copy to clipboard operation
python-smpplib copied to clipboard

Support for query_sm pdu

Open jithintomz opened this issue 9 years ago • 9 comments

jithintomz avatar Jun 28 '16 05:06 jithintomz

I would like to know how can I use the "query_sm" command? It seems it is not implemented. Is this the best method to know if an SMS arrived at the MT (mobile terminated) ?

grmagalhaes avatar Jul 21 '19 03:07 grmagalhaes

For now you'd need to implement it, otherwise indeed it doesn't work out of the box.

If feasible, you can still use status notifications from SMSc, in another issue you can find relevant pieces of code: https://github.com/python-smpplib/python-smpplib/issues/26

eigenein avatar Jul 21 '19 21:07 eigenein

Thanks for reply. I will try use notifications.

Gerson

Em dom, 21 de jul de 2019 18:25, Pavel Perestoronin < [email protected]> escreveu:

For now you'd need to implement it, otherwise indeed it doesn't work out of the box.

If feasible, you can still use status notifications from SMSc, in another issue you can find relevant pieces of code: #26 https://github.com/python-smpplib/python-smpplib/issues/26

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/python-smpplib/python-smpplib/issues/21?email_source=notifications&email_token=AHMVVGJDY7DGOKFN725SGULQATH3HA5CNFSM4CH67HM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2OL4OI#issuecomment-513588793, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMVVGNHCN3ANEKIXKEOYFTQATH3HANCNFSM4CH67HMQ .

grmagalhaes avatar Jul 22 '19 00:07 grmagalhaes

I used notification and it works, thanks. But..."pdu.receipted_message_id" was returning None so I found the "pdu.shortmessage" as a solution. See the value of pdu.shortmessage: b'id:0620903492 sub:001 dlvrd:001 submit date:1907231741 done date:1907231741 stat:DELIVRD err:000 text:Seu codigo de confirmacao para acessar'

Another hint: In our SMSC the message_id returns in hex when the "set_message_sent_handler" is called and in decimal when the "set_message_received_handler" is called. You must convert it to link the messages (in my case).

grmagalhaes avatar Jul 23 '19 23:07 grmagalhaes

@grmagalhaes Please feel free to test #89 and tell us if that feels your needs.

Lynesth avatar Jul 31 '19 11:07 Lynesth

I've created a new version with query_sm/query_sm_resp but my SMSc returns all values as null ( b'' ) or zero. Maybe my message_id can be wrong. I already try with hex and decimal. Is it possible to be problems with configuration of the SMSc?

grmagalhaes avatar Aug 01 '19 16:08 grmagalhaes

@grmagalhaes Thank you for your response. Here are a few ideas:

  • You have to fill in the same information as when you sent the message for each parameter of the query_sm command as this is used by the SMSC for verification. So make sure your arguments are correct.
  • Try with sending a SMS to your own phone while it is powered off (or offline) so that you don't receive the message and its state stays ENROUTE. Then try querying that message. Some SMSC don't save information on messages once they reach their final state (which is stupid, I known).
  • Some SMSC simply don't implement query_sm, and could simply respond an empty query_sm_resp. Check with yours.

Lynesth avatar Aug 01 '19 22:08 Lynesth

Thanks. I will try these options.

grmagalhaes avatar Aug 05 '19 13:08 grmagalhaes