diff --git a/src/include/switch_caller.h b/src/include/switch_caller.h index 0074426482..2234ed2465 100644 --- a/src/include/switch_caller.h +++ b/src/include/switch_caller.h @@ -33,7 +33,7 @@ * @file switch_caller.h * @brief Caller Identification * @see caller -*/ + */ /** * @defgroup caller Caller Identity / Dialplan * @ingroup FREESWITCH @@ -56,120 +56,123 @@ #ifdef __cplusplus extern "C" { #endif +#ifdef _FORMATBUG +} +#endif #include - /*! \brief Call Specific Data - */ - struct switch_caller_profile { - /*! The name of the dialplan */ - char *dialplan; - /*! Caller ID Name */ - char *caller_id_name; - /*! Caller ID Number */ - char *caller_id_number; - /*! Caller Network Address (when applicable) */ - char *network_addr; - /*! ANI (when applicable) */ - char *ani; - /*! ANI II (when applicable) */ - char *ani2; - /*! Destination Number */ - char *destination_number; - /*! channel name */ - char *chan_name; - /*! unique id */ - char *uuid; - }; +/*! \brief Call Specific Data + */ +struct switch_caller_profile { + /*! The name of the dialplan */ + char *dialplan; + /*! Caller ID Name */ + char *caller_id_name; + /*! Caller ID Number */ + char *caller_id_number; + /*! Caller Network Address (when applicable) */ + char *network_addr; + /*! ANI (when applicable) */ + char *ani; + /*! ANI II (when applicable) */ + char *ani2; + /*! Destination Number */ + char *destination_number; + /*! channel name */ + char *chan_name; + /*! unique id */ + char *uuid; +}; - /*! \brief An Abstract Representation of a dialplan Application */ - struct switch_caller_application { - /*! The name of the registered application to call */ - char *application_name; - /*! An optional argument string to pass to the application */ - char *application_data; - /*! A function pointer to the application */ - switch_application_function application_function; - struct switch_caller_application *next; - }; +/*! \brief An Abstract Representation of a dialplan Application */ +struct switch_caller_application { + /*! The name of the registered application to call */ + char *application_name; + /*! An optional argument string to pass to the application */ + char *application_data; + /*! A function pointer to the application */ + switch_application_function application_function; + struct switch_caller_application *next; +}; - /*! \brief An Abstract Representation of a dialplan extension */ - struct switch_caller_extension { - /*! The name of the extension */ - char *extension_name; - /*! The number of the extension */ - char *extension_number; - /*! Pointer to the current application for this extension */ - struct switch_caller_application *current_application; - /*! Pointer to the last application for this extension */ - struct switch_caller_application *last_application; - /*! Pointer to the entire stack of applications for this extension */ - struct switch_caller_application *applications; - }; +/*! \brief An Abstract Representation of a dialplan extension */ +struct switch_caller_extension { + /*! The name of the extension */ + char *extension_name; + /*! The number of the extension */ + char *extension_number; + /*! Pointer to the current application for this extension */ + struct switch_caller_application *current_application; + /*! Pointer to the last application for this extension */ + struct switch_caller_application *last_application; + /*! Pointer to the entire stack of applications for this extension */ + struct switch_caller_application *applications; +}; - /*! - \brief Create a new extension with desired parameters - \param session session associated with the extension (bound by scope) - \param extension_name extension name - \param extension_number extension number - \return a new extension object allocated from the session's memory pool - */ - SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_core_session *session, - char *extension_name, - char *extension_number - ); +/*! + \brief Create a new extension with desired parameters + \param session session associated with the extension (bound by scope) + \param extension_name extension name + \param extension_number extension number + \return a new extension object allocated from the session's memory pool +*/ +SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_core_session *session, + char *extension_name, + char *extension_number + ); - /*! - \brief Add an application (instruction) to the given extension - \param session session associated with the extension (bound by scope) - \param caller_extension extension to add the application to - \param application_name the name of the application - \param extra_data optional argument to the application - */ - SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session *session, - switch_caller_extension *caller_extension, - char *application_name, - char *extra_data); +/*! + \brief Add an application (instruction) to the given extension + \param session session associated with the extension (bound by scope) + \param caller_extension extension to add the application to + \param application_name the name of the application + \param extra_data optional argument to the application +*/ +SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session *session, + switch_caller_extension *caller_extension, + char *application_name, + char *extra_data); - /*! - \brief Create a new caller profile object - \param pool memory pool to use - \param dialplan name of the dialplan module in use - \param caller_id_name caller ID name - \param caller_id_number caller ID number - \param network_addr network address - \param ani ANI information - \param ani2 ANI II information - \param destination_number destination number - \return a new profile object allocated from the session's memory pool - */ - SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, - char *dialplan, - char *caller_id_name, - char *caller_id_number, - char *network_addr, - char *ani, - char *ani2, - char *destination_number); +/*! + \brief Create a new caller profile object + \param pool memory pool to use + \param dialplan name of the dialplan module in use + \param caller_id_name caller ID name + \param caller_id_number caller ID number + \param network_addr network address + \param ani ANI information + \param ani2 ANI II information + \param destination_number destination number + \return a new profile object allocated from the session's memory pool +*/ +SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, + char *dialplan, + char *caller_id_name, + char *caller_id_number, + char *network_addr, + char *ani, + char *ani2, + char *destination_number); - /*! - \brief Clone an existing caller profile object - \param session session associated with the profile (bound by scope) - \param tocopy the existing profile - */ +/*! + \brief Clone an existing caller profile object + \param session session associated with the profile (bound by scope) + \param tocopy the existing profile +*/ - SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_session *session, - switch_caller_profile *tocopy); +SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_session *session, + switch_caller_profile *tocopy); - /*! - \brief Add headers to an existing event in regards to a specific profile - \param caller_profile the desired profile - \param prefix a prefix string to all of the field names (for uniqueness) - \param event the event to add the information to - */ +/*! + \brief Add headers to an existing event in regards to a specific profile + \param caller_profile the desired profile + \param prefix a prefix string to all of the field names (for uniqueness) + \param event the event to add the information to +*/ - SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event *event); +SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event *event); #ifdef __cplusplus diff --git a/src/include/switch_log.h b/src/include/switch_log.h index 3a00c8b79a..50ccec1225 100644 --- a/src/include/switch_log.h +++ b/src/include/switch_log.h @@ -47,25 +47,32 @@ extern "C" { #include +///\defgroup log Logger Routines +///\ingroup core1 +///\{ + + +/*! \brief Log Data + */ typedef struct { + /*! The complete log message */ char *data; + /*! The file where the message originated */ char *file; - char *func; - char *content; + /*! The line number where the message originated */ uint32_t line; + /*! The function where the message originated */ + char *func; + /*! The log level of the message */ switch_log_level level; + /*! The time when the log line was sent */ switch_time_t timestamp; + /*! A pointer to where the actual content of the message starts (skipping past the preformatted portion) */ + char *content; } switch_log_node; typedef switch_status (*switch_log_function)(const switch_log_node *node, switch_log_level level); -/*! - \brief A method akin to printf that allows you to redirect output to a specific log -*/ - -///\defgroup log Logger Routines -///\ingroup core1 -///\{ /*! \brief Initilize the logging engine @@ -100,6 +107,13 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file, */ SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function function, switch_log_level level); +/*! + \brief Return the name of the specified log level + \param level the level + \return the name of the log level +*/ +SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level level); + ///\} #ifdef __cplusplus }