cleanup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4832 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
2b76e3e72f
commit
e47596fca5
|
@ -796,6 +796,8 @@ typedef enum {
|
|||
SWITCH_EVENT_PRESENCE_IN - Presence in
|
||||
SWITCH_EVENT_PRESENCE_OUT - Presence out
|
||||
SWITCH_EVENT_PRESENCE_PROBE - Presence probe
|
||||
SWITCH_EVENT_MESSAGE_WAITING - A message is waiting
|
||||
SWITCH_EVENT_MESSAGE_QUERY - A query for MESSAGE_WAITING events
|
||||
SWITCH_EVENT_CODEC - Codec Change
|
||||
SWITCH_EVENT_BACKGROUND_JOB - Background Job
|
||||
SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
|
||||
|
@ -841,6 +843,8 @@ typedef enum {
|
|||
SWITCH_EVENT_PRESENCE_IN,
|
||||
SWITCH_EVENT_PRESENCE_OUT,
|
||||
SWITCH_EVENT_PRESENCE_PROBE,
|
||||
SWITCH_EVENT_MESSAGE_WAITING,
|
||||
SWITCH_EVENT_MESSAGE_QUERY,
|
||||
SWITCH_EVENT_ROSTER,
|
||||
SWITCH_EVENT_CODEC,
|
||||
SWITCH_EVENT_BACKGROUND_JOB,
|
||||
|
|
|
@ -454,9 +454,8 @@ static int sofia_presence_sub_reg_callback(void *pArg, int argc, char **argv, ch
|
|||
char *event_name = argv[5];
|
||||
|
||||
if (!strcasecmp(event_name, "message-summary")) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE_WAITING) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "no");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", "sip:%s@%s", user, host);
|
||||
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", user, host);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -128,6 +128,7 @@ static JSBool event_construct(JSContext * cx, JSObject * obj, uintN argc, jsval
|
|||
if ((eo = malloc(sizeof(*eo)))) {
|
||||
|
||||
if (switch_name_event(ename, &etype) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unknown event %s\n", ename);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -146,7 +147,7 @@ static JSBool event_construct(JSContext * cx, JSObject * obj, uintN argc, jsval
|
|||
}
|
||||
|
||||
} else {
|
||||
if (!switch_event_create(&event, etype) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_event_create(&event, etype) != SWITCH_STATUS_SUCCESS) {
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -126,6 +126,8 @@ static char *EVENT_NAMES[] = {
|
|||
"PRESENCE_IN",
|
||||
"PRESENCE_OUT",
|
||||
"PRESENCE_PROBE",
|
||||
"MESSAGE_WAITING",
|
||||
"MESSAGE_QUERY",
|
||||
"ROSTER",
|
||||
"CODEC",
|
||||
"BACKGROUND_JOB",
|
||||
|
@ -313,7 +315,7 @@ SWITCH_DECLARE(switch_status_t) switch_name_event(char *name, switch_event_types
|
|||
assert(RUNTIME_POOL != NULL);
|
||||
|
||||
for (x = 0; x <= SWITCH_EVENT_ALL; x++) {
|
||||
if (!strcasecmp(name, EVENT_NAMES[x])) {
|
||||
if ((strlen(name) > 13 && !strcasecmp(name + 13, EVENT_NAMES[x])) || !strcasecmp(name, EVENT_NAMES[x])) {
|
||||
*type = x;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue