mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
fix var events to not have stamp info
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12765 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c1cf70139a
commit
dd19c3c2ec
@ -332,6 +332,15 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char
|
||||
*/
|
||||
#define switch_event_create(event, id) switch_event_create_subclass(event, id, SWITCH_EVENT_SUBCLASS_ANY)
|
||||
|
||||
static inline switch_status_t switch_event_create_plain(switch_event_t **event, switch_event_types_t event_id)
|
||||
{
|
||||
switch_status_t status = switch_event_create(event, SWITCH_EVENT_CLONE);
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
(*event)->event_id = event_id;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
/*!
|
||||
\brief Deliver an event to all of the registered event listeners
|
||||
\param event the event to send (will be nulled)
|
||||
|
@ -938,7 +938,7 @@ SWITCH_STANDARD_APP(info_function)
|
||||
switch_event_t *event;
|
||||
char *buf;
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(switch_core_session_get_channel(session), event);
|
||||
switch_event_serialize(event, &buf, SWITCH_FALSE);
|
||||
switch_assert(buf);
|
||||
|
@ -1147,14 +1147,14 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
||||
|
||||
if (in) {
|
||||
if (!gateway->ib_vars) {
|
||||
switch_event_create(&gateway->ib_vars, SWITCH_EVENT_GENERAL);
|
||||
switch_event_create_plain(&gateway->ib_vars, SWITCH_EVENT_GENERAL);
|
||||
}
|
||||
switch_event_add_header_string(gateway->ib_vars, SWITCH_STACK_BOTTOM, var, val);
|
||||
}
|
||||
|
||||
if (out) {
|
||||
if (!gateway->ob_vars) {
|
||||
switch_event_create(&gateway->ob_vars, SWITCH_EVENT_GENERAL);
|
||||
switch_event_create_plain(&gateway->ob_vars, SWITCH_EVENT_GENERAL);
|
||||
}
|
||||
switch_event_add_header_string(gateway->ob_vars, SWITCH_STACK_BOTTOM, var, val);
|
||||
}
|
||||
|
@ -1780,8 +1780,10 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
|
||||
|
||||
if (first && ret == AUTH_OK) {
|
||||
if (v_event) {
|
||||
switch_event_create(v_event, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_event_create_plain(v_event, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
}
|
||||
|
||||
|
||||
if (v_event && *v_event) {
|
||||
switch_xml_t xparams[3];
|
||||
int i = 0;
|
||||
|
@ -199,7 +199,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
|
||||
|
||||
if (globals.debug) {
|
||||
switch_event_t *event;
|
||||
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
|
||||
char *buf;
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_serialize(event, &buf, SWITCH_FALSE);
|
||||
|
@ -611,8 +611,7 @@ SWITCH_STANDARD_API(event_sink_function)
|
||||
|
||||
switch_mutex_lock(listener->filter_mutex);
|
||||
if (!listener->filters) {
|
||||
switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
|
||||
listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
|
||||
switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
|
||||
}
|
||||
|
||||
if (!strcasecmp(action, "delete")) {
|
||||
@ -623,8 +622,7 @@ SWITCH_STANDARD_API(event_sink_function)
|
||||
|
||||
if (!strcasecmp(header_val, "all")) {
|
||||
switch_event_destroy(&listener->filters);
|
||||
switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
|
||||
listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
|
||||
switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
|
||||
} else {
|
||||
switch_event_del_header(listener->filters, header_val);
|
||||
}
|
||||
@ -1408,15 +1406,13 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
|
||||
|
||||
switch_mutex_lock(listener->filter_mutex);
|
||||
if (!listener->filters) {
|
||||
switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
|
||||
listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
|
||||
switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
|
||||
}
|
||||
|
||||
if (!strcasecmp(header_name, "delete")) {
|
||||
if (!strcasecmp(header_val, "all")) {
|
||||
switch_event_destroy(&listener->filters);
|
||||
switch_event_create(&listener->filters, SWITCH_EVENT_CLONE);
|
||||
listener->filters->event_id = SWITCH_EVENT_CHANNEL_DATA;
|
||||
switch_event_create_plain(&listener->filters, SWITCH_EVENT_CHANNEL_DATA);
|
||||
} else {
|
||||
switch_event_del_header(listener->filters, header_val);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
|
||||
return SWITCH_STATUS_MEMERR;
|
||||
}
|
||||
|
||||
switch_event_create(&(*channel)->variables, SWITCH_EVENT_GENERAL);
|
||||
switch_event_create_plain(&(*channel)->variables, SWITCH_EVENT_CHANNEL_DATA);
|
||||
|
||||
switch_core_hash_init(&(*channel)->private_hash, pool);
|
||||
switch_queue_create(&(*channel)->dtmf_queue, SWITCH_DTMF_LOG_LEN, pool);
|
||||
|
Loading…
x
Reference in New Issue
Block a user