mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
added zap_global_add_io_interface
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@867 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
e0d41a722c
commit
c332cceb0d
@ -737,6 +737,7 @@ OZ_DECLARE(zap_status_t) zap_configure_span(const char *type, zap_span_t *span,
|
|||||||
OZ_DECLARE(zap_status_t) zap_span_start(zap_span_t *span);
|
OZ_DECLARE(zap_status_t) zap_span_start(zap_span_t *span);
|
||||||
OZ_DECLARE(zap_status_t) zap_span_stop(zap_span_t *span);
|
OZ_DECLARE(zap_status_t) zap_span_stop(zap_span_t *span);
|
||||||
OZ_DECLARE(char *) zap_build_dso_path(const char *name, char *path, zap_size_t len);
|
OZ_DECLARE(char *) zap_build_dso_path(const char *name, char *path, zap_size_t len);
|
||||||
|
OZ_DECLARE(zap_status_t) zap_global_add_io_interface(zap_io_interface_t *io_interface);
|
||||||
OZ_DECLARE(int) zap_load_module(const char *name);
|
OZ_DECLARE(int) zap_load_module(const char *name);
|
||||||
OZ_DECLARE(int) zap_load_module_assume(const char *name);
|
OZ_DECLARE(int) zap_load_module_assume(const char *name);
|
||||||
OZ_DECLARE(zap_status_t) zap_span_find_by_name(const char *name, zap_span_t **span);
|
OZ_DECLARE(zap_status_t) zap_span_find_by_name(const char *name, zap_span_t **span);
|
||||||
|
@ -2604,6 +2604,19 @@ OZ_DECLARE(char *) zap_build_dso_path(const char *name, char *path, zap_size_t l
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OZ_DECLARE(zap_status_t) zap_global_add_io_interface(zap_io_interface_t *interface1)
|
||||||
|
{
|
||||||
|
zap_status_t ret = ZAP_SUCCESS;
|
||||||
|
zap_mutex_lock(globals.mutex);
|
||||||
|
if (hashtable_search(globals.interface_hash, (void *)interface1->name)) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Interface %s already loaded!\n", interface1->name);
|
||||||
|
} else {
|
||||||
|
hashtable_insert(globals.interface_hash, (void *)interface1->name, interface1, HASHTABLE_FLAG_NONE);
|
||||||
|
}
|
||||||
|
zap_mutex_unlock(globals.mutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
OZ_DECLARE(int) zap_load_module(const char *name)
|
OZ_DECLARE(int) zap_load_module(const char *name)
|
||||||
{
|
{
|
||||||
zap_dso_lib_t lib;
|
zap_dso_lib_t lib;
|
||||||
@ -2633,15 +2646,10 @@ OZ_DECLARE(int) zap_load_module(const char *name)
|
|||||||
zap_log(ZAP_LOG_ERROR, "Error loading %s\n", path);
|
zap_log(ZAP_LOG_ERROR, "Error loading %s\n", path);
|
||||||
} else {
|
} else {
|
||||||
zap_log(ZAP_LOG_INFO, "Loading IO from %s [%s]\n", path, interface1->name);
|
zap_log(ZAP_LOG_INFO, "Loading IO from %s [%s]\n", path, interface1->name);
|
||||||
zap_mutex_lock(globals.mutex);
|
if (zap_global_add_io_interface(interface1) == ZAP_SUCCESS) {
|
||||||
if (hashtable_search(globals.interface_hash, (void *)interface1->name)) {
|
|
||||||
zap_log(ZAP_LOG_ERROR, "Interface %s already loaded!\n", interface1->name);
|
|
||||||
} else {
|
|
||||||
hashtable_insert(globals.interface_hash, (void *)interface1->name, interface1, HASHTABLE_FLAG_NONE);
|
|
||||||
process_module_config(interface1);
|
process_module_config(interface1);
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
zap_mutex_unlock(globals.mutex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user