typedef void (*switch_event_callback_t) (switch_event_t *);
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *, switch_caller_profile_t *);
+#define SWITCH_STANDARD_DIALPLAN(name) static switch_caller_extension_t * name (switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+
typedef struct switch_scheduler_task switch_scheduler_task_t;
}
-static switch_caller_extension_t *enum_dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(enum_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
enum_record_t *results, *rp;
switch_xml_free(xml);
}
-static switch_caller_extension_t *directory_dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(directory_dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
}
-static switch_dialplan_interface_t directory_dialplan_interface = {
- /*.interface_name = */ "directory",
- /*.hunt_function = */ directory_dialplan_hunt
- /*.next = NULL */
-};
-
-static switch_loadable_module_interface_t directory_dialplan_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ &directory_dialplan_interface,
- /*.codec_interface = */ NULL,
- /*.application_interface = */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load)
{
+ switch_dialplan_interface_t *dp_interface;
load_config();
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &directory_dialplan_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_DIALPLAN(dp_interface, "directory", directory_dialplan_hunt);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
return status;
}
-static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session, void *arg, switch_caller_profile_t *caller_profile)
+SWITCH_STANDARD_DIALPLAN(dialplan_hunt)
{
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
return extension;
}
-
-static switch_dialplan_interface_t dialplan_interface = {
- /*.interface_name = */ "XML",
- /*.hunt_function = */ dialplan_hunt
- /*.next = NULL */
-};
-
-static switch_loadable_module_interface_t dialplan_module_interface = {
- /*.module_name = */ modname,
- /*.endpoint_interface = */ NULL,
- /*.timer_interface = */ NULL,
- /*.dialplan_interface = */ &dialplan_interface,
- /*.codec_interface = */ NULL,
- /*.application_interface = */ NULL
-};
-
SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load)
{
+ switch_dialplan_interface_t *dp_interface;
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &dialplan_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_DIALPLAN(dp_interface, "XML", dialplan_hunt);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;