[Asterisk-code-review] Increase account code maximum length to 80. (asterisk[master])
Matt Jordan
asteriskteam at digium.com
Wed Nov 11 08:09:18 CST 2015
Matt Jordan has submitted this change and it was merged.
Change subject: Increase account code maximum length to 80.
......................................................................
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
---
A contrib/ast-db-manage/cdr/versions/54cde9847798_expand_accountcode_to_80.py
A contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py
M include/asterisk/channel.h
3 files changed, 55 insertions(+), 1 deletion(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, approved
Joshua Colp: Looks good to me, but someone else must approve
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 0000000..dd61a44
--- /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 0000000..31889c6
--- /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 fffbe5c..384c22d 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -158,7 +158,7 @@
*/
#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 */
--
To view, visit https://gerrit.asterisk.org/1570
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If122602304ce03362722eb213a3111b32da5eeb9
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list