-
Notifications
You must be signed in to change notification settings - Fork 83
Implementing callbook failover logic #2665
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
Conversation
|
Before we are going to check this PR: Really well done Pull Request! Simple, Short, Single Feature, Necessary Changes only Really Really good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic functionality works for me. But hamqth lib returns error being empty so the check for success will always fail for hamtqth. Added two suggestions to change this behavior.
Co-authored-by: Florian (DF2ET) <github@florian-wolters.de>
|
@phl0 I implemented your suggestions |
Seen that. Will re-check. |
phl0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me. We should put an example and some description into config.sample.php (if not in this PR I can add it separately).
|
@phl0 ok, I will update the wiki later tonight |
|
Tested working here :) |
|
I started documenting the config file, with some notes on this feature: Config.php |
And I added some description to config.sample.php 😇 |
This MR implements a very simple callbook failover logic.
Summary
$config['callbook']is set to a single string (default), nothing is changed in the logic, a single query is performed and result is evaluated accordingly$config['callbook']is set to an array, then the different providers are sequentially tested to see if a valid response is returnedTesting
I tested the following scenarios:
Back compatibility
I let the default
config.phpconfig (or with any single providers set):And the following sequence was returned (single callbook -> single request). The single provider was tested, nothing different from existing behavior.
New behavior
I set the
config.phpconfig to an array of providers, and the following sequence was returned (providers are tested in the same sequence as defined in the config):