From 9c6d14b26b80c3288e09302328c7c3682244b62c Mon Sep 17 00:00:00 2001 From: Dennis Buteyn Date: Tue, 18 Feb 2020 14:30:31 +0200 Subject: [PATCH] chan_sip: Clear ToHost property on peer when changing to dynamic host The ToHost parameter was not cleared when a peer's host value was changed to dynamic. This causes invites to be sent to the original host. ASTERISK-29011 #close Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c --- channels/chan_sip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index d57ef5de5c..35f4460270 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -31907,6 +31907,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v_head if ((!found && !ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS)) || !peer->host_dynamic) { /* Initialize stuff if this is a new peer, or if it used to * not be dynamic before the reload. */ + ast_string_field_set(peer, tohost, NULL); ast_sockaddr_setnull(&peer->addr); } peer->host_dynamic = TRUE; -- 2.47.2