#include <switch_cpp.h>
Definition at line 158 of file switch_cpp.h.
◆ Event() [1/2]
| Event::Event |
( |
const char * |
type, |
|
|
const char * |
subclass_name = NULL |
|
) |
| |
Definition at line 294 of file switch_cpp.cpp.
References 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.
298 if (!strcasecmp(type,
"json") && !
zstr(subclass_name)) {
303 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() [2/2]
◆ ~ Event()
| virtual Event::~ Event |
( |
| ) |
|
|
virtual |
◆ addBody()
| bool Event::addBody |
( |
const char * |
value | ) |
|
Definition at line 484 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_add_body(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, this_check, and true.
#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.
const char *const const char *const const cJSON *const value
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.
◆ addHeader()
| bool Event::addHeader |
( |
const char * |
header_name, |
|
|
const char * |
value |
|
) |
| |
Definition at line 452 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, this_check, and true.
#define SWITCH_CHANNEL_LOG
const char *const const char *const const cJSON *const value
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.
◆ chat_execute()
| int Event::chat_execute |
( |
const char * |
app, |
|
|
const char * |
data = NULL |
|
) |
| |
◆ chat_send()
| int Event::chat_send |
( |
const char * |
dest_proto = NULL | ) |
|
◆ delHeader()
| bool Event::delHeader |
( |
const char * |
header_name | ) |
|
Definition at line 465 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_del_header, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, this_check, true, and zstr.
469 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.
◆ fire()
| bool Event::fire |
( |
void |
| ) |
|
Definition at line 394 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.
◆ getBody()
| char * Event::getBody |
( |
void |
| ) |
|
Definition at line 497 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.
◆ getHeader()
| const char * Event::getHeader |
( |
const char * |
header_name | ) |
|
Definition at line 435 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_get_header, SWITCH_LOG_ERROR, switch_log_printf(), this_check, and zstr.
439 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.
◆ getType()
| const char * Event::getType |
( |
void |
| ) |
|
Definition at line 511 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, switch_event_name(), SWITCH_LOG_ERROR, switch_log_printf(), and this_check.
521 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.
◆ merge()
| bool Event::merge |
( |
Event * |
to_merge | ) |
|
Definition at line 524 of file switch_cpp.cpp.
References event, SWITCH_CHANNEL_LOG, switch_event_merge(), SWITCH_LOG_ERROR, switch_log_printf(), and this_check.
533 if (!to_merge || !to_merge->
event) {
#define SWITCH_CHANNEL_LOG
void switch_event_merge(switch_event_t *event, switch_event_t *tomerge)
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.
◆ serialize()
| const char * Event::serialize |
( |
const char * |
format = NULL | ) |
|
Definition at line 358 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.
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
A representation of an XML tree.
char const int const cJSON_bool format
#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,...)
#define switch_xml_toxml(xml, prn_header)
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ mus...
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.
◆ setPriority()
Definition at line 422 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.
◆ event
◆ mine
◆ serialized_string
| char* Event::serialized_string |
The documentation for this class was generated from the following files: