diff options
author | Corey Farrell <git@cfware.com> | 2015-11-02 21:11:11 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2015-11-05 10:20:34 -0500 |
commit | cd5ae02812faa311056adb3f27cd8270642a4a6e (patch) | |
tree | 853b2a8ed77045619ffd41a518a8266aaff967e8 | |
parent | e26a06c1dafc9975a4e3a7e5e3153fcf75b1eeaa (diff) |
Increase account code maximum length to 80.
This increases the maximum length of account code's to match
extensions. This ensures it is always possible to set an
accountcode to ${EXTEN} without truncation.
ASTERISK-23904
Reported by: Ben Merrills
Change-Id: If122602304ce03362722eb213a3111b32da5eeb9
3 files changed, 55 insertions, 1 deletions
diff --git a/contrib/ast-db-manage/cdr/versions/54cde9847798_expand_accountcode_to_80.py b/contrib/ast-db-manage/cdr/versions/54cde9847798_expand_accountcode_to_80.py new file mode 100644 index 000000000..dd61a44ee --- /dev/null +++ b/contrib/ast-db-manage/cdr/versions/54cde9847798_expand_accountcode_to_80.py @@ -0,0 +1,26 @@ +"""expand accountcode to 80 + +Revision ID: 54cde9847798 +Revises: 210693f3123d +Create Date: 2015-11-05 09:54:06.815364 + +""" + +# revision identifiers, used by Alembic. +revision = '54cde9847798' +down_revision = '210693f3123d' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.alter_column('cdr', 'accountcode', type_=sa.String(80)) + op.alter_column('cdr', 'peeraccount', type_=sa.String(80)) + pass + + +def downgrade(): + op.alter_column('cdr', 'accountcode', type_=sa.String(20)) + op.alter_column('cdr', 'peeraccount', type_=sa.String(20)) + pass diff --git a/contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py b/contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py new file mode 100644 index 000000000..31889c66b --- /dev/null +++ b/contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py @@ -0,0 +1,28 @@ +"""expand accountcode to 80 + +Revision ID: 339a3bdf53fc +Revises: 28ce1e718f05 +Create Date: 2015-11-05 10:10:27.465794 + +""" + +# revision identifiers, used by Alembic. +revision = '339a3bdf53fc' +down_revision = '28ce1e718f05' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.alter_column('ps_endpoints', 'accountcode', type_=sa.String(80)) + op.alter_column('sippeers', 'accountcode', type_=sa.String(80)) + op.alter_column('iaxfriends', 'accountcode', type_=sa.String(80)) + pass + + +def downgrade(): + op.alter_column('ps_endpoints', 'accountcode', type_=sa.String(20)) + op.alter_column('sippeers', 'accountcode', type_=sa.String(40)) + op.alter_column('iaxfriends', 'accountcode', type_=sa.String(20)) + pass diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index fffbe5c09..384c22d5f 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -158,7 +158,7 @@ extern "C" { */ #define AST_MAX_UNIQUEID (AST_MAX_PUBLIC_UNIQUEID + 2 + 1) -#define AST_MAX_ACCOUNT_CODE 20 /*!< Max length of an account code */ +#define AST_MAX_ACCOUNT_CODE 80 /*!< Max length of an account code */ #define AST_CHANNEL_NAME 80 /*!< Max length of an ast_channel name */ #define MAX_LANGUAGE 40 /*!< Max length of the language setting */ #define MAX_MUSICCLASS 80 /*!< Max length of the music class setting */ |