If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register.
I would say this is somewhat deliberate. If money is changing hands, as it would be in a SIP transaction, we want to record it against a register.
The line in question is here: https://git.koha-community.org/Koha-community/Koha/src/branch/master/Koha/Account.pm#L354 We could perhaps drive it with yasp (yet another system preference)
(In reply to Martin Renvoize from comment #1) > I would say this is somewhat deliberate. If money is changing hands, as it > would be in a SIP transaction, we want to record it against a register. Yeah, I'm in agreement with that. It's the part where they SIP server crashes instead of sending a "fee payment failed" response that I think is wrong ;) We should be catching the exception in the SIP code and sending a response back.
OH.. good call.. why did my brain not go there...
Created attachment 148157 [details] [review] Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register.
Created attachment 148161 [details] [review] Bug 33216: Catch and handle all Koha exceptions
Hi Kyle, should this be Needs Signoff?
Created attachment 149755 [details] [review] Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register. Test Plan: 1) Enable UseCashRegisters, set RequireCashRegister to "always require a cash register". Do *not* set a cash register for the SIP account you will be testing with. 2) Using the SIP cli tester, send a fee paid message for a patron owing fees. 3) Note the lack of a SIP response 4) Apply this patch 5) Restart the SIP server 6) Repeat step 2, you should now get a SIP response with the error message in it!
(In reply to Katrin Fischer from comment #7) > Hi Kyle, should this be Needs Signoff? Was missing a test plan. Fixed!
Created attachment 149757 [details] [review] Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register. Test Plan: 1) Enable UseCashRegisters, set RequireCashRegister to "always require a cash register". Do *not* set a cash register for the SIP account you will be testing with. 2) Using the SIP cli tester, send a fee paid message for a patron owing fees. 3) Note the lack of a SIP response 4) Apply this patch 5) Restart the SIP server 6) Repeat step 2, you should now get a SIP response with the error message in it! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Working well, thanks Kyle.
I've decided to just go straight for QA here.. lets pass it.
Created attachment 149795 [details] [review] Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register. Test Plan: 1) Enable UseCashRegisters, set RequireCashRegister to "always require a cash register". Do *not* set a cash register for the SIP account you will be testing with. 2) Using the SIP cli tester, send a fee paid message for a patron owing fees. 3) Note the lack of a SIP response 4) Apply this patch 5) Restart the SIP server 6) Repeat step 2, you should now get a SIP response with the error message in it! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 149796 [details] [review] Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages If registers are being used in Koha, they are required. If a SIP account has no register and a fee paid message is sent, the SIP server crashes and the client never gets a response. It would be much better if Koha would response with 38 response where "payment accepted" is N, and an AF field stating that the SIP account needs to be associated with a register. Test Plan: 1) Enable UseCashRegisters, set RequireCashRegister to "always require a cash register". Do *not* set a cash register for the SIP account you will be testing with. 2) Using the SIP cli tester, send a fee paid message for a patron owing fees. 3) Note the lack of a SIP response 4) Apply this patch 5) Restart the SIP server 6) Repeat step 2, you should now get a SIP response with the error message in it! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Backported to 22.05.x for upcoming 22.05.13
applied to 21.11 for 21.11.21