res_calendar_icalendar: Print iCalendar error on parsing failure.

If libical fails to parse a calendar, print the error message it provdes.

Resolves: #492
This commit is contained in:
Naveen Albert 2023-12-14 09:43:14 -05:00
parent f541f8d8c4
commit 8eb6a329d6
1 changed files with 4 additions and 0 deletions

View File

@ -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);