From: Alexander Greiner-Baer Date: Tue, 17 Nov 2020 20:19:35 +0000 (+0100) Subject: res_pjsip: set Accept-Encoding to identity in OPTIONS response X-Git-Tag: 18.2.0-rc1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c79bd583d99b60cf16185333088658c9add54460;p=thirdparty%2Fasterisk.git res_pjsip: set Accept-Encoding to identity in OPTIONS response RFC 3261 says that the Accept-Encoding header should be present in an options response. Permitted values according to RFC 2616 are only compression algorithms like gzip or the default identity encoding. Therefore "text/plain" is not a correct value here. As long as the header is hard coded, it should be set to "identity". Without this fix an Alcatel OmniPCX periodically logs warnings like "[sip_acceptIncorrectHeader] Header Accept-Encoding is malformed" on a SIP Trunk. ASTERISK-29165 #close Change-Id: I0aa2211ebf0b4c2ed554ac7cda794523803a3840 --- diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index 579165fdde..e1f048e9a6 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -94,7 +94,7 @@ */ #define DEFAULT_LANGUAGE "en" -#define DEFAULT_ENCODING "text/plain" +#define DEFAULT_ENCODING "identity" /*! \brief These are the number of buckets to store AORs in */ #ifdef LOW_MEMORY diff --git a/res/res_pjsip_dlg_options.c b/res/res_pjsip_dlg_options.c index 5c1da53583..d07373495f 100644 --- a/res/res_pjsip_dlg_options.c +++ b/res/res_pjsip_dlg_options.c @@ -34,7 +34,7 @@ #include "asterisk/res_pjsip_session.h" #define DEFAULT_LANGUAGE "en" -#define DEFAULT_ENCODING "text/plain" +#define DEFAULT_ENCODING "identity" static int options_incoming_request(struct ast_sip_session *session, pjsip_rx_data *rdata) {