You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the library to create a sms sending app with billing and routing.
The main idea is to open one client instance per SMPP provider fetched from MySQL DB and run it in separate thread.
An Flask route is waiting for HTTP/HTTPS requests and does send SMS on request while the thread with client.listen() is running in background. I pass over the client object to sending function.
I figure out that the client instance reference is available in the handlers for submit_sm_resp and delivery_sm_resp in "pdu._client" and i was able to pass some additional data inside my class which inherits from client.
The main issue is that pdu._client (object reference) from delivery_sm is different object than in submit_sm_resp (object reference) and i don't know how to exchange the data between client sending the message and the one from delivery report.
Currently i save the pdu.sequence and msg_id in mysql DB. However i would like to wait with HTTP response to client sending SMS message unil get delivery report to send proper response about sending status.
Maybe my idea of handling this problem is incorrect or i miss something on how to handle this using the library.
Please let me know if keeping the client connection open with SMPP server is good practice.
Also how to get the delivery_response correlated to submit_sm_response (i see sequence is different because the pdu._client instances are different and the smpp unique message id is same however i don't want use DB pooling for synchronization when waiting for delivery report).
The main issue is that pdu._client (object reference) from delivery_sm is different object than in submit_sm_resp
I'm not quite sure I understand how so, Client does not spawn any other clients on its own. Just to double-check, are you by chance instantiating multiple Clients?
Please let me know if keeping the client connection open with SMPP server is good practice
That should be just fine
I figure out that the client instance reference is available in the handlers for submit_sm_resp and delivery_sm_resp in pdu._client and i was able to pass some additional data inside my class which inherits from client.
You don't need pdu._client, by the way. If you're overriding message_sent_handler & message_received_handler, the client is available simply in self
Ok i think I do something wrong. I try to come for solution if I don't get it I will paste very basic code as example and describe my problem. Thanks for reaching me out. So I should not get new instance of client within delivery report. It looks like somehow my client instance and thread are getting recreated. I will have to review full code.
This discussion was converted from issue #250 on April 23, 2024 10:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am trying to use the library to create a sms sending app with billing and routing.
The main idea is to open one client instance per SMPP provider fetched from MySQL DB and run it in separate thread.
An Flask route is waiting for HTTP/HTTPS requests and does send SMS on request while the thread with client.listen() is running in background. I pass over the client object to sending function.
I figure out that the client instance reference is available in the handlers for submit_sm_resp and delivery_sm_resp in "pdu._client" and i was able to pass some additional data inside my class which inherits from client.
The main issue is that pdu._client (object reference) from delivery_sm is different object than in submit_sm_resp (object reference) and i don't know how to exchange the data between client sending the message and the one from delivery report.
Currently i save the pdu.sequence and msg_id in mysql DB. However i would like to wait with HTTP response to client sending SMS message unil get delivery report to send proper response about sending status.
Maybe my idea of handling this problem is incorrect or i miss something on how to handle this using the library.
Please let me know if keeping the client connection open with SMPP server is good practice.
Also how to get the delivery_response correlated to submit_sm_response (i see sequence is different because the pdu._client instances are different and the smpp unique message id is same however i don't want use DB pooling for synchronization when waiting for delivery report).
All reactions