Difference between revisions of "Get Asterisk CLI output for specific call"
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
1. Backup old log: mv /var/log/asterisk/full /var/log/asterisk/full_old | 1. Backup old log: mv /var/log/asterisk/full /var/log/asterisk/full_old (if needed) | ||
2. Enable full log in /etc/asterisk/logger.conf | 2. Enable full log in /etc/asterisk/logger.conf (if needed) | ||
3. asterisk -vvvvrx 'logger reload' | 3. asterisk -vvvvrx 'logger reload' | ||
4. Make a call, | 4. Make a call, remembering the destination number you dialed. | ||
5. cd /var/log/asterisk/ | 5. cd /var/log/asterisk/ | ||
Line 11: | Line 11: | ||
6. cat full | grep <DESTINATION NUMBER YOU DIALED BEFORE> | 6. cat full | grep <DESTINATION NUMBER YOU DIALED BEFORE> | ||
You can get a lot of output | You can get a lot of output. Look at the last line, which may look like this: | ||
[Feb 26 16:12:14] NOTICE['''32733]''' app_mor.c: Localized destination: 37063042438 (cut: , add: ) | [Feb 26 16:12:14] NOTICE['''32733]''' app_mor.c: Localized destination: 37063042438 (cut: , add: ) | ||
The most important part is in BOLD, and in this example it is: 32733] | The most important part is in BOLD, and in this example, it is: 32733] | ||
NOTE: | NOTE: First brackets are not included! This is very important! | ||
7. Now do: | 7. Now do: | ||
cat | cat messages | grep 32733] | ||
... and you will get the output of your call. | |||
<br><br> | |||
= Notes = | |||
Call log starts with: | |||
app_mor.c: Core version: 11.pre.82, Server ID: 1, Dial out settings: , active calls enabled: 1, .... | |||
And ends with: | |||
app_mor.c: Application mor started and ended successfully, with end code: 0! | |||
<br><br> | |||
= Logs not present = | |||
If NOTICE is not present in logs, check Asterisk output if (and which) logs are enabled: | |||
Command: | |||
asterisk -rx 'logger show channels' | |||
Output: | |||
Channel Type Status Configuration | |||
------- ---- ------ ------------- | |||
/var/log/asterisk/full File Enabled - DEBUG NOTICE WARNING ERROR VERBOSE | |||
/var/log/asterisk/messages File Enabled - DEBUG NOTICE WARNING ERROR VERBOSE | |||
Console Enabled - WARNING ERROR | |||
If NOTICE is still not present in logs, run this command: | |||
asterisk -rx 'mor logger notice on' | |||
<br><br> | <br><br> | ||
= See also = | = See also = | ||
* [[Asterisk CLI]] | * [[Asterisk CLI]] |
Latest revision as of 05:18, 27 August 2020
1. Backup old log: mv /var/log/asterisk/full /var/log/asterisk/full_old (if needed)
2. Enable full log in /etc/asterisk/logger.conf (if needed)
3. asterisk -vvvvrx 'logger reload'
4. Make a call, remembering the destination number you dialed.
5. cd /var/log/asterisk/
6. cat full | grep <DESTINATION NUMBER YOU DIALED BEFORE>
You can get a lot of output. Look at the last line, which may look like this:
[Feb 26 16:12:14] NOTICE[32733] app_mor.c: Localized destination: 37063042438 (cut: , add: )
The most important part is in BOLD, and in this example, it is: 32733]
NOTE: First brackets are not included! This is very important!
7. Now do:
cat messages | grep 32733]
... and you will get the output of your call.
Notes
Call log starts with:
app_mor.c: Core version: 11.pre.82, Server ID: 1, Dial out settings: , active calls enabled: 1, ....
And ends with:
app_mor.c: Application mor started and ended successfully, with end code: 0!
Logs not present
If NOTICE is not present in logs, check Asterisk output if (and which) logs are enabled:
Command:
asterisk -rx 'logger show channels'
Output:
Channel Type Status Configuration ------- ---- ------ ------------- /var/log/asterisk/full File Enabled - DEBUG NOTICE WARNING ERROR VERBOSE /var/log/asterisk/messages File Enabled - DEBUG NOTICE WARNING ERROR VERBOSE Console Enabled - WARNING ERROR
If NOTICE is still not present in logs, run this command:
asterisk -rx 'mor logger notice on'