<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14692">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">websocket / pjsip: Increase maximum packet size.<br><br>When dealing with a lot of video streams on WebRTC<br>the resulting SDPS can grow to be quite large. This<br>effectively doubles the maximum size to allow more<br>streams to exist.<br><br>Change-Id: I31d4351d70c8e2c11564807a7528b984f3fbdd01<br>---<br>M res/res_http_websocket.c<br>M res/res_pjsip_pubsub.c<br>M third-party/pjproject/patches/config_site.h<br>3 files changed, 8 insertions(+), 16 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/92/14692/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c</span><br><span>index ffb6dbc..f5fee5a 100644</span><br><span>--- a/res/res_http_websocket.c</span><br><span>+++ b/res/res_http_websocket.c</span><br><span>@@ -63,15 +63,15 @@</span><br><span> #define MAXIMUM_RECONSTRUCTION_CEILING 8192</span><br><span> #else</span><br><span> /*! \brief Size of the pre-determined buffer for WebSocket frames */</span><br><span style="color: hsl(0, 100%, 40%);">-#define MAXIMUM_FRAME_SIZE 32768</span><br><span style="color: hsl(120, 100%, 40%);">+#define MAXIMUM_FRAME_SIZE 65535</span><br><span> </span><br><span> /*! \brief Default reconstruction size for multi-frame payload reconstruction. If exceeded the next frame will start a</span><br><span>  *         payload.</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-#define DEFAULT_RECONSTRUCTION_CEILING 32768</span><br><span style="color: hsl(120, 100%, 40%);">+#define DEFAULT_RECONSTRUCTION_CEILING MAXIMUM_FRAME_SIZE</span><br><span> </span><br><span> /*! \brief Maximum reconstruction size for multi-frame payload reconstruction. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define MAXIMUM_RECONSTRUCTION_CEILING 32768</span><br><span style="color: hsl(120, 100%, 40%);">+#define MAXIMUM_RECONSTRUCTION_CEILING MAXIMUM_FRAME_SIZE</span><br><span> #endif</span><br><span> </span><br><span> /*! \brief Maximum size of a websocket frame header</span><br><span>diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c</span><br><span>index be1eb39..1142bbd 100644</span><br><span>--- a/res/res_pjsip_pubsub.c</span><br><span>+++ b/res/res_pjsip_pubsub.c</span><br><span>@@ -146,8 +146,8 @@</span><br><span>                                     that a server has to process.</para></span><br><span>                                   <note></span><br><span>                                                 <para>Current limitations limit the size of SIP NOTIFY requests that Asterisk sends</span><br><span style="color: hsl(0, 100%, 40%);">-                                               to 64000 bytes. If your resource list notifications are larger than this maximum, you</span><br><span style="color: hsl(0, 100%, 40%);">-                                           will need to make adjustments.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                           to double that of the PJSIP maximum packet length. If your resource list notifications</span><br><span style="color: hsl(120, 100%, 40%);">+                                                are larger than this maximum, you will need to make adjustments.</para></span><br><span>                                        </note></span><br><span>                                </description></span><br><span>                                 <configOption name="type"></span><br><span>@@ -1950,15 +1950,7 @@</span><br><span>  * we instead take the strategy of pre-allocating the buffer, testing for ourselves</span><br><span>  * if the message will fit, and resizing the buffer as required.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * RFC 3261 says that a SIP UDP request can be up to 65535 bytes long. We're capping</span><br><span style="color: hsl(0, 100%, 40%);">- * it at 64000 for a couple of reasons:</span><br><span style="color: hsl(0, 100%, 40%);">- * 1) Allocating more than 64K at a time is hard to justify</span><br><span style="color: hsl(0, 100%, 40%);">- * 2) If the message goes through proxies, those proxies will want to add Via and</span><br><span style="color: hsl(0, 100%, 40%);">- *    Record-Route headers, making the message even larger. Giving some space for</span><br><span style="color: hsl(0, 100%, 40%);">- *    those headers is a nice thing to do.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * RFC 3261 does not place an upper limit on the size of TCP requests, but we are</span><br><span style="color: hsl(0, 100%, 40%);">- * going to impose the same 64K limit as a memory savings.</span><br><span style="color: hsl(120, 100%, 40%);">+ * The limit we impose is double that of the maximum packet length.</span><br><span>  *</span><br><span>  * \param tdata The tdata onto which to allocate a buffer</span><br><span>  * \retval 0 Success</span><br><span>@@ -1970,7 +1962,7 @@</span><br><span>      int size = -1;</span><br><span>       char *buf;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  for (buf_size = PJSIP_MAX_PKT_LEN; size == -1 && buf_size < 64000; buf_size *= 2) {</span><br><span style="color: hsl(120, 100%, 40%);">+        for (buf_size = PJSIP_MAX_PKT_LEN; size == -1 && buf_size < (PJSIP_MAX_PKT_LEN * 2); buf_size *= 2) {</span><br><span>             buf = pj_pool_alloc(tdata->pool, buf_size);</span><br><span>               size = pjsip_msg_print(tdata->msg, buf, buf_size);</span><br><span>        }</span><br><span>diff --git a/third-party/pjproject/patches/config_site.h b/third-party/pjproject/patches/config_site.h</span><br><span>index aea7d0d..5884108 100644</span><br><span>--- a/third-party/pjproject/patches/config_site.h</span><br><span>+++ b/third-party/pjproject/patches/config_site.h</span><br><span>@@ -65,7 +65,7 @@</span><br><span>   Enabling it will result in SEGFAULTS when URIs containing escape sequences are encountered.</span><br><span> */</span><br><span> #undef PJSIP_UNESCAPE_IN_PLACE</span><br><span style="color: hsl(0, 100%, 40%);">-#define PJSIP_MAX_PKT_LEN                        32000</span><br><span style="color: hsl(120, 100%, 40%);">+#define PJSIP_MAX_PKT_LEN                        65535</span><br><span> </span><br><span> #undef PJ_TODO</span><br><span> #define PJ_TODO(x)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14692">change 14692</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14692"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I31d4351d70c8e2c11564807a7528b984f3fbdd01 </div>
<div style="display:none"> Gerrit-Change-Number: 14692 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>