]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add some more specific events
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Oct 2008 17:10:05 +0000 (17:10 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 2 Oct 2008 17:10:05 +0000 (17:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9789 d0543943-73ff-0310-b7d9-9358b9ac24b2

21 files changed:
src/include/switch_types.h
src/mod/applications/mod_commands/mod_commands.c
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/applications/mod_voicemail/mod_voicemail.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c
src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
src/mod/event_handlers/mod_event_socket/mod_event_socket.c
src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
src/switch_channel.c
src/switch_core.c
src/switch_core_session.c
src/switch_event.c
src/switch_ivr_async.c
src/switch_ivr_bridge.c
src/switch_ivr_originate.c
src/switch_ivr_play_say.c
src/switch_xml.c

index 5e3def5d12a0f4f641a1397a48b0efba81bc870c..cfc532931b68d777b663c9c4deba13e97b371d16 100644 (file)
@@ -1128,6 +1128,10 @@ typedef enum {
        SWITCH_EVENT_NOTIFY,
        SWITCH_EVENT_SEND_MESSAGE,
        SWITCH_EVENT_RECV_MESSAGE,
+       SWITCH_EVENT_REQUEST_PARAMS,
+       SWITCH_EVENT_CHANNEL_DATA,
+       SWITCH_EVENT_GENERAL,
+       SWITCH_EVENT_COMMAND,
        SWITCH_EVENT_ALL
 } switch_event_types_t;
 
index 4cc0d289beba77f3781f90ef5aafa63f6eaf29aa..b16549872466b047db91260c0e6d99111d122d44 100644 (file)
@@ -70,7 +70,7 @@ SWITCH_STANDARD_API(user_data_function)
                domain = "cluecon.com";
        }
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "user", user);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "type", type);
@@ -224,7 +224,7 @@ SWITCH_STANDARD_API(eval_function)
        }
 
        
-       switch_event_create(&event, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA);
        if (*uuid) {
                if ((session = switch_core_session_locate(uuid))) {
                        switch_channel_event_set_data(switch_core_session_get_channel(session), event);
@@ -337,7 +337,7 @@ SWITCH_STANDARD_API(xml_locate_function)
        tag_attr_name = argv[2];
        tag_attr_val = argv[3];
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "section", section);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "tag", tag);
@@ -1051,7 +1051,7 @@ SWITCH_STANDARD_API(uuid_chat)
        } else {
                if ((tsession = switch_core_session_locate(uuid))) {
                        switch_event_t *event;
-                       if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+                       if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                                switch_event_add_body(event, "%s", text);
                                if (switch_core_session_receive_event(tsession, &event) != SWITCH_STATUS_SUCCESS) {
                                        switch_event_destroy(&event);
@@ -2462,7 +2462,7 @@ SWITCH_STANDARD_API(uuid_dump_function)
 
                                channel = switch_core_session_get_channel(psession);
 
-                               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+                               if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
                                        switch_xml_t xml;
                                        switch_channel_event_set_data(channel, event);
                                        if (!strcasecmp(format, "xml")) {
index dba65071210add7055fa9434d27fa36b6f5fd1d0..ad7600fd56b82f51a576e6028f4ab61bddeee414 100644 (file)
@@ -3390,7 +3390,7 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
                                        goto done;
                                }
 
-                               switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+                               switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
                                switch_assert(params);
                                switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conf_name", conf_name);
                                switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile_name", profile_name);
@@ -4248,7 +4248,7 @@ SWITCH_STANDARD_APP(conference_function)
        }
 #endif
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_COMMAND);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conf_name", conf_name);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile_name", profile_name);
@@ -5221,7 +5221,7 @@ static void send_presence(switch_event_types_t id)
        switch_xml_t cxml, cfg, advertise, room;
        switch_event_t *params = NULL;
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_COMMAND);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "presence", "true");
 
index 5188c24a21ce4224219de6f3aa2ea57c9bfd337b..7cabc14bab5e4863003ac921603bd9621f7c534b 100644 (file)
@@ -894,7 +894,7 @@ SWITCH_STANDARD_APP(info_function)
        switch_event_t *event;
        char *buf;
 
-       if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+       if (switch_event_create(&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);
@@ -1111,7 +1111,7 @@ SWITCH_STANDARD_APP(ivr_application_function)
                switch_xml_t cxml = NULL, cfg = NULL, xml_menus = NULL, xml_menu = NULL;
 
                /* Open the config from the xml registry */
-               switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
                switch_assert(params);
                switch_channel_event_set_data(channel, params);
 
@@ -1998,7 +1998,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
 
        *domain++ = '\0';
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true");
 
@@ -2062,7 +2062,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
                } else {
                        switch_event_t *event = var_event;
                        if (!event) {
-                               switch_event_create(&event, SWITCH_EVENT_MESSAGE);
+                               switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS);
                                switch_assert(event);
                        }
 
index 70f5f43e05f2ae865672c224bdac948b4a74be93..2676ea82ed49cb3467f9ed117a35343cfaa5a252 100644 (file)
@@ -1504,7 +1504,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
 
                                        header_string = switch_core_session_sprintf(session, "%s\nX-Voicemail-Length: %u", headers, message_len);
 
-                                       if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+                                       if (switch_event_create(&event, SWITCH_EVENT_GENERAL) == SWITCH_STATUS_SUCCESS) {
                                                /* this isnt done?  it was in the other place
                                                 * switch_channel_event_set_data(channel, event);
                                                 */
@@ -1927,7 +1927,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                        int ok = 1;
 
 
-                                       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+                                       switch_event_create(&params, SWITCH_EVENT_GENERAL);
                                        switch_assert(params);
                                        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", myid);
                                        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "destination_number", caller_profile->destination_number);
@@ -2097,7 +2097,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
        }
        
        if (params) {
-               switch_event_create(&local_event, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS);
                params = local_event;
        }
        
@@ -2440,7 +2440,7 @@ static switch_status_t voicemail_inject(const char *data)
                switch_event_t *my_params = NULL;
                switch_xml_t ut;
 
-               switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
                switch_assert(my_params);
                switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "domain", domain);
                switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "purpose", "publish-vm");
@@ -2458,7 +2458,7 @@ static switch_status_t voicemail_inject(const char *data)
                
                if (!isall && !istag) {
                        if ((ut = switch_xml_find_child(x_domain, "user", "id", user))) {
-                               switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+                               switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
                                status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
                                switch_event_destroy(&my_params);
                        } else {
@@ -2469,7 +2469,7 @@ static switch_status_t voicemail_inject(const char *data)
                                const char *tag;
 
                                if (isall || (istag && (tag=switch_xml_attr(ut, "vm-tag")) && !strcasecmp(tag, user))) {
-                                       switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+                                       switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
                                        status = deliver_vm(profile, ut, domain, path, 0, "B", my_params, pool, cid_name, cid_num, SWITCH_TRUE);
                                        switch_event_destroy(&my_params);
                                }
@@ -2546,7 +2546,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, cons
                switch_event_t *params = NULL;
                const char *email_addr = NULL;
 
-               switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
                switch_assert(params);
                switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id);
 
index 714cdca00f70fea80e59c867b16d016ec762e593..a990b6dcbf93ad34ae46d9eb52b17fe2ae2f18ad 100644 (file)
@@ -201,7 +201,7 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
        switch_status_t status = SWITCH_STATUS_GENERR;
        switch_event_t *params = NULL;
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
 
        switch_channel_event_set_data(channel, params);
index 97b48d2192112645c1ddd38549a3e2bba9d360f2..346a55acc2c9d726b16273d5e177bc78cb4788f8 100644 (file)
@@ -2267,7 +2267,7 @@ static void do_vcard(ldl_handle_t *handle, char *to, char *from, char *id)
                goto end;
        }
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header(params, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "from", from);
index d755fffb0e7e7ec6ba70e2346bfaa922fff4b1c6..a27d870ccd6c40f74e06bc99b37df0057d6764bf 100644 (file)
@@ -999,7 +999,7 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
        switch_event_t *params = NULL;
        switch_status_t status = SWITCH_STATUS_FALSE;
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", profile->name);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "reconfig", "true");
@@ -1346,7 +1346,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
                return status;
        }
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", profile_name);
 
index 8b7c73f727f58fe1734fd08e3435c10ef3407043..0e597c1b3ad6df4a60c0837a98f69d7b5b93b2a5 100644 (file)
@@ -1251,7 +1251,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
                free(sql);
        }
 
-       switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(params);
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "sip_auth");
        switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_profile", profile->name);
@@ -1420,7 +1420,7 @@ 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_MESSAGE);
+                       switch_event_create(v_event, SWITCH_EVENT_REQUEST_PARAMS);
                }
                if (v_event && *v_event) {
                        switch_xml_t xparams[2];
index cc3894749c7d5bbefb4df64a68ff249e90b2bc08..ba492ed4ce97fa869cb5aec987872af242ddaa13 100644 (file)
@@ -199,7 +199,7 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
 
        if (globals.debug) {
                switch_event_t *event;
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                        char *buf;
                        switch_channel_event_set_data(channel, event);
                        switch_event_serialize(event, &buf, SWITCH_FALSE);
index 255cc98de6d1321bf827adbdb62ef89070629e62..ab17391e928e5773796ad1a971b81607e1bf6a33 100644 (file)
@@ -467,7 +467,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
                                        }
                                        count++;
                                        if (count == 1) {
-                                               switch_event_create(event, SWITCH_EVENT_MESSAGE);
+                                               switch_event_create(event, SWITCH_EVENT_COMMAND);
                                                switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Command", "%s", mbuf);
                                        } else if (cur) {
                                                char *var, *val;
@@ -1177,7 +1177,7 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
                        goto done;
                }
 
-               if (switch_event_create(&call_event, SWITCH_EVENT_MESSAGE) != SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&call_event, SWITCH_EVENT_COMMAND) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
                        switch_clear_flag_locked(listener, LFLAG_RUNNING);
                        goto done;
index 4106469f2536befe4f95075593a94674c9e04640..0c74306e0471d6159b00afa436cf414b4490ad92 100644 (file)
@@ -202,7 +202,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
                                        goto authed;
                                }
 
-                               switch_event_create(&params, SWITCH_EVENT_MESSAGE);
+                               switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
                                switch_assert(params);
                                switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check");
 
index 4fa67f1bef9c860549d04e4a01c2117408b32b32..a46fe9de372aeb1c6cfd74777a24fe8b773149ba 100644 (file)
@@ -200,7 +200,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
                return SWITCH_STATUS_MEMERR;
        }
 
-       switch_event_create(&(*channel)->variables, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&(*channel)->variables, SWITCH_EVENT_GENERAL);
 
        switch_core_hash_init(&(*channel)->private_hash, pool);
        switch_queue_create(&(*channel)->dtmf_queue, 128, pool);
@@ -1134,7 +1134,9 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
                event->event_id == SWITCH_EVENT_CHANNEL_ANSWER ||
                event->event_id == SWITCH_EVENT_CHANNEL_PROGRESS ||
                event->event_id == SWITCH_EVENT_CHANNEL_PROGRESS_MEDIA ||
-               event->event_id == SWITCH_EVENT_CHANNEL_HANGUP
+               event->event_id == SWITCH_EVENT_CHANNEL_HANGUP ||
+               event->event_id == SWITCH_EVENT_REQUEST_PARAMS ||
+               event->event_id == SWITCH_EVENT_CHANNEL_DATA
                ) {
 
                /* Index Caller's Profile */
index 9bc73e090288aaaa92ac7b73819958ceb35b0ff4..99850ef768762db6ce0f6394e79c7c491f007e2b 100644 (file)
@@ -876,7 +876,7 @@ SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload)
                                                switch_xml_t x_domain, xml_root;
                                                switch_xml_t ut;
 
-                                               switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+                                               switch_event_create(&my_params, SWITCH_EVENT_GENERAL);
                                                switch_assert(my_params);
                                                switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "domain", domain);
                                                switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "purpose", "network-list");
index b5fc80c931924c1a0aa51a6d8625c54312d9479b..d81e30be382ef8f80b380429c5bd71ca8cc8f2a3 100644 (file)
@@ -797,7 +797,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thre
        switch_set_flag(session, SSF_DESTROYED);
 
        if ((val = switch_channel_get_variable(session->channel, "memory_debug")) && switch_true(val)) {
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_GENERAL) == SWITCH_STATUS_SUCCESS) {
                        switch_channel_event_set_data(session->channel, event);
                        switch_event_serialize(event, &event_str, SWITCH_FALSE);
                        switch_assert(event_str);
index 5c22843e053233c39c06e1cf4c1fe3b518df4964..7f3fce7174fdf849121b1f95c08e020b120ff41c 100644 (file)
@@ -161,6 +161,10 @@ static char *EVENT_NAMES[] = {
        "NOTIFY",
        "SEND_MESSAGE",
        "RECV_MESSAGE",
+       "REQUEST_PARAMS",
+       "CHANNEL_DATA",
+       "GENERAL",
+       "COMMAND",
        "ALL"
 };
 
index ca21b92b15408beaabe45eb56526dfb948ffd2cb..362015632a8a4e390cda84601fc8b3e30c839fcb 100644 (file)
@@ -1232,7 +1232,7 @@ static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_da
                                        cont->list[i].up = 0;
 
                                        if (cont->list[i].app) {
-                                               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+                                               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", cont->list[i].app);
                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cont->list[i].data);
@@ -2068,7 +2068,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
 
        if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
                && (other_session = switch_core_session_locate(other_uuid))) {
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
@@ -2090,7 +2090,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
        }
 
        if ((flags & SMF_ECHO_ALEG)) {
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
@@ -2109,7 +2109,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
        }
 
        if (nomedia) {
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "nomedia");
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "nomedia-uuid", uuid);
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
@@ -2118,7 +2118,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
        }
 
        if (cause) {
-               if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+               if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", "hangup");
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", cause);
index 840b276f4ec1dd391f08329e5978f904c82d9ca7..45eac5c3b2bedccfcd951c2bde6dac44463cae4b 100644 (file)
@@ -274,7 +274,7 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
                                status = input_callback(session_a, event, SWITCH_INPUT_TYPE_EVENT, user_data, 0);
                        }
 
-                       if (event->event_id != SWITCH_EVENT_MESSAGE || switch_core_session_receive_event(session_b, &event) != SWITCH_STATUS_SUCCESS) {
+                       if (event->event_id != SWITCH_EVENT_COMMAND || switch_core_session_receive_event(session_b, &event) != SWITCH_STATUS_SUCCESS) {
                                switch_event_destroy(&event);
                        }
 
index a8b1a918acc115f6f8bf402e83cd5e10c0350e1b..bc51cab09fdc1ef21996c73674071e95c6533c42 100644 (file)
@@ -596,7 +596,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
           so we will normalize dialstring params and channel variables (when there is an originator) into an event that we 
           will use as a pseudo hash to consult for params as needed.
         */
-       if (switch_event_create(&var_event, SWITCH_EVENT_MESSAGE) != SWITCH_STATUS_SUCCESS) {
+       if (switch_event_create(&var_event, SWITCH_EVENT_GENERAL) != SWITCH_STATUS_SUCCESS) {
                abort();
        }
 
index 3291c7ca376e35251c630d3dff27af09517dd00c..4ac4f05b8acc72fe0a5d4b7c611c77edfde38c7c 100644 (file)
@@ -121,7 +121,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
 
        module_name = chan_lang;
 
-       switch_event_create(&hint_data, SWITCH_EVENT_MESSAGE);
+       switch_event_create(&hint_data, SWITCH_EVENT_REQUEST_PARAMS);
        switch_assert(hint_data);
 
        switch_event_add_header_string(hint_data, SWITCH_STACK_BOTTOM, "macro_name", macro_name);
index fd3e067d3a5fb320f268d7eaa109e527bf82396d..22c1b22b1909f9ada85d8d36160b4e0c3e1ff466 100644 (file)
@@ -1437,7 +1437,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name
        *domain = NULL;
 
        if (!params) {
-               switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
                switch_assert(my_params);
                switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "domain", domain_name);
                params = my_params;
@@ -1467,7 +1467,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
        *domain = NULL;
 
        if (!params) {
-               switch_event_create(&my_params, SWITCH_EVENT_MESSAGE);
+               switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
                switch_assert(my_params);
                params = my_params;
        }