From: Naveen Albert Date: Thu, 14 Dec 2023 14:43:14 +0000 (-0500) Subject: res_calendar_icalendar: Print iCalendar error on parsing failure. X-Git-Tag: 21.2.0-rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65c8cede5cc03344617cf08d123944e442e8975;p=thirdparty%2Fasterisk.git res_calendar_icalendar: Print iCalendar error on parsing failure. If libical fails to parse a calendar, print the error message it provdes. Resolves: #492 (cherry picked from commit ef891529facf373db73ff9820210235eb29f9bb9) --- diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c index 29be671d35..95790e5d08 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -155,6 +155,10 @@ static icalcomponent *fetch_icalendar(struct icalendar_pvt *pvt) if (!ast_strlen_zero(ast_str_buffer(response))) { comp = icalparser_parse_string(ast_str_buffer(response)); + if (!comp) { + ast_debug(3, "iCalendar response data: %s\n", ast_str_buffer(response)); + ast_log(LOG_WARNING, "Failed to parse iCalendar data: %s\n", icalerror_perror()); + } } ast_free(response);