<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/20015">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_calendar: output busy state as part of show calendar.<br><br>Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10<br>Signed-off-by: Jaco Kroon <jaco@uls.co.za><br>---<br>M res/res_calendar.c<br>1 file changed, 26 insertions(+), 0 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_calendar.c b/res/res_calendar.c</span><br><span>index 4af1fde..bb1d63e 100644</span><br><span>--- a/res/res_calendar.c</span><br><span>+++ b/res/res_calendar.c</span><br><span>@@ -1608,6 +1608,21 @@</span><br><span> return buf;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static const char *ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ switch (busy_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+ case AST_CALENDAR_BS_FREE:</span><br><span style="color: hsl(120, 100%, 40%);">+ return "Free";</span><br><span style="color: hsl(120, 100%, 40%);">+ case AST_CALENDAR_BS_BUSY_TENTATIVE:</span><br><span style="color: hsl(120, 100%, 40%);">+ return "Busy (Tentative)";</span><br><span style="color: hsl(120, 100%, 40%);">+ case AST_CALENDAR_BS_BUSY:</span><br><span style="color: hsl(120, 100%, 40%);">+ return "Busy";</span><br><span style="color: hsl(120, 100%, 40%);">+ default:</span><br><span style="color: hsl(120, 100%, 40%);">+ return "Unknown (Busy)";</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static char *handle_show_calendar(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)</span><br><span> {</span><br><span> #define FORMAT "%-18.18s : %-20.20s\n"</span><br><span>@@ -1683,6 +1698,7 @@</span><br><span> ast_cli(a->fd, FORMAT2, "Start", epoch_to_string(buf, sizeof(buf), event->start));</span><br><span> ast_cli(a->fd, FORMAT2, "End", epoch_to_string(buf, sizeof(buf), event->end));</span><br><span> ast_cli(a->fd, FORMAT2, "Alarm", epoch_to_string(buf, sizeof(buf), event->alarm));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(a->fd, FORMAT2, "Busy State", ast_calendar_busy_state_to_str(event->busy_state));</span><br><span> ast_cli(a->fd, "\n");</span><br><span> </span><br><span> event = ast_calendar_unref_event(event);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/20015">change 20015</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/20015"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10 </div>
<div style="display:none"> Gerrit-Change-Number: 20015 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>