mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
Initial framework for directory interface modules (ldap etc)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@575 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -818,6 +818,60 @@ SWITCH_DECLARE(switch_status) switch_core_speech_feed_tts(switch_speech_handle *
|
||||
SWITCH_DECLARE(switch_status) switch_core_speech_close(switch_speech_handle *sh, unsigned int *flags);
|
||||
///\}
|
||||
|
||||
|
||||
///\defgroup dir Directory Service Functions
|
||||
///\ingroup core1
|
||||
///\{
|
||||
/*!
|
||||
\brief Open a directory handle
|
||||
\param dh a direcotry handle to use
|
||||
\param module_name the directory module to use
|
||||
\param source the source of the db (ip, hostname, path etc)
|
||||
\param dsn the username or designation of the lookup
|
||||
\param passwd the password
|
||||
\param pool the pool to use (NULL for new pool)
|
||||
\return SWITCH_STATUS_SUCCESS if the handle is opened
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle *dh,
|
||||
char *module_name,
|
||||
char *source,
|
||||
char *dsn,
|
||||
char *passwd,
|
||||
switch_memory_pool *pool);
|
||||
|
||||
/*!
|
||||
\brief Query a directory handle
|
||||
\param dh a direcotry handle to use
|
||||
\param query a string of filters or query data
|
||||
\return SWITCH_STATUS_SUCCESS if the query is successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_directory_query(switch_directory_handle *dh, char *query);
|
||||
|
||||
/*!
|
||||
\brief Obtain the next record in a lookup
|
||||
\param dh a direcotry handle to use
|
||||
\return SWITCH_STATUS_SUCCESS if another record exists
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_directory_next(switch_directory_handle *dh);
|
||||
|
||||
/*!
|
||||
\brief Obtain the next name/value pair in the current record
|
||||
\param dh a direcotry handle to use
|
||||
\param var a pointer to pointer of the name to fill in
|
||||
\param val a pointer to poinbter of the value to fill in
|
||||
\return SWITCH_STATUS_SUCCESS if an item exists
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_directory_next_pair(switch_directory_handle *dh, char **var, char **val);
|
||||
|
||||
/*!
|
||||
\brief Close an open directory handle
|
||||
\param dh a direcotry handle to close
|
||||
\return SWITCH_STATUS_SUCCESS if handle was closed
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status) switch_core_directory_close(switch_directory_handle *dh);
|
||||
///\}
|
||||
|
||||
|
||||
///\defgroup misc Misc
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
@@ -73,6 +73,8 @@ struct switch_loadable_module_interface {
|
||||
const switch_file_interface *file_interface;
|
||||
/*! the table of speech interfaces the module has implmented */
|
||||
const switch_speech_interface *speech_interface;
|
||||
/*! the table of directory interfaces the module has implmented */
|
||||
const switch_directory_interface *directory_interface;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -142,6 +144,13 @@ SWITCH_DECLARE(switch_file_interface *) switch_loadable_module_get_file_interfac
|
||||
*/
|
||||
SWITCH_DECLARE(switch_speech_interface *) switch_loadable_module_get_speech_interface(char *name);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the directory interface by it's registered name
|
||||
\param name the name of the directory interface
|
||||
\return the desired directory interface
|
||||
*/
|
||||
SWITCH_DECLARE(switch_directory_interface *) switch_loadable_module_get_directory_interface(char *name);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Retrieve the list of loaded codecs into an array
|
||||
|
||||
@@ -320,6 +320,39 @@ struct switch_speech_handle {
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*! \brief Abstract interface to a directory module */
|
||||
struct switch_directory_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to open the directory interface */
|
||||
switch_status (*directory_open)(switch_directory_handle *dh, char *source, char *dsn, char *passwd);
|
||||
/*! function to close the directory interface */
|
||||
switch_status (*directory_close)(switch_directory_handle *dh);
|
||||
/*! function to query the directory interface */
|
||||
switch_status (*directory_query)(switch_directory_handle *dh, char *query);
|
||||
/*! function to advance to the next record */
|
||||
switch_status (*directory_next)(switch_directory_handle *dh);
|
||||
/*! function to advance to the next name/value pair in the current record */
|
||||
switch_status (*directory_next_pair)(switch_directory_handle *dh, char **var, char **val);
|
||||
|
||||
const struct switch_directory_interface *next;
|
||||
};
|
||||
|
||||
/*! an abstract representation of a directory interface. */
|
||||
struct switch_directory_handle {
|
||||
/*! the interface of the module that implemented the current directory interface */
|
||||
const struct switch_directory_interface *directory_interface;
|
||||
/*! flags to control behaviour */
|
||||
unsigned int flags;
|
||||
|
||||
/*! the handle's memory pool */
|
||||
switch_memory_pool *memory_pool;
|
||||
/*! private data for the format module to store handle specific info */
|
||||
void *private;
|
||||
};
|
||||
|
||||
|
||||
/* nobody has more setting than speex so we will let them set the standard */
|
||||
/*! \brief Various codec settings (currently only relevant to speex) */
|
||||
struct switch_codec_settings {
|
||||
|
||||
@@ -241,6 +241,19 @@ typedef enum {
|
||||
|
||||
} switch_speech_flag;
|
||||
|
||||
|
||||
/*!
|
||||
\enum switch_directory_flag
|
||||
\brief Directory Handle related flags
|
||||
<pre>
|
||||
SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0) - Free interface's pool on destruction.
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0),
|
||||
|
||||
} switch_directory_flag;
|
||||
|
||||
/*!
|
||||
\enum switch_codec_type
|
||||
\brief Codec types
|
||||
@@ -380,6 +393,8 @@ typedef struct switch_codec_settings switch_codec_settings;
|
||||
typedef struct switch_config switch_config;
|
||||
typedef struct switch_speech_handle switch_speech_handle;
|
||||
typedef struct switch_speech_interface switch_speech_interface;
|
||||
typedef struct switch_directory_handle switch_directory_handle;
|
||||
typedef struct switch_directory_interface switch_directory_interface;
|
||||
typedef void (*switch_application_function)(switch_core_session *, char *);
|
||||
typedef void (*switch_event_callback_t)(switch_event *);
|
||||
typedef switch_caller_extension *(*switch_dialplan_hunt_function)(switch_core_session *);
|
||||
|
||||
Reference in New Issue
Block a user