]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Allow DTLS to be disabled when reloading.
authorVitezslav Novy <a1@vnovy.net>
Sun, 26 Feb 2017 16:09:29 +0000 (17:09 +0100)
committerJoshua Colp <jcolp@digium.com>
Mon, 27 Feb 2017 19:03:24 +0000 (13:03 -0600)
This change fixes a problem where removing the DTLS configuration
options and reloading would not disable DTLS. This occurred
because the DTLS configuration was not reset to an unconfigured
state on reload.

ASTERISK-26313

Change-Id: I10952709cc4a7727fb50534b042bce9d64894b39

channels/chan_sip.c

index 77ea5f2a29232fdf2a1dc8d11e34fa1fd0a58711..9a5d6c5e3a550c13ce0e992b78ef7169c95db372 100644 (file)
@@ -31104,6 +31104,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v_head
                        firstpass = 0;
                } else {
                        ast_format_cap_remove_by_type(peer->caps, AST_MEDIA_TYPE_UNKNOWN);
+                       ast_rtp_dtls_cfg_free(&peer->dtls_cfg);
+                       memset(&peer->dtls_cfg, 0, sizeof(peer->dtls_cfg));
                }
        } else {
                if (!(peer = ao2_t_alloc(sizeof(*peer), sip_destroy_peer_fn, "allocate a peer struct"))) {