[svn-commits] twilson: branch twilson/calendaring r189273 - in /team/twilson/calendaring: i...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sun Apr 19 21:33:31 CDT 2009
Author: twilson
Date: Sun Apr 19 21:33:24 2009
New Revision: 189273
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=189273
Log:
Convert main/calendar.c to res/res_calendar.c
Added:
team/twilson/calendaring/res/res_calendar.c (contents, props changed)
- copied, changed from r189272, team/twilson/calendaring/main/calendar.c
team/twilson/calendaring/res/res_calendar.exports (with props)
Removed:
team/twilson/calendaring/main/calendar.c
Modified:
team/twilson/calendaring/include/asterisk/_private.h
team/twilson/calendaring/main/Makefile
team/twilson/calendaring/main/asterisk.c
team/twilson/calendaring/main/asterisk.exports
team/twilson/calendaring/main/loader.c
Modified: team/twilson/calendaring/include/asterisk/_private.h
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/include/asterisk/_private.h?view=diff&rev=189273&r1=189272&r2=189273
==============================================================================
--- team/twilson/calendaring/include/asterisk/_private.h (original)
+++ team/twilson/calendaring/include/asterisk/_private.h Sun Apr 19 21:33:24 2009
@@ -42,8 +42,6 @@
int ast_indications_init(void); /*!< Provided by indications.c */
int ast_indications_reload(void);/*!< Provided by indications.c */
void ast_stun_init(void); /*!< Provided by stun.c */
-int ast_calendar_init(void); /*!< Provided by calendar.c */
-int ast_calendar_reload(void); /*!< Provided by calendar.c */
/*!
* \brief Reload asterisk modules.
Modified: team/twilson/calendaring/main/Makefile
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/main/Makefile?view=diff&rev=189273&r1=189272&r2=189273
==============================================================================
--- team/twilson/calendaring/main/Makefile (original)
+++ team/twilson/calendaring/main/Makefile Sun Apr 19 21:33:24 2009
@@ -29,7 +29,7 @@
strcompat.o threadstorage.o dial.o event.o adsistub.o audiohook.o \
astobj2.o hashtab.o global_datastores.o version.o \
features.o taskprocessor.o timing.o datastore.o xml.o xmldoc.o \
- strings.o bridging.o poll.o rtp_engine.o stun.o calendar.o
+ strings.o bridging.o poll.o rtp_engine.o stun.o
# we need to link in the objects statically, not as a library, because
# otherwise modules will not have them available if none of the static
Modified: team/twilson/calendaring/main/asterisk.c
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/main/asterisk.c?view=diff&rev=189273&r1=189272&r2=189273
==============================================================================
--- team/twilson/calendaring/main/asterisk.c (original)
+++ team/twilson/calendaring/main/asterisk.c Sun Apr 19 21:33:24 2009
@@ -3617,11 +3617,6 @@
exit(1);
}
- if (ast_calendar_init()) {
- printf("%s", term_quit());
- exit(1);
- }
-
if (load_modules(0)) {
printf("%s", term_quit());
exit(1);
Modified: team/twilson/calendaring/main/asterisk.exports
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/main/asterisk.exports?view=diff&rev=189273&r1=189272&r2=189273
==============================================================================
--- team/twilson/calendaring/main/asterisk.exports (original)
+++ team/twilson/calendaring/main/asterisk.exports Sun Apr 19 21:33:24 2009
@@ -28,7 +28,6 @@
devstate2str;
__manager_event;
dialed_interface_info;
- calendar_config;
local:
*;
};
Modified: team/twilson/calendaring/main/loader.c
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/main/loader.c?view=diff&rev=189273&r1=189272&r2=189273
==============================================================================
--- team/twilson/calendaring/main/loader.c (original)
+++ team/twilson/calendaring/main/loader.c Sun Apr 19 21:33:24 2009
@@ -248,7 +248,6 @@
{ "dsp", ast_dsp_reload},
{ "udptl", ast_udptl_reload },
{ "indications", ast_indications_reload },
- { "calendar", ast_calendar_reload },
{ NULL, NULL }
};
Copied: team/twilson/calendaring/res/res_calendar.c (from r189272, team/twilson/calendaring/main/calendar.c)
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/res/res_calendar.c?view=diff&rev=189273&p1=team/twilson/calendaring/main/calendar.c&r1=189272&p2=team/twilson/calendaring/res/res_calendar.c&r2=189273
==============================================================================
--- team/twilson/calendaring/main/calendar.c (original)
+++ team/twilson/calendaring/res/res_calendar.c Sun Apr 19 21:33:24 2009
@@ -1456,7 +1456,7 @@
return cal->pending_deletion ? CMP_MATCH : 0;
}
-int ast_calendar_reload()
+static int reload(void)
{
struct ast_calendar_tech *iter;
@@ -1506,7 +1506,32 @@
return NULL;
}
-int ast_calendar_init()
+static int unload_module(void)
+{
+ struct ast_calendar_tech *tech;
+
+ ast_devstate_prov_del("calendar");
+ ast_custom_function_unregister(&calendar_busy_function);
+ ast_custom_function_unregister(&calendar_event_function);
+ ast_custom_function_unregister(&calendar_query_function);
+ ast_custom_function_unregister(&calendar_query_result_function);
+ ast_custom_function_unregister(&calendar_write_function);
+ ast_cli_unregister_multiple(calendar_cli, ARRAY_LEN(calendar_cli));
+
+ /* Remove all calendars */
+ ao2_callback(calendars, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
+
+ AST_LIST_LOCK(&techs);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&techs, tech, list) {
+ ast_unload_resource(tech->module, 0);
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&techs);
+
+ return 0;
+}
+
+static int load_module(void)
{
if (load_config(NULL)) {
/* We don't have calendar support enabled */
@@ -1531,14 +1556,19 @@
ast_log(LOG_ERROR, "Unable to start refresh thread--notifications disabled!\n");
}
- __ast_custom_function_register(&calendar_busy_function, NULL);
- __ast_custom_function_register(&calendar_event_function, NULL);
- __ast_custom_function_register(&calendar_query_function, NULL);
- __ast_custom_function_register(&calendar_query_result_function, NULL);
- __ast_custom_function_register(&calendar_write_function, NULL);
+ ast_custom_function_register(&calendar_busy_function);
+ ast_custom_function_register(&calendar_event_function);
+ ast_custom_function_register(&calendar_query_function);
+ ast_custom_function_register(&calendar_query_result_function);
+ ast_custom_function_register(&calendar_write_function);
ast_cli_register_multiple(calendar_cli, ARRAY_LEN(calendar_cli));
ast_devstate_prov_add("Calendar", calendarstate);
return 0;
}
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Asterisk Calendar integration",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Propchange: team/twilson/calendaring/res/res_calendar.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/twilson/calendaring/res/res_calendar.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/twilson/calendaring/res/res_calendar.c
------------------------------------------------------------------------------
svn:mergeinfo =
Propchange: team/twilson/calendaring/res/res_calendar.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/twilson/calendaring/res/res_calendar.exports
URL: http://svn.digium.com/svn-view/asterisk/team/twilson/calendaring/res/res_calendar.exports?view=auto&rev=189273
==============================================================================
--- team/twilson/calendaring/res/res_calendar.exports (added)
+++ team/twilson/calendaring/res/res_calendar.exports Sun Apr 19 21:33:24 2009
@@ -1,0 +1,7 @@
+{
+ global:
+ ast_*;
+ calendar_config;
+ local:
+ *;
+};
Propchange: team/twilson/calendaring/res/res_calendar.exports
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/twilson/calendaring/res/res_calendar.exports
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/twilson/calendaring/res/res_calendar.exports
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the svn-commits
mailing list