http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14723
--- Comment #3 from Lari Taskula <[email protected]> --- Created attachment 42074 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42074&action=edit Bug 14723: (follow-up) Example of handling custom SMS::Send Driver reports This patch presents an example of how SMS::Send driver can be configured to receive reports from your SMS Gateway provider if they support such feature. With Bug 14723 adding a delivery note column to message_queue, you are now able to update the error status provided by your SMS gateway provider to the message. It uses REST API, so make sure to include dependencies. Koha conf gets a new block "smsProviders", where you are able to define your SMS Gateway login data and the report URL that our provider will use. Koha httpd conf gets an example for blocking all traffic to the REST API address for modifying the message status, apart from our provider IPs. Here is a description of the protocol and common actions with the example driver. 1. message_queue gets processed as usual. 2. Letters.pm calls our example driver with phone number, content and message_id (new!). 3. Our example driver sends a POST request to the SMS Gateway provider as follows: - user: username, loaded from koha conf smsProviders->labyrintti - password: password, loaded from koha conf smsProviders->labyrintti - dests: destination phone number - text: content of the message - report: the URL that SMS Gateway provider will update the status of this delivery, loaded from koha conf (with REST API, it should be http://yourhost.com/v1/messages) smsProviders->labyrintti 4. We get (hopefully) an OK message from our SMS provider. It will already let us know if there was an error with the phone number. If so, we return it to Letters.pm via HASH: { status => 1/0, delivery_note => the message of error/success } 5. When the delivery is complete, our SMS Gateway will contact us via the report URL we provided. 6. Via Swagger definitions, we will use Koha::REST::V1::Messages delivery_report to handle the report. If the given status is "ERROR" (this is our example provider's protocol), we will update the message status (and add delivery note) in message_queue for the given message_id. 7. All done, we have now handled the report given by our SMS Gateway provider :) -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
