Increase account code maximum length to 80.
authorCorey Farrell <git@cfware.com>
Tue, 3 Nov 2015 02:11:11 +0000 (21:11 -0500)
committerCorey Farrell <git@cfware.com>
Thu, 5 Nov 2015 15:20:34 +0000 (10:20 -0500)
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

contrib/ast-db-manage/cdr/versions/54cde9847798_expand_accountcode_to_80.py [new file with mode: 0644]
contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py [new file with mode: 0644]
include/asterisk/channel.h

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 (file)
index 0000000..dd61a44
--- /dev/null
@@ -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 (file)
index 0000000..31889c6
--- /dev/null
@@ -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
index fffbe5c..384c22d 100644 (file)
@@ -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 */