aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-16 18:21:17 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-16 18:21:17 +0000
commitcc5a982e471db6b9a89893d1b723b112db6818d6 (patch)
tree798d41fb6fd6899d0ae29f51274eaa6d219cf35f /channels/chan_sip.c
parent2e2393c80cab9770df9e8999372276d5988741a2 (diff)
Merged revisions 319204 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r319204 | twilson | 2011-05-16 13:17:43 -0500 (Mon, 16 May 2011) | 11 lines Merged revisions 319202 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r319202 | twilson | 2011-05-16 11:00:21 -0700 (Mon, 16 May 2011) | 4 lines Unlink a peer from peers_by_ip when expiring a registration Review: https://reviewboard.asterisk.org/r/1218/ ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@319212 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e15eb7469..0aa13505a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13398,6 +13398,11 @@ static int expire_register(const void *data)
if (peer->selfdestruct ||
ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
unlink_peer_from_tables(peer);
+ } else if (!ast_sockaddr_isnull(&peer->addr)) {
+ /* If we aren't self-destructing a temp_peer, we still need to unlink the peer
+ * from the peers_by_ip table, otherwise we end up with multiple copies hanging
+ * around each time a registration expires and the peer re-registers. */
+ ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
}
/* Only clear the addr after we check for destruction. The addr must remain