提交 e6aee6b1 authored 作者: Anthony Minessale's avatar Anthony Minessale

MODEVENT-39

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12311 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 12c4ce0e
...@@ -59,6 +59,7 @@ static char *my_dup(const char *s) ...@@ -59,6 +59,7 @@ static char *my_dup(const char *s)
*/ */
static const char *EVENT_NAMES[] = { static const char *EVENT_NAMES[] = {
"CUSTOM", "CUSTOM",
"CLONE",
"CHANNEL_CREATE", "CHANNEL_CREATE",
"CHANNEL_DESTROY", "CHANNEL_DESTROY",
"CHANNEL_STATE", "CHANNEL_STATE",
...@@ -147,7 +148,7 @@ ESL_DECLARE(esl_status_t) esl_event_create_subclass(esl_event_t **event, esl_eve ...@@ -147,7 +148,7 @@ ESL_DECLARE(esl_status_t) esl_event_create_subclass(esl_event_t **event, esl_eve
{ {
*event = NULL; *event = NULL;
if ((event_id > 0 && event_id != ESL_EVENT_CUSTOM) && subclass_name) { if ((event_id != ESL_EVENT_CLONE && event_id != ESL_EVENT_CUSTOM) && subclass_name) {
return ESL_FAIL; return ESL_FAIL;
} }
...@@ -157,7 +158,7 @@ ESL_DECLARE(esl_status_t) esl_event_create_subclass(esl_event_t **event, esl_eve ...@@ -157,7 +158,7 @@ ESL_DECLARE(esl_status_t) esl_event_create_subclass(esl_event_t **event, esl_eve
memset(*event, 0, sizeof(esl_event_t)); memset(*event, 0, sizeof(esl_event_t));
if (event_id) { if (event_id != ESL_EVENT_CLONE) {
(*event)->event_id = event_id; (*event)->event_id = event_id;
esl_event_add_header_string(*event, ESL_STACK_BOTTOM, "Event-Name", esl_event_name((*event)->event_id)); esl_event_add_header_string(*event, ESL_STACK_BOTTOM, "Event-Name", esl_event_name((*event)->event_id));
} }
...@@ -392,7 +393,7 @@ ESL_DECLARE(esl_status_t) esl_event_dup(esl_event_t **event, esl_event_t *todup) ...@@ -392,7 +393,7 @@ ESL_DECLARE(esl_status_t) esl_event_dup(esl_event_t **event, esl_event_t *todup)
{ {
esl_event_header_t *hp; esl_event_header_t *hp;
if (esl_event_create_subclass(event, 0, todup->subclass_name) != ESL_SUCCESS) { if (esl_event_create_subclass(event, ESL_EVENT_CLONE, todup->subclass_name) != ESL_SUCCESS) {
return ESL_FAIL; return ESL_FAIL;
} }
......
...@@ -47,6 +47,7 @@ typedef enum { ...@@ -47,6 +47,7 @@ typedef enum {
typedef enum { typedef enum {
ESL_EVENT_CUSTOM, ESL_EVENT_CUSTOM,
ESL_EVENT_CLONE,
ESL_EVENT_CHANNEL_CREATE, ESL_EVENT_CHANNEL_CREATE,
ESL_EVENT_CHANNEL_DESTROY, ESL_EVENT_CHANNEL_DESTROY,
ESL_EVENT_CHANNEL_STATE, ESL_EVENT_CHANNEL_STATE,
......
...@@ -1160,6 +1160,7 @@ typedef uint32_t switch_io_flag_t; ...@@ -1160,6 +1160,7 @@ typedef uint32_t switch_io_flag_t;
*/ */
typedef enum { typedef enum {
SWITCH_EVENT_CUSTOM, SWITCH_EVENT_CUSTOM,
SWITCH_EVENT_CLONE,
SWITCH_EVENT_CHANNEL_CREATE, SWITCH_EVENT_CHANNEL_CREATE,
SWITCH_EVENT_CHANNEL_DESTROY, SWITCH_EVENT_CHANNEL_DESTROY,
SWITCH_EVENT_CHANNEL_STATE, SWITCH_EVENT_CHANNEL_STATE,
......
...@@ -111,6 +111,7 @@ static char *my_dup(const char *s) ...@@ -111,6 +111,7 @@ static char *my_dup(const char *s)
*/ */
static char *EVENT_NAMES[] = { static char *EVENT_NAMES[] = {
"CUSTOM", "CUSTOM",
"CLONE",
"CHANNEL_CREATE", "CHANNEL_CREATE",
"CHANNEL_DESTROY", "CHANNEL_DESTROY",
"CHANNEL_STATE", "CHANNEL_STATE",
...@@ -598,7 +599,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char ...@@ -598,7 +599,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char
*event = NULL; *event = NULL;
if ((event_id > 0 && event_id != SWITCH_EVENT_CUSTOM) && subclass_name) { if ((event_id != SWITCH_EVENT_CLONE && event_id != SWITCH_EVENT_CUSTOM) && subclass_name) {
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
...@@ -611,7 +612,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char ...@@ -611,7 +612,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass_detailed(const char
memset(*event, 0, sizeof(switch_event_t)); memset(*event, 0, sizeof(switch_event_t));
if (event_id) { if (event_id != SWITCH_EVENT_CLONE) {
(*event)->event_id = event_id; (*event)->event_id = event_id;
switch_event_prep_for_delivery_detailed(file, func, line, *event); switch_event_prep_for_delivery_detailed(file, func, line, *event);
} }
...@@ -813,7 +814,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_ ...@@ -813,7 +814,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_
{ {
switch_event_header_t *hp; switch_event_header_t *hp;
if (switch_event_create_subclass(event, 0, todup->subclass_name) != SWITCH_STATUS_SUCCESS) { if (switch_event_create_subclass(event, SWITCH_EVENT_CLONE, todup->subclass_name) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论