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

Friendly Automation asteriskteam at digium.com
Tue Aug 18 10:49:53 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14766 )

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
  Friendly Automation: Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6872dc6..78c0bb3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -31903,6 +31903,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/+/14766
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c
Gerrit-Change-Number: 14766
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/20200818/5452da3a/attachment.html>


More information about the asterisk-code-review mailing list