]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_calendar_icalendar: Print iCalendar error on parsing failure.
authorNaveen Albert <asterisk@phreaknet.org>
Thu, 14 Dec 2023 14:43:14 +0000 (09:43 -0500)
committerNaveen Albert <asterisk@phreaknet.org>
Tue, 23 Jan 2024 18:18:53 +0000 (18:18 +0000)
If libical fails to parse a calendar, print the error message it provdes.

Resolves: #492

res/res_calendar_icalendar.c

index 29be671d359b40285bf1bdeccc94b6e0b0e8016d..95790e5d0843d85c675683a2dfdb9b6a8cb6d8f4 100644 (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);