diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-26 14:39:36 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-26 14:39:36 +0000 |
commit | be8677b3a0f6a773db6855464d9385be43d7a9ec (patch) | |
tree | 95ff26ddb1619bc8f2c8ba8487618e78055743e5 | |
parent | 9840532e7a1a602f491d4bd9b10a5f10818d9976 (diff) |
Issue 5898: Registrations does not get deleted if there's an active SIP dialog
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@8710 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 80c2df5ce..55faa79ec 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13001,6 +13001,19 @@ static int sip_do_reload(void) clear_sip_domains(); authl = NULL; + /* First, destroy all outstanding registry calls */ + /* This is needed, since otherwise active registry entries will not be destroyed */ + ASTOBJ_CONTAINER_TRAVERSE(®l, 1, do { + ASTOBJ_RDLOCK(iterator); + if (iterator->call) { + if (option_debug > 2) + ast_log(LOG_DEBUG, "Destroying active SIP dialog for registry %s@%s\n", iterator->username, iterator->hostname); + /* This will also remove references to the registry */ + sip_destroy(iterator->call); + } + ASTOBJ_UNLOCK(iterator); + } while(0)); + ASTOBJ_CONTAINER_DESTROYALL(&userl, sip_destroy_user); ASTOBJ_CONTAINER_DESTROYALL(®l, sip_registry_destroy); ASTOBJ_CONTAINER_MARKALL(&peerl); |