[Asterisk-code-review] res_calendar: output busy state as part of show calendar. (asterisk[master])

Jaco Kroon asteriskteam at digium.com
Thu Mar 23 14:06:45 CDT 2023


Attention is currently required from: Sean Bright.

Jaco Kroon has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/20024 )

Change subject: res_calendar: output busy state as part of show calendar.
......................................................................


Patch Set 3:

(5 comments)

File include/asterisk/calendar.h:

https://gerrit.asterisk.org/c/asterisk/+/20024/comment/4216cb1d_3b326d43 
PS3, Line 209: , or NULL if the input
             :  *   value isn't one of the pre-defined values
> This will need to be updated assuming you make the change I suggested to the implementation.
Done


https://gerrit.asterisk.org/c/asterisk/+/20024/comment/5d653580_8b3572bd 
PS3, Line 205: /*! \brief Convert a free-busy state integer value to a string.
             :  *
             :  * \param The busy_state value to obtain a string for.
             :  *
             :  * \return A human readable string describing the state, or NULL if the input
             :  *   value isn't one of the pre-defined values.
             :  */
             : const char *ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state);
> Remove this entirely. This does not need to be API.
Done


File res/res_calendar.c:

https://gerrit.asterisk.org/c/asterisk/+/20024/comment/302edb11_ab57cdbf 
PS2, Line 369: default:
             : 		return NULL;
> I would prefer to not cater to invalid state. […]
Agreed, but to verify all possible input cases is harder than to deal with the invalid value.  All non-zero values are treated as busy in the code.

Anyway, terniary at least removed.  I think this is as good as it will get without making 100% sure that no invalid inputs are possible.


https://gerrit.asterisk.org/c/asterisk/+/20024/comment/6aa2edd4_e5eaf51e 
PS2, Line 1700: 		ast_cli(a->fd, FORMAT2, "Busy State", ast_calendar_busy_state_to_str(event->busy_state) ?: "Unknown (Busy)");
> If the above change is made then the ternary is not needed.
Done


File res/res_calendar.c:

https://gerrit.asterisk.org/c/asterisk/+/20024/comment/f7699f7a_b7c6060a 
PS3, Line 360: const char *ast_calendar_busy_state_to_str(enum ast_calendar_busy_state busy_state)
> This doesn't need to be API, so make it static.
Done



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/20024
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I894e4ecc3e93db4ff7783d46266ba3c5e6ccda10
Gerrit-Change-Number: 20024
Gerrit-PatchSet: 3
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Comment-Date: Thu, 23 Mar 2023 19:06:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sean Bright <sean at seanbright.com>
Comment-In-Reply-To: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230323/2db04a93/attachment.html>


More information about the asterisk-code-review mailing list