Skip to content

Commit

Permalink
res_calendar_icalendar: Send user agent in request.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
InterLinked1 authored and Friendly Automation committed Jun 30, 2022
1 parent 0f0cc43 commit e5553fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions res/res_calendar_icalendar.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit e5553fb

Please sign in to comment.