FreeTDM: Move I/O interface lookup code into common ftdm_global_get_io_interface()

Auto-loading can be toggled by setting the new autoload parameter
to FTDM_FALSE/FTDM_TRUE.

Update ftdm_span_create() and ftdm_api_execute() to use the new code.

NOTE: Auto-loading of missing I/O interfaces remains enabled in both cases,
      but I guess we should disable it for ftdm_api_execute().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich
2013-06-02 02:56:44 +02:00
parent 85e2eaaf58
commit 23c2c751bd
2 changed files with 33 additions and 20 deletions

View File

@@ -1711,6 +1711,16 @@ FT_DECLARE(ftdm_status_t) ftdm_span_stop(ftdm_span_t *span);
*/
FT_DECLARE(ftdm_status_t) ftdm_global_add_io_interface(ftdm_io_interface_t *io_interface);
/**
* Get I/O interface by name
*
* \param iotype Name of interface
* \param autoload Try to load missing plugins
* \retval I/O interface handle on success
* \retval NULL on failure
*/
FT_DECLARE(ftdm_io_interface_t *) ftdm_global_get_io_interface(const char *iotype, ftdm_bool_t autoload);
/*! \brief Find a span by name */
FT_DECLARE(ftdm_status_t) ftdm_span_find_by_name(const char *name, ftdm_span_t **span);