]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: On partial transport reload also move factories.
authorJoshua C. Colp <jcolp@sangoma.com>
Mon, 24 May 2021 18:38:26 +0000 (15:38 -0300)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 26 May 2021 16:31:29 +0000 (11:31 -0500)
For connection oriented transports PJSIP uses factories to
produce transports. When doing a partial transport reload
we need to also move the factory of the transport over so
that anything referencing the transport (such as an endpoint)
has the factory available.

ASTERISK-29441

Change-Id: Ieae0fb98eab2d9257cad996a1136e5a62d307161

res/res_pjsip/config_transport.c

index 98fc34fd5388cb1c1550a861f2a89b6094566e0c..fb3bdb6091048ef300fdd7772ce5618fd0952fb4 100644 (file)
@@ -559,6 +559,8 @@ static int transport_apply(const struct ast_sorcery *sorcery, void *obj)
                ast_log(LOG_WARNING, "Transport '%s' is not fully reloadable, not reloading: protocol, bind, TLS, TCP, ToS, or CoS options.\n", transport_id);
                temp_state->state->transport = perm_state->state->transport;
                perm_state->state->transport = NULL;
+               temp_state->state->factory = perm_state->state->factory;
+               perm_state->state->factory = NULL;
                res = PJ_SUCCESS;
        } else if (transport->type == AST_TRANSPORT_UDP) {
                for (i = 0; i < BIND_TRIES && res != PJ_SUCCESS; i++) {