[Asterisk-code-review] app queue: Show reason of pause on CLI (asterisk[master])
Rodrigo Ramirez Norambuena
asteriskteam at digium.com
Fri Nov 20 19:55:09 CST 2015
Rodrigo Ramirez Norambuena has uploaded a new change for review.
https://gerrit.asterisk.org/1666
Change subject: app_queue: Show reason of pause on CLI
......................................................................
app_queue: Show reason of pause on CLI
Add value of pause reason when is paused on CLI command "queue show"
ASTERISK-25581 #close
Report by: Rodrigo Ramírez Norambuena
Change-Id: I887028a40cd97b350da9a3bb2719616b7fec9864
---
M apps/app_queue.c
1 file changed, 13 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/66/1666/1
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 234543f..e4bb27a 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -9250,10 +9250,20 @@
ast_str_append(&out, 0, " (ringinuse %s)", mem->ringinuse ? "enabled" : "disabled");
- ast_str_append(&out, 0, "%s%s%s%s%s%s%s%s%s (%s%s%s)",
+ ast_str_append(&out, 0, "%s%s%s%s%s%s",
mem->dynamic ? ast_term_color(COLOR_CYAN, COLOR_BLACK) : "", mem->dynamic ? " (dynamic)" : "", ast_term_reset(),
- mem->realtime ? ast_term_color(COLOR_MAGENTA, COLOR_BLACK) : "", mem->realtime ? " (realtime)" : "", ast_term_reset(),
- mem->paused ? ast_term_color(COLOR_BROWN, COLOR_BLACK) : "", mem->paused ? " (paused)" : "", ast_term_reset(),
+ mem->realtime ? ast_term_color(COLOR_MAGENTA, COLOR_BLACK) : "", mem->realtime ? " (realtime)" : "", ast_term_reset());
+ if (mem->paused) {
+ if (ast_strlen_zero(mem->reason_paused)) {
+ ast_str_append(&out, 0, "%s%s%s",
+ ast_term_color(COLOR_BROWN, COLOR_BLACK), " (paused)", ast_term_reset());
+ } else {
+ ast_str_append(&out, 0, "%s%s:%s%s%s", ast_term_color(COLOR_BROWN, COLOR_BLACK),
+ " (paused", mem->reason_paused, ")" , ast_term_reset());
+ }
+ }
+
+ ast_str_append(&out, 0, " (%s%s%s)",
ast_term_color(
mem->status == AST_DEVICE_UNAVAILABLE || mem->status == AST_DEVICE_UNKNOWN ?
COLOR_RED : COLOR_GREEN, COLOR_BLACK),
--
To view, visit https://gerrit.asterisk.org/1666
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I887028a40cd97b350da9a3bb2719616b7fec9864
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
More information about the asterisk-code-review
mailing list