<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18425">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Always set async_operations to 1.<br><br>The async_operations setting on a transport configures how<br>many simultaneous incoming packets the transport can handle<br>when multiple threads are polling and waiting on the transport.<br>As we only use a single thread this was needlessly creating<br>incoming packets when set to a non-default value, wasting memory.<br><br>ASTERISK-30006<br><br>Change-Id: I1915973ef352862dc2852a6ba4cfce2ed536e68f<br>---<br>M configs/samples/pjsip.conf.sample<br>A doc/UPGRADE-staging/res_pjsip_async_operations.txt<br>M res/res_pjsip/config_transport.c<br>M res/res_pjsip/pjsip_config.xml<br>4 files changed, 14 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample</span><br><span>index b1c1657..2d93bd1 100644</span><br><span>--- a/configs/samples/pjsip.conf.sample</span><br><span>+++ b/configs/samples/pjsip.conf.sample</span><br><span>@@ -1025,8 +1025,6 @@</span><br><span> ;[transport]</span><br><span> ;  SYNOPSIS: SIP Transport</span><br><span> ;</span><br><span style="color: hsl(0, 100%, 40%);">-;async_operations=1     ; Number of simultaneous Asynchronous Operations</span><br><span style="color: hsl(0, 100%, 40%);">-                        ; (default: "1")</span><br><span> ;bind=  ; IP Address and optional port to bind to for this transport (default:</span><br><span>         ; "")</span><br><span> ; Note that for the Websocket transport the TLS configuration is configured</span><br><span>diff --git a/doc/UPGRADE-staging/res_pjsip_async_operations.txt b/doc/UPGRADE-staging/res_pjsip_async_operations.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..cf9f942</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/res_pjsip_async_operations.txt</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: res_pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The 'async_operations' setting on transports is no longer</span><br><span style="color: hsl(120, 100%, 40%);">+obeyed and instead is always set to 1. This is due to the</span><br><span style="color: hsl(120, 100%, 40%);">+functionality not being applicable to Asterisk and causing</span><br><span style="color: hsl(120, 100%, 40%);">+excess unnecessary memory usage. This setting will now be</span><br><span style="color: hsl(120, 100%, 40%);">+ignored but can also be removed from the configuration file.</span><br><span>diff --git a/res/res_pjsip/config_transport.c b/res/res_pjsip/config_transport.c</span><br><span>index d0a28cd..6319ecf 100644</span><br><span>--- a/res/res_pjsip/config_transport.c</span><br><span>+++ b/res/res_pjsip/config_transport.c</span><br><span>@@ -659,6 +659,12 @@</span><br><span>              return -1;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (transport->async_operations != 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_log(LOG_WARNING, "The async_operations setting on transport '%s' has been set to '%d'. The setting can no longer be set and is always 1.\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                    transport_id, transport->async_operations);</span><br><span style="color: hsl(120, 100%, 40%);">+                transport->async_operations = 1;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  perm_state = find_internal_state_by_transport(transport);</span><br><span>    if (perm_state) {</span><br><span>            ast_sorcery_diff(sorcery, perm_state->transport, transport, &changes);</span><br><span>diff --git a/res/res_pjsip/pjsip_config.xml b/res/res_pjsip/pjsip_config.xml</span><br><span>index ca5a266..9a9ef48 100644</span><br><span>--- a/res/res_pjsip/pjsip_config.xml</span><br><span>+++ b/res/res_pjsip/pjsip_config.xml</span><br><span>@@ -1622,7 +1622,7 @@</span><br><span>                                           will not suffice.</para></note></span><br><span>                          </description></span><br><span>                                 <configOption name="async_operations" default="1"></span><br><span style="color: hsl(0, 100%, 40%);">-                                    <synopsis>Number of simultaneous Asynchronous Operations</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <synopsis>Number of simultaneous Asynchronous Operations, can no longer be set, always set to 1</synopsis></span><br><span>                               </configOption></span><br><span>                                <configOption name="bind"></span><br><span>                                   <synopsis>IP Address and optional port to bind to for this transport</synopsis></span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18425">change 18425</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/+/18425"/><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: I1915973ef352862dc2852a6ba4cfce2ed536e68f </div>
<div style="display:none"> Gerrit-Change-Number: 18425 </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-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>