<p>Jaco Kroon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/20024">View Change</a></p><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 include/asterisk/calendar.h<br>M res/res_calendar.c<br>2 files changed, 28 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/20024/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/calendar.h b/include/asterisk/calendar.h</span><br><span>index 4564c34..d22ae15 100644</span><br><span>--- a/include/asterisk/calendar.h</span><br><span>+++ b/include/asterisk/calendar.h</span><br><span>@@ -202,4 +202,7 @@</span><br><span>  */</span><br><span> void ast_calendar_config_release(void);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! \brief Convert a free-busy state integer value to a string.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+const char* ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state);</span><br><span> #endif /* _ASTERISK_CALENDAR_H */</span><br><span>diff --git a/res/res_calendar.c b/res/res_calendar.c</span><br><span>index 4af1fde..428f10a 100644</span><br><span>--- a/res/res_calendar.c</span><br><span>+++ b/res/res_calendar.c</span><br><span>@@ -357,6 +357,20 @@</span><br><span>   }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+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 NULL;</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 int calendar_busy_callback(void *obj, void *arg, int flags)</span><br><span> {</span><br><span>    struct ast_calendar_event *event = obj;</span><br><span>@@ -1683,6 +1697,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) ?: "Unknown (Busy)");</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/+/20024">change 20024</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/+/20024"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10 </div>
<div style="display:none"> Gerrit-Change-Number: 20024 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>