]> 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:44 +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 6872dc6121a6332f2f7268a6fa94b2eeffdf3316..78c0bb3973d4a2c52bd4af8eff41d743ae6c89bd 100644 (file)
@@ -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;