]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Always set async_operations to 1.
authorJoshua C. Colp <jcolp@sangoma.com>
Wed, 6 Apr 2022 10:23:27 +0000 (07:23 -0300)
committerJoshua Colp <jcolp@sangoma.com>
Tue, 26 Apr 2022 16:31:34 +0000 (11:31 -0500)
The async_operations setting on a transport configures how
many simultaneous incoming packets the transport can handle
when multiple threads are polling and waiting on the transport.
As we only use a single thread this was needlessly creating
incoming packets when set to a non-default value, wasting memory.

ASTERISK-30006

Change-Id: I1915973ef352862dc2852a6ba4cfce2ed536e68f

configs/samples/pjsip.conf.sample
doc/UPGRADE-staging/res_pjsip_async_operations.txt [new file with mode: 0644]
res/res_pjsip/config_transport.c
res/res_pjsip/pjsip_config.xml

index b1c1657ff7007e925ef231bedec4844cfa3c2fa7..2d93bd1276409cc406f03afe459363b28e04be1e 100644 (file)
 ;[transport]
 ;  SYNOPSIS: SIP Transport
 ;
-;async_operations=1     ; Number of simultaneous Asynchronous Operations
-                        ; (default: "1")
 ;bind=  ; IP Address and optional port to bind to for this transport (default:
         ; "")
 ; Note that for the Websocket transport the TLS configuration is configured
diff --git a/doc/UPGRADE-staging/res_pjsip_async_operations.txt b/doc/UPGRADE-staging/res_pjsip_async_operations.txt
new file mode 100644 (file)
index 0000000..cf9f942
--- /dev/null
@@ -0,0 +1,7 @@
+Subject: res_pjsip
+
+The 'async_operations' setting on transports is no longer
+obeyed and instead is always set to 1. This is due to the
+functionality not being applicable to Asterisk and causing
+excess unnecessary memory usage. This setting will now be
+ignored but can also be removed from the configuration file.
index d0a28cd04c82a194dfeb2581c97eaff6e7abe583..6319ecfafb1c259da73cb6e4fd41d2977b6ec2b5 100644 (file)
@@ -659,6 +659,12 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj)
                return -1;
        }
 
+       if (transport->async_operations != 1) {
+               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",
+                       transport_id, transport->async_operations);
+               transport->async_operations = 1;
+       }
+
        perm_state = find_internal_state_by_transport(transport);
        if (perm_state) {
                ast_sorcery_diff(sorcery, perm_state->transport, transport, &changes);
index ca5a266849ee626d4d564bfc693de09206492aa8..9a9ef485bc6f473bd55810494a27a585f5029193 100644 (file)
                                                will not suffice.</para></note>
                                </description>
                                <configOption name="async_operations" default="1">
-                                       <synopsis>Number of simultaneous Asynchronous Operations</synopsis>
+                                       <synopsis>Number of simultaneous Asynchronous Operations, can no longer be set, always set to 1</synopsis>
                                </configOption>
                                <configOption name="bind">
                                        <synopsis>IP Address and optional port to bind to for this transport</synopsis>