#include <switch_cpp.h>
Definition at line 158 of file switch_cpp.h.
Event::Event |
( |
const char * |
type, |
|
|
const char * |
subclass_name = NULL |
|
) |
| |
Definition at line 293 of file switch_cpp.cpp.
References event, mine, serialized_string, SWITCH_CHANNEL_LOG, switch_event_create_json(), switch_event_create_subclass, SWITCH_EVENT_CUSTOM, SWITCH_EVENT_MESSAGE, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_name_event(), SWITCH_STATUS_SUCCESS, and zstr.
297 if (!strcasecmp(type,
"json") && !
zstr(subclass_name)) {
302 event_id =
event->event_id;
#define SWITCH_CHANNEL_LOG
switch_event_types_t
Built-in Events.
switch_status_t switch_name_event(const char *name, switch_event_types_t *type)
return the event id that matches a given event name
#define switch_event_create_subclass(_e, _eid, _sn)
switch_status_t switch_event_create_json(switch_event_t **event, const char *json)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
Event::Event |
( |
const char * |
type, |
|
|
const char * |
subclass_name = NULL |
|
) |
| |
virtual Event::~Event |
( |
| ) |
|
|
virtual |
bool Event::addBody |
( |
const char * |
value | ) |
|
Definition at line 483 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_add_body(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, and this_check.
#define SWITCH_CHANNEL_LOG
switch_status_t switch_event_add_body(switch_event_t *event, const char *fmt,...) PRINTF_FUNCTION(2
Add a body to an event.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
bool Event::addBody |
( |
const char * |
value | ) |
|
bool Event::addHeader |
( |
const char * |
header_name, |
|
|
const char * |
value |
|
) |
| |
Definition at line 451 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_add_header_string(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, and this_check.
#define SWITCH_CHANNEL_LOG
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
bool Event::addHeader |
( |
const char * |
header_name, |
|
|
const char * |
value |
|
) |
| |
int Event::chat_execute |
( |
const char * |
app, |
|
|
const char * |
data = NULL |
|
) |
| |
int Event::chat_execute |
( |
const char * |
app, |
|
|
const char * |
data = NULL |
|
) |
| |
int Event::chat_send |
( |
const char * |
dest_proto = NULL | ) |
|
int Event::chat_send |
( |
const char * |
dest_proto = NULL | ) |
|
bool Event::delHeader |
( |
const char * |
header_name | ) |
|
bool Event::delHeader |
( |
const char * |
header_name | ) |
|
Definition at line 464 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_del_header, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, this_check, and zstr.
468 if (
zstr(header_name)) {
#define SWITCH_CHANNEL_LOG
#define switch_event_del_header(_e, _h)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
bool Event::fire |
( |
void |
| ) |
|
bool Event::fire |
( |
void |
| ) |
|
Definition at line 393 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_destroy(), switch_event_dup(), switch_event_fire, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, and this_check.
#define switch_event_fire(event)
Fire an event filling in most of the arguements with obvious values.
#define SWITCH_CHANNEL_LOG
Representation of an event.
switch_status_t switch_event_dup(switch_event_t **event, switch_event_t *todup)
Duplicate an event.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
void switch_event_destroy(switch_event_t **event)
Destroy an event.
char* Event::getBody |
( |
void |
| ) |
|
char * Event::getBody |
( |
void |
| ) |
|
Definition at line 496 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_get_body(), SWITCH_LOG_ERROR, switch_log_printf(), and this_check.
#define SWITCH_CHANNEL_LOG
char * switch_event_get_body(switch_event_t *event)
Retrieve the body value from an event.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
const char * Event::getHeader |
( |
const char * |
header_name | ) |
|
Definition at line 434 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_get_header, SWITCH_LOG_ERROR, switch_log_printf(), this_check, and zstr.
438 if (
zstr(header_name)) {
#define SWITCH_CHANNEL_LOG
#define switch_event_get_header(_e, _h)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
const char* Event::getHeader |
( |
const char * |
header_name | ) |
|
const char * Event::getType |
( |
void |
| ) |
|
Definition at line 510 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_name(), SWITCH_LOG_ERROR, switch_log_printf(), and this_check.
520 return (
char *)
"invalid";
switch_event_types_t event_id
#define SWITCH_CHANNEL_LOG
const char * switch_event_name(switch_event_types_t event)
Render the name of an event id enumeration.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
const char* Event::getType |
( |
void |
| ) |
|
const char * Event::serialize |
( |
const char * |
format = NULL | ) |
|
Definition at line 357 of file switch_cpp.cpp.
References switch_event_serialize(), switch_event_serialize_json(), switch_event_xmlize(), SWITCH_FALSE, switch_mprintf(), switch_safe_free, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, SWITCH_VA_NONE, switch_xml_free(), switch_xml_toxml(), and this_check.
368 if (format && !strcasecmp(format,
"xml")) {
377 }
else if (format && !strcasecmp(format,
"json")) {
switch_status_t switch_event_serialize_json(switch_event_t *event, char **str)
void switch_xml_free(_In_opt_ switch_xml_t xml)
frees the memory allocated for an switch_xml structure
char * switch_xml_toxml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header)
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ mus...
A representation of an XML tree.
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
switch_status_t switch_event_serialize(switch_event_t *event, char **str, switch_bool_t encode)
SWITCH_BEGIN_EXTERN_C char * switch_mprintf(const char *zFormat,...)
switch_xml_t switch_event_xmlize(switch_event_t *event, const char *fmt,...) PRINTF_FUNCTION(2
Render a XML representation of an event suitable for printing or network transport.
const char* Event::serialize |
( |
const char * |
format = NULL | ) |
|
Definition at line 421 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_set_priority(), SWITCH_LOG_ERROR, switch_log_printf(), and this_check.
#define SWITCH_CHANNEL_LOG
switch_status_t switch_event_set_priority(switch_event_t *event, switch_priority_t priority)
Set the priority of an event.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
char * Event::serialized_string |
The documentation for this class was generated from the following files: