refactor earlier junk from this eve and add ken's propagate variable thing

set this sometime before an origination (bridge etc).

<action application="set" data="propagate_vars=my_cool_var1,my_cool_var2,foo,bar"/>

and they should be cloned over to the new channel when it's substantiated



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3101 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-10-19 07:13:34 +00:00
parent 80f91a5824
commit 99e22d69bd
7 changed files with 169 additions and 94 deletions

View File

@@ -52,6 +52,7 @@ struct switch_loadable_module_container {
switch_hash_t *file_hash;
switch_hash_t *speech_hash;
switch_hash_t *directory_hash;
switch_hash_t *chat_hash;
switch_memory_pool_t *pool;
};
@@ -230,6 +231,20 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
switch_core_hash_insert(loadable_modules.directory_hash, (char *) ptr->interface_name, (void *) ptr);
}
}
if (new_module->module_interface->chat_interface) {
const switch_chat_interface_t *ptr;
for (ptr = new_module->module_interface->chat_interface; ptr; ptr = ptr->next) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Chat interface '%s'\n", ptr->interface_name);
if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "type", "chat");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "name", "%s", ptr->interface_name);
switch_event_fire(&event);
}
switch_core_hash_insert(loadable_modules.chat_hash, (char *) ptr->interface_name, (void *) ptr);
}
}
return SWITCH_STATUS_SUCCESS;
@@ -476,6 +491,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
switch_core_hash_init(&loadable_modules.file_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.speech_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.directory_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.chat_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.dialplan_hash, loadable_modules.pool);
if ((xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
@@ -637,6 +653,11 @@ SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_direct
return switch_core_hash_find(loadable_modules.directory_hash, name);
}
SWITCH_DECLARE(switch_chat_interface_t *) switch_loadable_module_get_chat_interface(char *name)
{
return switch_core_hash_find(loadable_modules.chat_hash, name);
}
SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, const switch_codec_implementation_t **array,
int arraylen)
{