[Asterisk-code-review] res_pjsip: set Accept-Encoding to identity in OPTIONS response (asterisk[16])

Friendly Automation asteriskteam at digium.com
Thu Nov 19 13:38:28 CST 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15177 )

Change subject: res_pjsip: set Accept-Encoding to identity in OPTIONS response
......................................................................

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
---
M res/res_pjsip/pjsip_options.c
M res/res_pjsip_dlg_options.c
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Sean Bright: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit



diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 579165f..e1f048e 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 5c1da53..d073734 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)
 {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15177
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I0aa2211ebf0b4c2ed554ac7cda794523803a3840
Gerrit-Change-Number: 15177
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Greiner-Baer <alex+asterisk at greiner-baer.de>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-CC: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201119/8d525494/attachment.html>


More information about the asterisk-code-review mailing list