Skip to content

Commit 47c60a8

Browse files
committed
corrected MD formatting errors - replace <0xa0> with space
1 parent 8b4cb26 commit 47c60a8

File tree

7 files changed

+196
-191
lines changed

7 files changed

+196
-191
lines changed

docs/Configuration/Interfaces/Asterisk-Manager-Interface-AMI/AMI-v2-Specification/index.md

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

docs/Configuration/Interfaces/Back-end-Database-and-Realtime-Connectivity/Managing-Realtime-Databases-with-Alembic.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,74 @@
22
title: Managing Realtime Databases with Alembic
33
---
44

5-
Overview
6-
========
5+
# Overview
76

8-
Asterisk 12 now uses [Alembic](https://pypi.python.org/pypi/alembic) to help manage Asterisk Realtime Database schemas. This includes creation of SQL scripts for a variety of database vendors, but also much more. Alembic is a full database migration tool, with support for upgrading the schemas of existing databases, versioning of schemas, creation of new tables and databases, and a whole lot more. This page covers basic configuration of the Alembic configuration file for usage with Asterisk Realtime as well as basic usage of Alembic. While a full description of Alembic is beyond the scope of this page, the information on this page should help an Asterisk administrator create or upgrade an Asterisk installation.
7+
Asterisk 12 now uses [Alembic](https://pypi.python.org/pypi/alembic) to help manage Asterisk Realtime Database schemas. This includes creation of SQL scripts for a variety of database vendors, but also much more. Alembic is a full database migration tool, with support for upgrading the schemas of existing databases, versioning of schemas, creation of new tables and databases, and a whole lot more. This page covers basic configuration of the Alembic configuration file for usage with Asterisk Realtime as well as basic usage of Alembic. While a full description of Alembic is beyond the scope of this page, the information on this page should help an Asterisk administrator create or upgrade an Asterisk installation.
98

10-
Alembic makes upgrading less painfulAs Asterisk changes and new fields are made controllable via realtime, new Alembic change scripts are added so you will be able to simply run the Alembic upgrade command again in order to modify your database.
9+
Alembic makes upgrading less painful. As Asterisk changes and new fields are made controllable via realtime, new Alembic change scripts are added so you will be able to simply run the Alembic upgrade command again in order to modify your database.
1110

12-
While Alembic helps with database migrations within a release series (e.g., Asterisk 13.x.x) it does not work very well when jumping to a different release series (e.g., jumping from Asterisk 13.x.x to Asterisk 15.x.x).  Data loss is possible when jumping to a different release series.  Before a new series (e.g., Asterisk 15.0.0) is initially released breaking changes can be introduced that can result in data loss.
13-
14-
Always exercise due diligence and backup your database before upgrading.  Tables can be fixed easily.  Repopulating the data if it's lost however isn't.
11+
While Alembic helps with database migrations within a release series (e.g., Asterisk 13.x.x) it does not work very well when jumping to a different release series (e.g., jumping from Asterisk 13.x.x to Asterisk 15.x.x).
12+
- Data loss is possible when jumping to a different release series.
13+
- Before a new series (e.g., Asterisk 15.0.0) is initially released breaking changes can be introduced that can result in data loss.
14+
- Always exercise due diligence and backup your database before upgrading.
15+
- Tables can be fixed easily.
16+
- Repopulating the data if it's lost however isn't.
1517

1618
Please read the CHANGES file and the applicable UPGRADE files for important information about what changed between revisions.
1719

18-
Before you Begin
19-
----------------
20+
## Before you Begin
2021

21-
This tutorial assumes you already have some experience in setting up Realtime configuration with Asterisk for other modules. This page will not describe how to set up backend database connectors, and is written under the assumption that you will be using ODBC to connect to your database since the ODBC adaptor is capable of connecting to most commonly used database servers. For more information on configuring and setting up Asterisk Realtime, see Asterisk Realtime Database configuration.
22+
This tutorial assumes you already have some experience in setting up Realtime configuration with Asterisk for other modules. This page will not describe how to set up backend database connectors, and is written under the assumption that you will be using ODBC to connect to your database since the ODBC adaptor is capable of connecting to most commonly used database servers. For more information on configuring and setting up Asterisk Realtime, see: [Asterisk Realtime Database configuration](/Fundamentals/Asterisk-Configuration/Database-Support-Configuration/Realtime-Database-Configuration).
2223

23-
Installing Alembic
24-
==================
24+
# Installing Alembic
2525

2626
If you don't already have Alembic installed, perform the following:
2727

2828
This does assume that you have pip installed. If you do not have pip installed, easy\_install should work just as well. If you don't have [pip](https://github.com/pypa/pip) or easy\_install (or Python), then you should probably install those first.
2929

30-
$ pip install alembicAnd that's it!
30+
```sh
31+
pip install alembic
32+
```
33+
34+
And that's it!
35+
36+
# Building the Database Tables
37+
3138

32-
Building the Database Tables
33-
============================
39+
Alembic scripts were added to Asterisk in Asterisk 12, and will allow you to automatically populate your database with tables for most of the commonly used configuration options. The scripts are located in the [Asterisk contrib/ast-db-manage](http://svn.asterisk.org/svn/asterisk/trunk/contrib/ast-db-manage/) folder:
3440

35-
Alembic scripts were added to Asterisk in Asterisk 12, and will allow you to automatically populate your database with tables for most of the commonly used configuration options. The scripts are located in the [Asterisk contrib/ast-db-manage](http://svn.asterisk.org/svn/asterisk/trunk/contrib/ast-db-manage/) folder:
41+
```sh
42+
$ cd contrib/ast-db-manage
43+
```
3644

37-
$ cd contrib/ast-db-manageFor the rest of this tutorial, we will assume that operations will be taken in the context of that directory.
45+
For the rest of this tutorial, we will assume that operations will be taken in the context of that directory.
3846

39-
Configuring Alembic
40-
-------------------
47+
# Configuring Alembic
4148

42-
Within this directory, you will find a configuration sample file, `config.ini.sample`, which will need to be edited to connect to your database of choice. Open this file in your text editor of choice and then save a copy of this sample file as `config.ini` - this will serve as the configuration file you actually use with Alembic.
49+
Within this directory, you will find a configuration sample file, `config.ini.sample`, which will need to be edited to connect to your database of choice. Open this file in your text editor of choice and then save a copy of this sample file as `config.ini` - this will serve as the configuration file you actually use with Alembic.
4350

44-
There are two different parameters in `config.ini` that require review: `sqlalchemy.url` and `script_location`. The first specifies the database to upgrade; the second which upgrades to perform.
51+
There are two different parameters in `config.ini` that require review: `sqlalchemy.url` and `script_location`. The first specifies the database to upgrade; the second which upgrades to perform.
4552

46-
1. Update `sqlalchemy.url` to the URL for your database. An example is shown below for a MySQL database:
53+
1. Update `sqlalchemy.url` to the URL for your database. An example is shown below for a MySQL database:
4754

48-
sqlalchemy.url = mysql://root:password@localhost/asteriskThis would connect to a MySQL database as user `root` with password `password`. The database is `asterisk`, located on `localhost`. Different databases will require different URL schemas; however, they should in general follow the format outlined above. Alembic supports many different database technologies, including `oracle`, `postgresql`, and `mssql`.
55+
sqlalchemy.url = mysql://root:password@localhost/asteriskThis would connect to a MySQL database as user `root` with password `password`. The database is `asterisk`, located on `localhost`. Different databases will require different URL schemas; however, they should in general follow the format outlined above. Alembic supports many different database technologies, including `oracle`, `postgresql`, and `mssql`.
4956

50-
For more information, see the Alembic documentation on SQLAlchemy URLs: <http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#database-urls>
51-
2. Update `script_location` to the schema to update. Asterisk currently supports two sets of schemas:
57+
For more information, see the Alembic documentation on SQLAlchemy URLs: <http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html#database-urls>
58+
2. Update `script_location` to the schema to update. Asterisk currently supports two sets of schemas:
5259
1. `config` - the set of schemas for Asterisk Realtime databases
5360
2. `voicemail` - the schema for ODBC VoiceMail
5461

55-
Executing the database upgrade
56-
------------------------------
62+
# Executing the database upgrade
63+
5764

5865
I'm sorry Dave, I'm afraid I can't let you do that.Using config.ini for Alembic will populate tables for all of the configuration objects that can be populated this way, so if you really don't want a table for sip peers, iax friends, voicemail, meetme, and music on hold, you may need to exercise a little fine control. Back up your database before continuing and be prepared to delete tables that you don't want when you are finished.
5966

6067
Your config.ini should be ready for use at this point, so close your text editor and return to the terminal. Then run:
6168

6269
$ alembic -c config.ini upgrade headAt this point, if you configured your config.ini to connect to the database properly, your tables should be ready.
6370

64-
Troubleshooting the upgrade
65-
---------------------------
71+
# Troubleshooting the upgrade
72+
6673

6774
**Symptom:** Running 'alembic -c config.ini upgrade head' fails with a traceback:
6875

@@ -76,8 +83,6 @@ ImportError: No module named MySQLdb**Solution**: You probably need the Python i
7683

7784
For example, with Ubuntu, install the following package and then re-run your Alembic upgrade.
7885

79-
# apt-get install python-mysqldb 
80-
81-
 
82-
83-
 
86+
```sh
87+
apt-get install python-mysqldb
88+
```

docs/Configuration/Miscellaneous/Hangup-Cause-Mappings.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,57 @@ Asterisk Hangup Cause Code Mappings
77

88
| Asterisk Value | ISDN Cause codes (Q.850 & Q.931 unless specified) | MFC/R2 | SIP/PJSIP | Motif |
99
| --- | --- | --- | --- | --- |
10-
| AST\_CAUSE\_NOT\_DEFINED | Cause not defined | OR2\_CAUSE\_UNSPECIFIED |   |   |
10+
| AST\_CAUSE\_NOT\_DEFINED | Cause not defined | OR2\_CAUSE\_UNSPECIFIED | | |
1111
| AST\_CAUSE\_UNALLOCATED | 1. Unallocated (unassigned) number
12-
|   | 404, 485, 604 |   |
13-
| AST\_CAUSE\_NO\_ROUTE\_TRANSIT\_NET | 2. No route to specified transmit network |   |   |   |
14-
| AST\_CAUSE\_NO\_ROUTE\_DESTINATION | 3. No route to destination |   | 420 |   |
15-
| AST\_CAUSE\_MISDIALLED\_TRUNK\_PREFIX | 5. Misdialled trunk prefix (national use) |   |   |   |
16-
| AST\_CAUSE\_CHANNEL\_UNACCEPTABLE | 6. Channel unacceptable |   |   |   |
17-
| AST\_CAUSE\_CALL\_AWARDED\_DELIVERED | 7. Call awarded and being delivered in an established channel |   |   |   |
18-
| AST\_CAUSE\_PRE\_EMPTED | ISUP - 8. Preemption |   |   |   |
19-
| AST\_CAUSE\_NUMBER\_PORTED\_NOT\_HERE | 14. QoR: ported number |   |   |   |
20-
| AST\_CAUSE\_NORMAL\_CLEARING | 16. Normal Clearing | OR2\_CAUSE\_NORMAL\_CLEARING |   | gone, success |
12+
| | 404, 485, 604 | |
13+
| AST\_CAUSE\_NO\_ROUTE\_TRANSIT\_NET | 2. No route to specified transmit network | | | |
14+
| AST\_CAUSE\_NO\_ROUTE\_DESTINATION | 3. No route to destination | | 420 | |
15+
| AST\_CAUSE\_MISDIALLED\_TRUNK\_PREFIX | 5. Misdialled trunk prefix (national use) | | | |
16+
| AST\_CAUSE\_CHANNEL\_UNACCEPTABLE | 6. Channel unacceptable | | | |
17+
| AST\_CAUSE\_CALL\_AWARDED\_DELIVERED | 7. Call awarded and being delivered in an established channel | | | |
18+
| AST\_CAUSE\_PRE\_EMPTED | ISUP - 8. Preemption | | | |
19+
| AST\_CAUSE\_NUMBER\_PORTED\_NOT\_HERE | 14. QoR: ported number | | | |
20+
| AST\_CAUSE\_NORMAL\_CLEARING | 16. Normal Clearing | OR2\_CAUSE\_NORMAL\_CLEARING | | gone, success |
2121
| AST\_CAUSE\_USER\_BUSY | 17. User busy | OR2\_CAUSE\_BUSY\_NUMBER | 486, 600 | busy |
22-
| AST\_CAUSE\_NO\_USER\_RESPONSE | 18. No user responding |   | 408 | expired |
23-
| AST\_CAUSE\_NO\_ANSWER | 19. No answer from user (user alerted) | OR2\_CAUSE\_NO\_ANSWER | 480, 483 |   |
24-
| AST\_CAUSE\_SUBSCRIBER\_ABSENT | 20. Subscriber absent | OR2\_CAUSE\_UNALLOCATED\_NUMBER |   |   |
25-
| AST\_CAUSE\_CALL\_REJECTED | 21. Call Rejected |   | 401, 403, 407, 603 | cancel, decline |
26-
| AST\_CAUSE\_NUMBER\_CHANGED | 22. Number changed |   | 410 |   |
27-
| AST\_CAUSE\_REDIRECTED\_TO\_NEW\_DESTINATION | 23. Redirected to new destination |   |   |   |
28-
| AST\_CAUSE\_ANSWERED\_ELSEWHERE | 26. Non-selected user clearing(ASTERISK-15057) |   |   |   |
29-
| AST\_CAUSE\_DESTINATION\_OUT\_OF\_ORDER | 27. Destination out of order | OR2\_CAUSE\_OUT\_OF\_ORDER | 502 |   |
30-
| AST\_CAUSE\_INVALID\_NUMBER\_FORMAT | 28. Invalid number format |   | 484 |   |
31-
| AST\_CAUSE\_FACILITY\_REJECTED | 29. Facility rejected |   | 501 |   |
32-
| AST\_CAUSE\_RESPONSE\_TO\_STATUS\_ENQUIRY | 30. Response to STATUS ENQUIRY |   |   |   |
33-
| AST\_CAUSE\_NORMAL\_UNSPECIFIED | 31. Normal, unspecified |   |   |   |
34-
| AST\_CAUSE\_NORMAL\_CIRCUIT\_CONGESTION | 34. No circuit/channel available(Note that we've called this "Circuit/channel congestion" for a while which can cause confusion with code 42) | OR2\_CAUSE\_NETWORK\_CONGESTION |   | general-error |
35-
| AST\_CAUSE\_NETWORK\_OUT\_OF\_ORDER | 38. Network out of order |   | 500 |   |
36-
| AST\_CAUSE\_NORMAL\_TEMPORARY\_FAILURE | 41. Temporary failure |   | 409 |   |
37-
| AST\_CAUSE\_SWITCH\_CONGESTION | 42. Switching equipment congestion |   | 5xx | failed-application |
38-
| AST\_CAUSE\_ACCESS\_INFO\_DISCARDED | 43. Access information discarded |   |   |   |
39-
| AST\_CAUSE\_REQUESTED\_CHAN\_UNAVAIL | 44. Requested circuit/channel not available |   |   |   |
40-
| AST\_CAUSE\_FACILITY\_NOT\_SUBSCRIBED | 50. Requested facility not subscribed |   |   |   |
41-
| AST\_CAUSE\_OUTGOING\_CALL\_BARRED | 52. Outgoing call barred |   |   |   |
42-
| AST\_CAUSE\_INCOMING\_CALL\_BARRED | 54. Incoming call barred |   |   |   |
43-
| AST\_CAUSE\_BEARERCAPABILITY\_NOTAUTH | 57. Bearer capability not authorized |   |   |   |
44-
| AST\_CAUSE\_BEARERCAPABILITY\_NOTAVAIL | 58. Bearer capability not presently available |   | 488, 606 | incompatible-parameters, media-error, unsupported-applications |
45-
| AST\_CAUSE\_BEARERCAPABILITY\_NOTIMPL | 65. Bearer capability not implemented |   |   |   |
46-
| AST\_CAUSE\_CHAN\_NOT\_IMPLEMENTED | 66. Channel type not implemented |   |   |   |
47-
| AST\_CAUSE\_FACILITY\_NOT\_IMPLEMENTED | 69. Requested facility not implemented |   |   | unsupported-transports |
48-
| AST\_CAUSE\_INVALID\_CALL\_REFERENCE | 81. Invalid call reference value |   |   |   |
49-
| AST\_CAUSE\_INCOMPATIBLE\_DESTINATION | 88. Incompatible destination |   |   |   |
50-
| AST\_CAUSE\_INVALID\_MSG\_UNSPECIFIED | 95. Invalid message unspecified |   |   |   |
51-
| AST\_CAUSE\_MANDATORY\_IE\_MISSING | 96. Mandatory information element is missing |   |   |   |
52-
| AST\_CAUSE\_MESSAGE\_TYPE\_NONEXIST | 97. Message type non-existent or not implemented |   |   |   |
53-
| AST\_CAUSE\_WRONG\_MESSAGE | 98. Message not compatible with call state or message type non-existent or not implemented |   |   |   |
54-
| AST\_CAUSE\_IE\_NONEXIST | 99. Information element nonexistent or not implemented |   |   |   |
55-
| AST\_CAUSE\_INVALID\_IE\_CONTENTS | 100. Invalid information element contents |   |   |   |
56-
| AST\_CAUSE\_WRONG\_CALL\_STATE | 101. Message not compatible with call state |   |   |   |
57-
| AST\_CAUSE\_RECOVERY\_ON\_TIMER\_EXPIRE | 102. Recover on timer expiry |   | 504 | timeout |
58-
| AST\_CAUSE\_MANDATORY\_IE\_LENGTH\_ERROR | ? Mandatory IE length error |   |   |   |
59-
| AST\_CAUSE\_PROTOCOL\_ERROR | 111. Protocol error, unspecified |   |   | failed-transport, security-error |
60-
| AST\_CAUSE\_INTERWORKING | 127. Interworking, unspecified |   | 4xx, 505, 6xx | connectivity-error |
22+
| AST\_CAUSE\_NO\_USER\_RESPONSE | 18. No user responding | | 408 | expired |
23+
| AST\_CAUSE\_NO\_ANSWER | 19. No answer from user (user alerted) | OR2\_CAUSE\_NO\_ANSWER | 480, 483 | |
24+
| AST\_CAUSE\_SUBSCRIBER\_ABSENT | 20. Subscriber absent | OR2\_CAUSE\_UNALLOCATED\_NUMBER | | |
25+
| AST\_CAUSE\_CALL\_REJECTED | 21. Call Rejected | | 401, 403, 407, 603 | cancel, decline |
26+
| AST\_CAUSE\_NUMBER\_CHANGED | 22. Number changed | | 410 | |
27+
| AST\_CAUSE\_REDIRECTED\_TO\_NEW\_DESTINATION | 23. Redirected to new destination | | | |
28+
| AST\_CAUSE\_ANSWERED\_ELSEWHERE | 26. Non-selected user clearing(ASTERISK-15057) | | | |
29+
| AST\_CAUSE\_DESTINATION\_OUT\_OF\_ORDER | 27. Destination out of order | OR2\_CAUSE\_OUT\_OF\_ORDER | 502 | |
30+
| AST\_CAUSE\_INVALID\_NUMBER\_FORMAT | 28. Invalid number format | | 484 | |
31+
| AST\_CAUSE\_FACILITY\_REJECTED | 29. Facility rejected | | 501 | |
32+
| AST\_CAUSE\_RESPONSE\_TO\_STATUS\_ENQUIRY | 30. Response to STATUS ENQUIRY | | | |
33+
| AST\_CAUSE\_NORMAL\_UNSPECIFIED | 31. Normal, unspecified | | | |
34+
| AST\_CAUSE\_NORMAL\_CIRCUIT\_CONGESTION | 34. No circuit/channel available(Note that we've called this "Circuit/channel congestion" for a while which can cause confusion with code 42) | OR2\_CAUSE\_NETWORK\_CONGESTION | | general-error |
35+
| AST\_CAUSE\_NETWORK\_OUT\_OF\_ORDER | 38. Network out of order | | 500 | |
36+
| AST\_CAUSE\_NORMAL\_TEMPORARY\_FAILURE | 41. Temporary failure | | 409 | |
37+
| AST\_CAUSE\_SWITCH\_CONGESTION | 42. Switching equipment congestion | | 5xx | failed-application |
38+
| AST\_CAUSE\_ACCESS\_INFO\_DISCARDED | 43. Access information discarded | | | |
39+
| AST\_CAUSE\_REQUESTED\_CHAN\_UNAVAIL | 44. Requested circuit/channel not available | | | |
40+
| AST\_CAUSE\_FACILITY\_NOT\_SUBSCRIBED | 50. Requested facility not subscribed | | | |
41+
| AST\_CAUSE\_OUTGOING\_CALL\_BARRED | 52. Outgoing call barred | | | |
42+
| AST\_CAUSE\_INCOMING\_CALL\_BARRED | 54. Incoming call barred | | | |
43+
| AST\_CAUSE\_BEARERCAPABILITY\_NOTAUTH | 57. Bearer capability not authorized | | | |
44+
| AST\_CAUSE\_BEARERCAPABILITY\_NOTAVAIL | 58. Bearer capability not presently available | | 488, 606 | incompatible-parameters, media-error, unsupported-applications |
45+
| AST\_CAUSE\_BEARERCAPABILITY\_NOTIMPL | 65. Bearer capability not implemented | | | |
46+
| AST\_CAUSE\_CHAN\_NOT\_IMPLEMENTED | 66. Channel type not implemented | | | |
47+
| AST\_CAUSE\_FACILITY\_NOT\_IMPLEMENTED | 69. Requested facility not implemented | | | unsupported-transports |
48+
| AST\_CAUSE\_INVALID\_CALL\_REFERENCE | 81. Invalid call reference value | | | |
49+
| AST\_CAUSE\_INCOMPATIBLE\_DESTINATION | 88. Incompatible destination | | | |
50+
| AST\_CAUSE\_INVALID\_MSG\_UNSPECIFIED | 95. Invalid message unspecified | | | |
51+
| AST\_CAUSE\_MANDATORY\_IE\_MISSING | 96. Mandatory information element is missing | | | |
52+
| AST\_CAUSE\_MESSAGE\_TYPE\_NONEXIST | 97. Message type non-existent or not implemented | | | |
53+
| AST\_CAUSE\_WRONG\_MESSAGE | 98. Message not compatible with call state or message type non-existent or not implemented | | | |
54+
| AST\_CAUSE\_IE\_NONEXIST | 99. Information element nonexistent or not implemented | | | |
55+
| AST\_CAUSE\_INVALID\_IE\_CONTENTS | 100. Invalid information element contents | | | |
56+
| AST\_CAUSE\_WRONG\_CALL\_STATE | 101. Message not compatible with call state | | | |
57+
| AST\_CAUSE\_RECOVERY\_ON\_TIMER\_EXPIRE | 102. Recover on timer expiry | | 504 | timeout |
58+
| AST\_CAUSE\_MANDATORY\_IE\_LENGTH\_ERROR | ? Mandatory IE length error | | | |
59+
| AST\_CAUSE\_PROTOCOL\_ERROR | 111. Protocol error, unspecified | | | failed-transport, security-error |
60+
| AST\_CAUSE\_INTERWORKING | 127. Interworking, unspecified | | 4xx, 505, 6xx | connectivity-error |
6161

6262
#### Notes
6363

0 commit comments

Comments
 (0)