chan_sip: Allow DTLS to be disabled when reloading.

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
This commit is contained in:
Vitezslav Novy
2017-02-26 17:09:29 +01:00
committed by Joshua Colp
parent 9d3ab062cc
commit d91f61f0b5

View File

@@ -31104,6 +31104,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v_head
firstpass = 0; firstpass = 0;
} else { } else {
ast_format_cap_remove_by_type(peer->caps, AST_MEDIA_TYPE_UNKNOWN); 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 { } else {
if (!(peer = ao2_t_alloc(sizeof(*peer), sip_destroy_peer_fn, "allocate a peer struct"))) { if (!(peer = ao2_t_alloc(sizeof(*peer), sip_destroy_peer_fn, "allocate a peer struct"))) {