[Asterisk-code-review] chan_sip: Clear ToHost property on peer when changing to dynamic host (asterisk[16])

George Joseph asteriskteam at digium.com
Wed Aug 19 07:28:29 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14765 )

Change subject: chan_sip: Clear ToHost property on peer when changing to dynamic host
......................................................................

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
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d57ef5d..35f4460 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -31907,6 +31907,7 @@
 					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;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14765
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c
Gerrit-Change-Number: 14765
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Dennis <dennis.buteyn at xorcom.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200819/39942d2a/attachment.html>


More information about the asterisk-code-review mailing list