diff --git a/res/res_calendar.c b/res/res_calendar.c index dfae4985a3..eebd7b480e 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -775,7 +775,10 @@ static void *do_notify(void *data) datastore->inheritance = DATASTORE_INHERIT_FOREVER; ao2_ref(event, +1); + + ast_channel_lock(chan); res = ast_channel_datastore_add(chan, datastore); + ast_channel_unlock(chan); if (!(tmpstr = ast_str_create(32))) { goto notify_cleanup;