res |= ast_unregister_application(rapp);
if ((con = ast_context_find("app_dial_gosub_virtual_context")))
+ {
ast_context_remove_extension2(con, "s", 1, NULL);
-
+ ast_context_destroy(con, "app_dial"); /* leave nothing behind */
+ }
+
return res;
}
if ((con = ast_context_find("app_queue_gosub_virtual_context"))) {
ast_context_remove_extension2(con, "s", 1, NULL);
+ ast_context_destroy(con, "app_queue"); /* leave no trace */
}
clear_and_free_interfaces();
static int __unload_module(void)
{
struct iax2_thread *thread = NULL;
+ struct ast_context *con;
int x;
/* Make sure threads do not hold shared resources when they are canceled */
ao2_ref(peers, -1);
ao2_ref(users, -1);
-
+
+ con = ast_context_find(regcontext);
+ if (con)
+ ast_context_destroy(con, "IAX2");
+
return 0;
}
* a bridged channel on hold */
static int default_maxcallbitrate; /*!< Maximum bitrate for call */
static struct ast_codec_pref default_prefs; /*!< Default codec prefs */
+static char used_context[AST_MAX_CONTEXT]; /*!< name of automatically created context for unloading */
/*! \brief a place to store all global settings for the sip channel driver */
struct sip_settings {
cleanup_stale_contexts(stringp, oldregcontext);
/* Create contexts if they don't exist already */
while ((context = strsep(&stringp, "&"))) {
+ ast_copy_string(used_context, context, sizeof(used_context));
if (!ast_context_find(context))
ast_context_create(NULL, context,"SIP");
}
static int unload_module(void)
{
struct sip_pvt *p, *pl;
+ struct ast_context *con;
/* First, take us out of the channel type list */
ast_channel_unregister(&sip_tech);
clear_sip_domains();
close(sipsock);
sched_context_destroy(sched);
+ con = ast_context_find(used_context);
+ if (con)
+ ast_context_destroy(con, "SIP");
return 0;
}
static int keep_alive = 120;
static char vmexten[AST_MAX_EXTENSION]; /* Voicemail pilot number */
+static char used_context[AST_MAX_EXTENSION]; /* Voicemail pilot number */
static char regcontext[AST_MAX_CONTEXT]; /* Context for auto-extension */
static char date_format[6] = "D-M-Y";
static char version_id[16] = "P002F202";
cleanup_stale_contexts(stringp, oldregcontext);
/* Create contexts if they don't exist already */
while ((context = strsep(&stringp, "&"))) {
+ ast_copy_string(used_context, context, sizeof(used_context));
if (!ast_context_find(context))
ast_context_create(NULL, context, "Skinny");
}
struct skinny_device *d;
struct skinny_line *l;
struct skinny_subchannel *sub;
+ struct ast_context *con;
ast_mutex_lock(&sessionlock);
/* Destroy all the interfaces and free their memory */
if (sched)
sched_context_destroy(sched);
+ con = ast_context_find(used_context);
+ if (con)
+ ast_context_destroy(con, "Skinny");
+
return 0;
}
static int unload_module(void)
{
+ struct ast_context *con;
ast_manager_unregister("ParkedCalls");
ast_manager_unregister("Bridge");
ast_manager_unregister("Park");
ast_unregister_application(parkcall);
ast_unregister_application(app_bridge);
ast_devstate_prov_del("Park");
+ con = ast_context_find(parking_con);
+ if (con)
+ ast_context_destroy(con, registrar);
+ con = ast_context_find(parking_con_dial);
+ if (con)
+ ast_context_destroy(con, registrar);
return ast_unregister_application(parkedcall);
}