Compare commits

...

2 Commits

Author SHA1 Message Date
Asterisk Development Team
68987d4e8a Update for 21.6.0 2024-11-21 17:17:48 +00:00
George Joseph
43b4863b8a res_pjsip: Change suppress_moh_on_sendonly to OPT_BOOL_T
The suppress_moh_on_sendonly endpoint option should have been
defined as OPT_BOOL_T in pjsip_configuration.c and AST_BOOL_VALUES
in the alembic script instead of OPT_YESNO_T and YESNO_VALUES.

Also updated contrib/ast-db-manage/README.md to indicate that
AST_BOOL_VALUES should always be used and provided an example.

Resolves: #995
2024-11-19 12:55:40 -07:00
8 changed files with 74 additions and 31 deletions

View File

@@ -1 +1 @@
21.6.0-rc1
21.6.0

View File

@@ -1 +1 @@
ChangeLogs/ChangeLog-21.6.0-rc1.md
ChangeLogs/ChangeLog-21.6.0.md

View File

@@ -1,18 +1,18 @@
## Change Log for Release asterisk-21.6.0-rc1
## Change Log for Release asterisk-21.6.0
### Links:
- [Full ChangeLog](https://downloads.asterisk.org/pub/telephony/asterisk/releases/ChangeLog-21.6.0-rc1.md)
- [GitHub Diff](https://github.com/asterisk/asterisk/compare/21.5.0...21.6.0-rc1)
- [Tarball](https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21.6.0-rc1.tar.gz)
- [Full ChangeLog](https://downloads.asterisk.org/pub/telephony/asterisk/releases/ChangeLog-21.6.0.md)
- [GitHub Diff](https://github.com/asterisk/asterisk/compare/21.5.0...21.6.0)
- [Tarball](https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21.6.0.tar.gz)
- [Downloads](https://downloads.asterisk.org/pub/telephony/asterisk)
### Summary:
- Commits: 38
- Commits: 39
- Commit Authors: 9
- Issues Resolved: 21
- Issues Resolved: 22
- Security Advisories Resolved: 0
### User Notes:
@@ -59,7 +59,7 @@
- Allan Nathanson: (1)
- Ben Ford: (3)
- Chrsmj: (1)
- George Joseph: (14)
- George Joseph: (15)
- Jiangxc: (1)
- Naveen Albert: (7)
- Peter Jannesen: (2)
@@ -90,6 +90,7 @@
- 979: [improvement]: Add ability to suppress MOH when a remote endpoint sends "sendonly" or "inactive"
- 982: [bug]: The addition of tenantid to the ast_sip_endpoint structure broke ABI compatibility
- 990: [improvement]: The help for PJSIP_AOR should indicate that you need to call PJSIP_CONTACT to get contact details
- 995: [bug]: suppress_moh_on_sendonly should use AST_BOOL_VALUES instead of YESNO_VALUES in alembic script
### Commits By Author:
@@ -101,7 +102,7 @@
- app_mixmonitor: Add 'D' option for dual-channel audio.
- Add res_pjsip_config_sangoma external module.
- #### George Joseph (14):
- #### George Joseph (15):
- db.c: Remove limit on family/key length
- manager.c: Split XML documentation to manager_doc.xml
- manager: Enhance event filtering for performance
@@ -116,6 +117,7 @@
- res_pjsip: Move tenantid to end of ast_sip_endpoint
- func_pjsip_aor/contact: Fix documentation for contact ID
- res_pjsip: Add new endpoint option "suppress_moh_on_sendonly"
- res_pjsip: Change suppress_moh_on_sendonly to OPT_BOOL_T
- #### Naveen Albert (7):
- app_voicemail: Fix ill-formatted pager emails with custom subject.
@@ -152,6 +154,7 @@
### Commit List:
- res_pjsip: Change suppress_moh_on_sendonly to OPT_BOOL_T
- res_pjsip: Add new endpoint option "suppress_moh_on_sendonly"
- res_pjsip.c: Fix Contact header rendering for IPv6 addresses.
- samples: remove and/or change some wiki mentions
@@ -192,6 +195,19 @@
### Commit Details:
#### res_pjsip: Change suppress_moh_on_sendonly to OPT_BOOL_T
Author: George Joseph
Date: 2024-11-15
The suppress_moh_on_sendonly endpoint option should have been
defined as OPT_BOOL_T in pjsip_configuration.c and AST_BOOL_VALUES
in the alembic script instead of OPT_YESNO_T and YESNO_VALUES.
Also updated contrib/ast-db-manage/README.md to indicate that
AST_BOOL_VALUES should always be used and provided an example.
Resolves: #995
#### res_pjsip: Add new endpoint option "suppress_moh_on_sendonly"
Author: George Joseph
Date: 2024-11-05

View File

@@ -1,5 +1,4 @@
Asterisk Database Manager
=========================
# 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
@@ -17,11 +16,8 @@ repositories include:
Alembic uses SQLAlchemy, which has support for
[many databases](http://docs.sqlalchemy.org/en/rel_0_8/dialects/index.html).
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
-------------
## Example Usage
First, create an ini file that contains database connection details. For help
with connection string details, see the
@@ -50,16 +46,47 @@ to upgrade or downgrade to, as well.
$ alembic -c config.ini upgrade 4da0c5f79a9c
Offline Mode
------------
## 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
--------------------------
## Adding Database Migrations
The best way to learn about how to add additional database migrations is to
refer to the [Alembic documentation](http://alembic.readthedocs.org).
### Notes
* For boolean columns, always use the AST_BOOL_VALUES type.
Example:
```
from alembic import op
import sqlalchemy as sa
# This works for MySQL/MariaDB and others as well
from sqlalchemy.dialects.postgresql import ENUM
AST_BOOL_NAME = 'ast_bool_values'
AST_BOOL_VALUES = [ '0', '1',
'off', 'on',
'false', 'true',
'no', 'yes' ]
def upgrade():
# ast_bool_values have already been created, so use postgres enum object type
# to get around "already created" issue - works okay with MySQL/MariaDB and others.
ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
op.add_column('ps_endpoints', sa.Column('suppress_moh_on_sendonly', ast_bool_values))
def downgrade():
if op.get_context().bind.dialect.name == 'mssql':
op.drop_constraint('ck_ps_endpoints_suppress_moh_on_sendonly_ast_bool_values', 'ps_endpoints')
op.drop_column('ps_endpoints', 'suppress_moh_on_sendonly')
```
Older scripts used YESNO_VALUES but that is no longer supported.

View File

@@ -14,17 +14,17 @@ from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import ENUM
YESNO_NAME = 'yesno_values'
YESNO_VALUES = ['yes', 'no']
AST_BOOL_NAME = 'ast_bool_values'
AST_BOOL_VALUES = [ '0', '1',
'off', 'on',
'false', 'true',
'no', 'yes' ]
def upgrade():
yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
op.add_column('ps_endpoints', sa.Column('suppress_moh_on_sendonly', yesno_values))
ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
op.add_column('ps_endpoints', sa.Column('suppress_moh_on_sendonly', ast_bool_values))
def downgrade():
if op.get_context().bind.dialect.name == 'mssql':
op.drop_constraint('ck_ps_endpoints_suppress_moh_on_sendonly_yesno_values', 'ps_endpoints')
op.drop_constraint('ck_ps_endpoints_suppress_moh_on_sendonly_ast_bool_values', 'ps_endpoints')
op.drop_column('ps_endpoints', 'suppress_moh_on_sendonly')

View File

@@ -1709,7 +1709,7 @@ UPDATE alembic_version SET version_num='801b9fced8b7' WHERE alembic_version.vers
-- Running upgrade 801b9fced8b7 -> 4f91fc18c979
ALTER TABLE ps_endpoints ADD COLUMN suppress_moh_on_sendonly ENUM('yes','no');
ALTER TABLE ps_endpoints ADD COLUMN suppress_moh_on_sendonly ENUM('0','1','off','on','false','true','no','yes');
UPDATE alembic_version SET version_num='4f91fc18c979' WHERE alembic_version.version_num = '801b9fced8b7';

View File

@@ -1833,7 +1833,7 @@ UPDATE alembic_version SET version_num='801b9fced8b7' WHERE alembic_version.vers
-- Running upgrade 801b9fced8b7 -> 4f91fc18c979
ALTER TABLE ps_endpoints ADD COLUMN suppress_moh_on_sendonly yesno_values;
ALTER TABLE ps_endpoints ADD COLUMN suppress_moh_on_sendonly ast_bool_values;
UPDATE alembic_version SET version_num='4f91fc18c979' WHERE alembic_version.version_num = '801b9fced8b7';

View File

@@ -2305,7 +2305,7 @@ int ast_res_pjsip_initialize_configuration(void)
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_aoc", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_aoc));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "tenantid", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, tenantid));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "suppress_moh_on_sendonly",
"no", OPT_YESNO_T, 1, FLDSET(struct ast_sip_endpoint, suppress_moh_on_sendonly));
"no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, suppress_moh_on_sendonly));
if (ast_sip_initialize_sorcery_transport()) {
ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");