summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2007-12-13 00:18:04 +0000
committerJason Parker <jparker@digium.com>2007-12-13 00:18:04 +0000
commit78465ad2a35ef7d5eae23bbd3480492d5c35a6e9 (patch)
tree00870dc3ef56b770fbdb2955b062a1b51edd9980 /channels/chan_sip.c
parent44fc07ee636850dd960e402a77f0d497a9b56cad (diff)
Merged revisions 92696 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10690) ........ r92696 | qwell | 2007-12-12 18:11:09 -0600 (Wed, 12 Dec 2007) | 7 lines If a typo is found in a config file, we previous continued on with what was already loaded. We do not want to do this (see bug below for details). This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded. Issue 10690. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 19d3dba73..46c3b56aa 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -18201,6 +18201,36 @@ static int reload_config(enum channelreloadreason reason)
ASTOBJ_CONTAINER_MARKALL(&peerl);
}
+ if (option_debug > 3)
+ ast_log(LOG_DEBUG, "--------------- SIP reload started\n");
+
+ clear_realm_authentication(authl);
+ 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(&regl, 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));
+
+ /* Then, actually destroy users and registry */
+ ASTOBJ_CONTAINER_DESTROYALL(&userl, sip_destroy_user);
+ if (option_debug > 3)
+ ast_log(LOG_DEBUG, "--------------- Done destroying user list\n");
+ ASTOBJ_CONTAINER_DESTROYALL(&regl, sip_registry_destroy);
+ if (option_debug > 3)
+ ast_log(LOG_DEBUG, "--------------- Done destroying registry list\n");
+ ASTOBJ_CONTAINER_MARKALL(&peerl);
+
/* Initialize copy of current global_regcontext for later use in removing stale contexts */
ast_copy_string(oldcontexts, global_regcontext, sizeof(oldcontexts));
oldregcontext = oldcontexts;