]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Clear ToHost property on peer when changing to dynamic host
authorDennis Buteyn <dennis.buteyn@xorcom.com>
Tue, 18 Feb 2020 12:30:31 +0000 (14:30 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 18 Aug 2020 14:01:15 +0000 (09:01 -0500)
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

index d57ef5de5ceceea7daef5e485307e60751ec6319..35f44602709b37e652cd77938073434302207896 100644 (file)
@@ -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;