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
pull/29/head
Dennis Buteyn 5 years ago committed by George Joseph
parent 647c53c41f
commit aab666bb9d

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

Loading…
Cancel
Save