Skip to content
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

Support for various AstDB backends #35

Open
viktike opened this issue Apr 5, 2024 · 1 comment
Open

Support for various AstDB backends #35

viktike opened this issue Apr 5, 2024 · 1 comment

Comments

@viktike
Copy link

viktike commented Apr 5, 2024

Is your feature or improvement request related to a problem? Please describe.
I need to store Asterisk's internal database (SQLite3) in a remote database for high availability reasons, mostly for distributed device state (hints) and persistent queue members. I've read the wiki, that the previous can be done with corosync, but it's not an active-active or a hot-standy setup, but a failover one. Currently, we're running with a patch (replaced main/db.c), which is working (attached) just fine, but I'm unable to contribute it back, since it's done in compilation time, and replaces the original behavior, also it's not in a module.

Describe the solution you'd like
I would propose something like extconfig.conf and static realtime config engines (res_config_something.so).
Another idea is to make this two features (hints and persistent queue members) store their state using sorcery.

Describe alternatives you've considered
My alternative is just run with one of the patches. I'm currently using the odbc one. Previously we tried using various shared filesystems like gusterfs or drbd, but it seemed like overkill, and had several issues with conflicts. Also interested in any other ideas.

Additional context
I've attached the odbc and the mysql db.c files for this. Please note, since these aren't modules, it requires linking the asterisk binary to one of these libraries in the main/Makefile:

AST_LIBS+=$(UNIXODBC_LIB)
AST_LIBS+=$(MYSQLCLIENT_LIB)

db_odbc.c.patch
db_mysql.c.patch

@viktike
Copy link
Author

viktike commented Apr 5, 2024

The API could look like:

  • ast_db_put
  • ast_db_get
  • ast_db_gettree
  • ast_db_del
  • ast_db_deltree

While the CLI and AMI functions could still be in common in main/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant