mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 15:14:17 +00:00
add some more specific events
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9789 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
f23c88d9fa
commit
003847dd0d
21 files changed
+53
-43
No files matched your search
@@ -70,7 +70,7 @@ SWITCH_STANDARD_API(user_data_function)
|
||||
domain = "cluecon.com";
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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")) {
|
||||
|
||||
@@ -3390,7 +3390,7 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, SWITCH_EVENT_COMMAND);
|
||||
switch_assert(params);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "presence", "true");
|
||||
|
||||
|
||||
@@ -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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id);
|
||||
|
||||
|
||||
@@ -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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
|
||||
switch_channel_event_set_data(channel, params);
|
||||
|
||||
@@ -2267,7 +2267,7 @@ static void do_vcard(ldl_handle_t *handle, char *to, char *from, char *id)
|
||||
goto end;
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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);
|
||||
|
||||
@@ -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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", profile_name);
|
||||
|
||||
|
||||
@@ -1251,7 +1251,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
|
||||
free(sql);
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, 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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -202,7 +202,7 @@ static abyss_bool http_directory_auth(TSession * r, char *domain_name)
|
||||
goto authed;
|
||||
}
|
||||
|
||||
switch_event_create(¶ms, SWITCH_EVENT_MESSAGE);
|
||||
switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(params);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check");
|
||||
|
||||
|
||||
Reference in new issue
Block a user