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
This commit is contained in:
Dennis Buteyn
2020-02-18 14:30:31 +02:00
committed by George Joseph
parent 53f9bbdc2d
commit 56f446482b

View File

@@ -31660,6 +31660,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;