Normally, when one party in a call sends Asterisk an SDP with a "sendonly" or "inactive" attribute it means "hold" and causes Asterisk to start playing MOH back to the other party. This can be problematic if it happens at certain times, such as in a 183 Progress message, because the MOH will replace any early media you may be playing to the calling party. If you set this option to "yes" on an endpoint and the endpoint receives an SDP with "sendonly" or "inactive", Asterisk will NOT play MOH back to the other party. Resolves: #979 UserNote: The new "suppress_moh_on_sendonly" endpoint option can be used to prevent playing MOH back to a caller if the remote end sends "sendonly" or "inactive" (hold) to Asterisk in an SDP. |
6 months ago | |
---|---|---|
.. | ||
cdr | Remove as much trailing whitespace as possible. | 7 years ago |
config | res_pjsip: Add new endpoint option "suppress_moh_on_sendonly" | 6 months ago |
queue_log | ast-db-manage: Synchronize revisions between comments and code. | 2 years ago |
voicemail | alembic: Drop redundant voicemail_messages index. | 7 months ago |
.gitignore | alembic: Update list of TLS methods available on ps_transports. | 1 year ago |
README.md | contrib: Spelling fixes | 4 years ago |
cdr.ini.sample | alembic: Adjust sippeers, queue_members, and voicemail_messages tables. | 11 years ago |
config.ini.sample | alembic: Adjust sippeers, queue_members, and voicemail_messages tables. | 11 years ago |
env.py | alembic: Fix compatibility with SQLAlchemy 2.0+. | 1 year ago |
queue_log.ini.sample | queue_log: Add alembic script for generate db table for queue_log | 6 years ago |
voicemail.ini.sample | alembic: Adjust sippeers, queue_members, and voicemail_messages tables. | 11 years ago |
README.md
Asterisk Database Manager
Asterisk includes optional database integration for a variety of features. The purpose of this effort is to assist in managing the database schema for Asterisk database integration.
This is implemented as a set of repositories that contain database schema migrations, using Alembic. The existing repositories include:
cdr
- Table used for Asterisk to store CDR recordsconfig
- Tables used for Asterisk realtime configurationqueue_log
- Table used for Asterisk to store Queue Log recordsvoicemail
- Tables used forODBC_STORAGE
of voicemail messages
Alembic uses SQLAlchemy, which has support for many databases.
IMPORTANT NOTE: This is brand new and the initial migrations are still subject to change. Only use this for testing purposes for now.
Example Usage
First, create an ini file that contains database connection details. For help with connection string details, see the SQLAlchemy docs.
$ cp config.ini.sample config.ini
... edit config.ini and change sqlalchemy.url ...
Next, bring the database up to date with the current schema.
$ alembic -c config.ini upgrade head
In the future, as additional database migrations are added, you can run alembic again to migrate the existing tables to the latest schema.
$ alembic -c config.ini upgrade head
The migrations support both upgrading and downgrading. You could go all the way back to where you started with no tables by downgrading back to the base revision.
$ alembic -c config.ini downgrade base
base
and head
are special revisions. You can refer to specific revisions
to upgrade or downgrade to, as well.
$ alembic -c config.ini upgrade 4da0c5f79a9c
Offline Mode
If you would like to just generate the SQL statements that would have been executed, you can use alembic's offline mode.
$ alembic -c config.ini upgrade head --sql
Adding Database Migrations
The best way to learn about how to add additional database migrations is to refer to the Alembic documentation.