res_calendar_icalendar: Send user agent in request.

Microsoft recently began rejecting all requests for
ICS calendars on Office 365 with 400 errors if
the request doesn't contain a user agent. See:

https://docs.microsoft.com/en-us/answers/questions/883904/34the-remote-server-returned-an-error-400-bad-requ.html

Accordingly, we now send a user agent on requests for
ICS files so that requests to Office 365 will work as
they did before.

ASTERISK-30106

Change-Id: Ie9dcaef12ae8adf37533c684499eb11005fac8f7
This commit is contained in:
Naveen Albert 2022-06-20 21:00:17 +00:00 committed by Kevin Harwell
parent 57d66966a1
commit 53d921a199
1 changed files with 1 additions and 0 deletions

View File

@ -465,6 +465,7 @@ static void *ical_load_calendar(void *void_data)
pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port);
ne_redirect_register(pvt->session);
ne_set_server_auth(pvt->session, auth_credentials, pvt);
ne_set_useragent(pvt->session, "Asterisk");
if (!strcasecmp(pvt->uri.scheme, "https")) {
ne_ssl_trust_default_ca(pvt->session);
}