switch some usages of switch_event_add_header to switch_event_add_header_string
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9309 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f921389078
commit
05b01a6c03
|
@ -1845,10 +1845,10 @@ static void *SWITCH_THREAD_FUNC bgapi_exec(switch_thread_t *thread, void *obj)
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-UUID", "%s", job->uuid_str);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-Command", "%s", job->cmd);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", job->uuid_str);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command", job->cmd);
|
||||
if (arg) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", "%s", arg);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", arg);
|
||||
}
|
||||
|
||||
switch_event_add_body(event, "%s", reply);
|
||||
|
|
|
@ -388,9 +388,9 @@ static switch_status_t conference_add_event_data(conference_obj_t *conference, s
|
|||
{
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", "%s", conference->profile_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Conference-Profile-Name", conference->profile_name);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
@ -580,17 +580,17 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
|||
if (!switch_test_flag(member, MFLAG_NOCHANNEL)) {
|
||||
conference->count++;
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", conference->name, conference->domain);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Active (%d caller%s)", conference->count, conference->count == 1 ? "" : "s");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -640,7 +640,7 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
|||
if (test_eflag(conference, EFLAG_ADD_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -723,17 +723,17 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
|
|||
if (!switch_test_flag(member, MFLAG_NOCHANNEL)) {
|
||||
conference->count--;
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", conference->name, conference->domain);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Active (%d caller%s)", conference->count, conference->count == 1 ? "" : "s");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -757,7 +757,7 @@ static switch_status_t conference_del_member(conference_obj_t *conference, confe
|
|||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "del-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "del-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -1127,18 +1127,18 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
|
|||
end:
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", conference->name, conference->domain);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Inactive");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Inactive");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_HANGUP");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", "terminated");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ static void conference_loop_fn_energy_up(conference_member_t *member, caller_con
|
|||
if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1310,7 +1310,7 @@ static void conference_loop_fn_energy_equ_conf(conference_member_t *member, call
|
|||
if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1337,7 +1337,7 @@ static void conference_loop_fn_energy_dn(conference_member_t *member, caller_con
|
|||
if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1362,7 +1362,7 @@ static void conference_loop_fn_volume_talk_up(conference_member_t *member, calle
|
|||
if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1386,7 +1386,7 @@ static void conference_loop_fn_volume_talk_zero(conference_member_t *member, cal
|
|||
if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1411,7 +1411,7 @@ static void conference_loop_fn_volume_talk_dn(conference_member_t *member, calle
|
|||
if (test_eflag(member->conference, EFLAG_VOLUME_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1436,7 +1436,7 @@ static void conference_loop_fn_volume_listen_up(conference_member_t *member, cal
|
|||
if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1460,7 +1460,7 @@ static void conference_loop_fn_volume_listen_zero(conference_member_t *member, c
|
|||
if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1485,7 +1485,7 @@ static void conference_loop_fn_volume_listen_dn(conference_member_t *member, cal
|
|||
if (test_eflag(member->conference, EFLAG_GAIN_LEVEL) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -1500,8 +1500,8 @@ static void conference_loop_fn_event(conference_member_t *member, caller_control
|
|||
switch_event_t *event;
|
||||
if (test_eflag(member->conference, EFLAG_DTMF) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "dtmf");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-Key", "%s", action->binded_dtmf);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "dtmf");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "DTMF-Key", action->binded_dtmf);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -1557,7 +1557,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
|||
if (test_eflag(member->conference, EFLAG_STOP_TALKING) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -1609,7 +1609,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
|||
if (test_eflag(member->conference, EFLAG_FLOOR_CHANGE) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "floor-change");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-ID", "%d",
|
||||
member->conference->floor_holder ? member->conference->floor_holder->id : 0);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", member->conference->floor_holder ? member->id : 0);
|
||||
|
@ -1622,7 +1622,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
|||
if (test_eflag(member->conference, EFLAG_START_TALKING) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "start-talking");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-talking");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -1640,7 +1640,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
|
|||
if (test_eflag(member->conference, EFLAG_STOP_TALKING) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2737,7 +2737,7 @@ static switch_status_t conf_api_sub_mute(conference_member_t *member, switch_str
|
|||
if (test_eflag(member->conference, EFLAG_MUTE_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "mute-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "mute-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2766,7 +2766,7 @@ static switch_status_t conf_api_sub_unmute(conference_member_t *member, switch_s
|
|||
if (test_eflag(member->conference, EFLAG_UNMUTE_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "unmute-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unmute-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2786,7 +2786,7 @@ static switch_status_t conf_api_sub_deaf(conference_member_t *member, switch_str
|
|||
}
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "deaf-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "deaf-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2806,7 +2806,7 @@ static switch_status_t conf_api_sub_undeaf(conference_member_t *member, switch_s
|
|||
}
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "undeaf-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "undeaf-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2831,7 +2831,7 @@ static switch_status_t conf_api_sub_kick(conference_member_t *member, switch_str
|
|||
if (member->conference && test_eflag(member->conference, EFLAG_KICK_MEMBER)) {
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "kick-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "kick-member");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2866,8 +2866,8 @@ static switch_status_t conf_api_sub_dtmf(conference_member_t *member, switch_str
|
|||
if (test_eflag(member->conference, EFLAG_DTMF_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "dtmf-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Digits", "%s", dtmf);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "dtmf-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Digits", dtmf);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2892,7 +2892,7 @@ static switch_status_t conf_api_sub_energy(conference_member_t *member, switch_s
|
|||
if (test_eflag(member->conference, EFLAG_ENERGY_LEVEL_MEMBER) &&
|
||||
data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "energy-level-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Energy-Level", "%d", member->energy_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -2919,7 +2919,7 @@ static switch_status_t conf_api_sub_volume_in(conference_member_t *member, switc
|
|||
if (test_eflag(member->conference, EFLAG_VOLUME_IN_MEMBER) &&
|
||||
data && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-in-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-in-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%u", member->volume_in_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -2946,7 +2946,7 @@ static switch_status_t conf_api_sub_volume_out(conference_member_t *member, swit
|
|||
if (test_eflag(member->conference, EFLAG_VOLUME_OUT_MEMBER) && data &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-out-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "volume-out-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%u", member->volume_out_level);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -3036,8 +3036,8 @@ static switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_st
|
|||
if (test_eflag(conference, EFLAG_PLAY_FILE) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "play-file");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", "%s", argv[2]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "File", argv[2]);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
} else {
|
||||
|
@ -3054,8 +3054,8 @@ static switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_st
|
|||
if (test_eflag(conference, EFLAG_PLAY_FILE_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", "%s", argv[2]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "File", argv[2]);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
} else {
|
||||
|
@ -3087,8 +3087,8 @@ static switch_status_t conf_api_sub_say(conference_obj_t *conference, switch_str
|
|||
stream->write_function(stream, "(say) OK\n");
|
||||
if (test_eflag(conference, EFLAG_SPEAK_TEXT) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "speak-text");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Text", "%s", text);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "speak-text");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Text", text);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
@ -3146,8 +3146,8 @@ static switch_status_t conf_api_sub_saymember(conference_obj_t *conference, swit
|
|||
if (test_eflag(member->conference, EFLAG_SPEAK_TEXT_MEMBER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "speak-text-member");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Text", "%s", text);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "speak-text-member");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Text", text);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
ret_status = SWITCH_STATUS_SUCCESS;
|
||||
|
@ -3276,7 +3276,7 @@ static switch_status_t conf_api_sub_lock(conference_obj_t *conference, switch_st
|
|||
stream->write_function(stream, "OK %s locked\n", argv[0]);
|
||||
if (test_eflag(conference, EFLAG_LOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "lock");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "lock");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -3298,7 +3298,7 @@ static switch_status_t conf_api_sub_unlock(conference_obj_t *conference, switch_
|
|||
stream->write_function(stream, "OK %s unlocked\n", argv[0]);
|
||||
if (test_eflag(conference, EFLAG_UNLOCK) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_data(conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "unlock");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unlock");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -3458,9 +3458,9 @@ static switch_status_t conf_api_sub_transfer(conference_obj_t *conference, switc
|
|||
if (test_eflag(conference, EFLAG_TRANSFER) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_member_data(member, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", "%s", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", "%s", argv[3]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "transfer");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", argv[3]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "transfer");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -3930,8 +3930,8 @@ static void *SWITCH_THREAD_FUNC conference_outcall_run(switch_thread_t *thread,
|
|||
if (test_eflag(call->conference, EFLAG_BGDIAL_RESULT) &&
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
|
||||
conference_add_event_data(call->conference, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "bgdial-result");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Result", "%s", switch_channel_cause2str(cause));
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "bgdial-result");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Result", switch_channel_cause2str(cause));
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
switch_safe_free(call->bridgeto);
|
||||
|
@ -5181,32 +5181,32 @@ static void pres_event_handler(switch_event_t *event)
|
|||
|
||||
if ((conference = (conference_obj_t *) switch_core_hash_find(globals.conference_hash, conf_name))) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", conference->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conference->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", conference->name, conference->domain);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Active (%d caller%s)", conference->count, conference->count == 1 ? "" : "s");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conf_name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conf_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", conference->count == 1 ? "early" : "confirmed");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", conference->count == 1 ? "outbound" : "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
} else if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", conf_name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Idle");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", conf_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", to);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Idle");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", EC++);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", conf_name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_HANGUP");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", "terminated");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", conf_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -5236,12 +5236,12 @@ static void send_presence(switch_event_types_t id)
|
|||
switch_event_t *event;
|
||||
|
||||
if (name && switch_event_create(&event, id) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", status ? status : "Available");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", CONF_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status ? status : "Available");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "idle");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1024,14 +1024,14 @@ SWITCH_STANDARD_API(presence_api_function)
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, type) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "dp");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", __FILE__);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", argv[1]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "dp");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", __FILE__);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", argv[1]);
|
||||
if (type == SWITCH_EVENT_PRESENCE_IN) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", argv[2]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", argv[3]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", argv[2]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", argv[3]);
|
||||
}
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
stream->write_function(stream, "Event Sent");
|
||||
|
@ -2126,16 +2126,16 @@ static switch_status_t event_chat_send(char *proto, char *from, char *to, char *
|
|||
switch_event_t *event;
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_RECV_MESSAGE) == SWITCH_STATUS_SUCCESS) {
|
||||
if (proto) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Proto", "%s", proto);
|
||||
if (from) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "From", "%s", from);
|
||||
if (subject) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Subject", "%s", subject);
|
||||
if (hint) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hint", "%s", hint);
|
||||
if (proto) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Proto", proto);
|
||||
if (from) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "From", from);
|
||||
if (subject) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Subject", subject);
|
||||
if (hint) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Hint", hint);
|
||||
if (body) switch_event_add_body(event, "%s", body);
|
||||
if (to) {
|
||||
const char *v;
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "To", "%s", to);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "To", to);
|
||||
if ((v = switch_core_get_variable(to))) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Command", "%s", v);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Command", v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,23 +289,23 @@ static void send_presence(fifo_node_t *node)
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "%s", "park");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", node->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "park");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", node->name);
|
||||
if ((wait_count = node_consumer_wait_count(node)) > 0) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Active (%d waiting)", wait_count);
|
||||
} else {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Idle");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Idle");
|
||||
}
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", "unknown");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0);
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", wait_count > 0 ? "CS_ROUTING" : "CS_HANGUP");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", node->name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", wait_count > 0 ? "early" : "terminated");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", "inbound");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", wait_count > 0 ? "CS_ROUTING" : "CS_HANGUP");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", node->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", wait_count > 0 ? "early" : "terminated");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -540,8 +540,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
|||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "push");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "push");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Slot", "%d", p);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
@ -633,8 +633,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
|||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", cd.do_orbit ? "timeout" : "abort");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", cd.do_orbit ? "timeout" : "abort");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
switch_mutex_lock(node->mutex);
|
||||
|
@ -716,8 +716,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
|||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_start");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_start");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -847,15 +847,15 @@ SWITCH_STANDARD_APP(fifo_function)
|
|||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(other_channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "caller_pop");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "caller_pop");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_pop");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_pop");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -979,8 +979,8 @@ SWITCH_STANDARD_APP(fifo_function)
|
|||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Name", "%s", argv[0]);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_stop");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "consumer_stop");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,10 @@ static switch_bool_t snom_bind_key(const char *key,
|
|||
|
||||
if (user && host && profile) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "user", "%s", user);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "host", "%s", host);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "profile", "%s", profile);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "content-type", "application/x-buttons");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user", user);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "host", host);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "profile", profile);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "content-type", "application/x-buttons");
|
||||
if (action && action_name) {
|
||||
switch_event_add_body(event, "k=%s\nc=%s\nl=%s\nn=%s\na=%s\n", key, light, label, action, action_name);
|
||||
} else {
|
||||
|
|
|
@ -1263,7 +1263,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
|
|||
/* this isnt done? it was in the other place
|
||||
* switch_channel_event_set_data(channel, event);
|
||||
*/
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "forwarded-voicemail");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Message-Type", "forwarded-voicemail");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -1462,8 +1462,8 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
|
|||
}
|
||||
mwi_id = switch_mprintf("%s@%s", myid, domain_name);
|
||||
switch_assert(mwi_id);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "%s", yn);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", mwi_id);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", yn);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", mwi_id);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Voice-Message", "%d/%d (%d/%d)",
|
||||
total_new_messages, total_saved_messages, total_new_urgent_messages, total_saved_urgent_messages);
|
||||
switch_event_fire(&event);
|
||||
|
@ -1868,8 +1868,8 @@ static void deliver_vm(vm_profile_t *profile,
|
|||
yn = "yes";
|
||||
}
|
||||
mwi_id = switch_mprintf("%s@%s", myid, domain_name);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "%s", yn);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", mwi_id);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", yn);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", mwi_id);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "MWI-Voice-Message", "%d/%d (%d/%d)",
|
||||
total_new_messages, total_saved_messages, total_new_urgent_messages, total_saved_urgent_messages);
|
||||
switch_event_fire(&event);
|
||||
|
@ -1965,7 +1965,7 @@ static void deliver_vm(vm_profile_t *profile,
|
|||
switch_event_dup(&event, params);
|
||||
|
||||
if (event) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2014,7 +2014,7 @@ static void deliver_vm(vm_profile_t *profile,
|
|||
switch_event_dup(&event, params);
|
||||
|
||||
if (event) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail-notify");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Message-Type", "voicemail-notify");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2622,8 +2622,8 @@ static void message_query_handler(switch_event_t *event)
|
|||
if (total_new_messages || total_new_urgent_messages) {
|
||||
yn = "yes";
|
||||
}
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "%s", yn);
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", account);
|
||||
switch_event_add_header_string(new_event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", yn);
|
||||
switch_event_add_header_string(new_event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", account);
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, "MWI-Voice-Message", "%d/%d (%d/%d)",
|
||||
total_new_messages, total_saved_messages, total_new_urgent_messages, total_saved_urgent_messages);
|
||||
created++;
|
||||
|
@ -2638,8 +2638,8 @@ static void message_query_handler(switch_event_t *event)
|
|||
|
||||
if (!created) {
|
||||
if (switch_event_create(&new_event, SWITCH_EVENT_MESSAGE_WAITING) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "no");
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", account);
|
||||
switch_event_add_header_string(new_event, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", "no");
|
||||
switch_event_add_header_string(new_event, SWITCH_STACK_BOTTOM, "MWI-Message-Account", account);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2648,7 +2648,7 @@ static void message_query_handler(switch_event_t *event)
|
|||
|
||||
for (hp = event->headers; hp; hp = hp->next) {
|
||||
if (!strncasecmp(hp->name, "vm-", 3)) {
|
||||
switch_event_add_header(new_event, SWITCH_STACK_BOTTOM, hp->name + 3, hp->value);
|
||||
switch_event_add_header_string(new_event, SWITCH_STACK_BOTTOM, hp->name + 3, hp->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -624,11 +624,11 @@ static int sin_callback(void *pArg, int argc, char **argv, char **columnNames)
|
|||
|
||||
if (is_special(sub_to)) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", sub_to);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "available");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Online");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", sub_to);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "available");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Online");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2367,11 +2367,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
#if 0
|
||||
if (is_special(to)) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
|
||||
//switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", to);
|
||||
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2380,8 +2380,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
break;
|
||||
case LDL_SIGNAL_ROSTER:
|
||||
if (switch_event_create(&event, SWITCH_EVENT_ROSTER) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
break;
|
||||
|
@ -2390,10 +2390,10 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call", profile->avatar);
|
||||
} else {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2407,11 +2407,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", msg);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", subject);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", msg);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", subject);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -2422,11 +2422,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
#if 0
|
||||
if (is_special(to)) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
|
||||
//switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", to);
|
||||
//switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -2441,9 +2441,9 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
switch_core_db_free(sql);
|
||||
}
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->login);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
break;
|
||||
|
@ -2496,7 +2496,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
break;
|
||||
case LDL_SIGNAL_LOGIN_SUCCESS:
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_SUCCESS) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", ldl_handle_get_login(profile->handle));
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
if (profile->user_flags & LDL_FLAG_COMPONENT) {
|
||||
|
@ -2506,13 +2506,13 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
break;
|
||||
case LDL_SIGNAL_LOGIN_FAILURE:
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_FAILURE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", ldl_handle_get_login(profile->handle));
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
break;
|
||||
case LDL_SIGNAL_CONNECTED:
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_CONNECTED) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", ldl_handle_get_login(profile->handle));
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
break;
|
||||
|
@ -2706,17 +2706,17 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||
from = freeme;
|
||||
}
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hint", "%s", hint);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "%s", subject);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", ldl_handle_get_login(profile->handle));
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", hint);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", subject);
|
||||
if (msg) {
|
||||
switch_event_add_body(event, "%s", msg);
|
||||
}
|
||||
if (switch_core_session_queue_event(tech_pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
|
|
@ -908,7 +908,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IAX Ready Port %d\n", globals.port);
|
||||
|
||||
if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_iax2._udp");
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "service", "_iax2._udp");
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", globals.port);
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
|
|
@ -244,8 +244,8 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
|||
switch_snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id);
|
||||
|
||||
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_RINGING) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_info", "%s", buf);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call_id", "%s", tech_pvt->call_id);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_info", buf);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call_id", tech_pvt->call_id);
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
|
|
@ -613,13 +613,13 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||
(sofia_test_pflag(profile, PFLAG_TLS)) ? ",_sips._tcp" : "");
|
||||
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "module_name", "%s", "mod_sofia");
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_name", "%s", profile->name);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_uri", "%s", profile->url);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "module_name", "mod_sofia");
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_name", profile->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_uri", profile->url);
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_TLS)) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "tls_port", "%d", profile->tls_sip_port);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_tls_uri", "%s", profile->tls_url);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_tls_uri", profile->tls_url);
|
||||
}
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
@ -673,13 +673,13 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||
(sofia_test_pflag(profile, PFLAG_TLS)) ? ",_sips._tcp" : "");
|
||||
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "module_name", "%s", "mod_sofia");
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_name", "%s", profile->name);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_uri", "%s", profile->url);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "module_name", "mod_sofia");
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_name", profile->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_uri", profile->url);
|
||||
|
||||
if (sofia_test_pflag(profile, PFLAG_TLS)) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "tls_port", "%d", profile->tls_sip_port);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile_tls_uri", "%s", profile->tls_url);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile_tls_uri", profile->tls_url);
|
||||
}
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
|
|
@ -653,7 +653,7 @@ static int sofia_presence_sub_reg_callback(void *pArg, int argc, char **argv, ch
|
|||
if (!strcasecmp(event_name, "message-summary")) {
|
||||
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_add_header(event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", "%s", profile->name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
return 0;
|
||||
|
@ -663,13 +663,13 @@ static int sofia_presence_sub_reg_callback(void *pArg, int argc, char **argv, ch
|
|||
status = "Available";
|
||||
}
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", user, host);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", status);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto-specific-event-name", "%s", event_name);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event_name);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
||||
|
@ -707,29 +707,29 @@ static int sofia_presence_resub_callback(void *pArg, int argc, char **argv, char
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "%s", proto ? proto : SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", proto ? proto : SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", user, host);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", status);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0);
|
||||
|
||||
if (!switch_strlen_zero(to_user)) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to-user", "%s", to_user);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to-user", to_user);
|
||||
}
|
||||
|
||||
if (switch_strlen_zero(state)) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_HANGUP");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", "resubscribe");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "resubscribe");
|
||||
} else {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-state", "%s", "CS_ROUTING");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "unique-id", "%s", uuid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "answer-state", "%s", state);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "astate", "%s", state);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-direction", "%s", direction);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", uuid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", state);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "astate", state);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", direction);
|
||||
}
|
||||
|
||||
switch_event_fire(&event);
|
||||
|
@ -1334,21 +1334,21 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||
}
|
||||
|
||||
if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "proto", protocol);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "login", "%s", profile->name);
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", protocol);
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, to_host);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "rpid", "active");
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "rpid", "active");
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "status", "Click To Call");
|
||||
switch_event_fire(&sevent);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (switch_event_create(&sevent, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "login", "%s", profile->name);
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "login", profile->name);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host);
|
||||
switch_event_add_header(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", "%s", event);
|
||||
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "proto-specific-event-name", event);
|
||||
switch_event_fire(&sevent);
|
||||
}
|
||||
}
|
||||
|
@ -1553,23 +1553,23 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
|||
|
||||
if (in) {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", note_txt);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "%s", event_type);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", note_txt);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
} else {
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", from_user, from_host);
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "%s", event_type);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", event_type);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -1670,18 +1670,18 @@ void sofia_presence_handle_sip_i_message(int status,
|
|||
if ((tech_pvt = (private_object_t *) switch_core_hash_find(profile->chat_hash, hash_key))) {
|
||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from_addr);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hint", "%s", full_from);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to_addr);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from_addr);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", full_from);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to_addr);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
|
||||
if (msg) {
|
||||
switch_event_add_body(event, "%s", msg);
|
||||
}
|
||||
|
||||
if (switch_core_session_queue_event(tech_pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -292,13 +292,13 @@ int sofia_reg_del_callback(void *pArg, int argc, char **argv, char **columnNames
|
|||
|
||||
if (argc >= 3) {
|
||||
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_EXPIRE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile-name", "%s", argv[8]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "call-id", "%s", argv[0]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "user", "%s", argv[1]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "host", "%s", argv[2]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s", argv[3]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%s", argv[6]);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "user-agent", "%s", argv[7]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", argv[8]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", argv[0]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user", argv[1]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "host", argv[2]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", argv[3]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "expires", argv[6]);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", argv[7]);
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
}
|
||||
|
@ -763,15 +763,15 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
switch_mutex_unlock(profile->ireg_mutex);
|
||||
|
||||
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REGISTER) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile-name", "%s", profile->name);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-user", "%s", to_user);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-host", "%s", to_host);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s", contact_str);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "call-id", "%s", call_id);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", profile->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-user", to_user);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-host", to_host);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", contact_str);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", call_id);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%ld", (long) exptime);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "to-user", "%s", from_user);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "to-host", "%s", from_host);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "to-user", from_user);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "to-host", from_host);
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
||||
|
@ -783,14 +783,14 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
}
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, to_host);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, to_host);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Registered");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
} else {
|
||||
|
@ -821,13 +821,13 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
}
|
||||
}
|
||||
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "sip");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s+%s@%s", SOFIA_CHAT_PROTO, to_user, to_host);
|
||||
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "unavailable");
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "unavailable");
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
}
|
||||
|
@ -843,16 +843,16 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||
|
||||
if (switch_event_create(&s_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", to_user, to_host);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", "%s", profile->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
|
||||
}
|
||||
} else {
|
||||
if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_UNREGISTER) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "profile-name", "%s", profile->name);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-user", "%s", to_user);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "from-host", "%s", to_host);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "contact", "%s", contact_str);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "call-id", "%s", call_id);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", profile->name);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-user", to_user);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-host", to_host);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", contact_str);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", call_id);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", rpid);
|
||||
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%ld", (long) exptime);
|
||||
}
|
||||
}
|
||||
|
@ -1391,12 +1391,12 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
|
|||
switch_xml_t xparams[2];
|
||||
int i = 0;
|
||||
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "sip_mailbox", "%s", mailbox);
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_username", "%s", username);
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_realm", "%s", realm);
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "mailbox", "%s", mailbox);
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "user_name", "%s", username);
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, "domain_name", "%s", realm);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_mailbox", mailbox);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_username", username);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_realm", realm);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "mailbox", mailbox);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "user_name", username);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "domain_name", realm);
|
||||
|
||||
if ((dparams = switch_xml_child(domain, "variables"))) {
|
||||
xparams[i++] = dparams;
|
||||
|
@ -1416,7 +1416,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
|
|||
sofia_gateway_t *gateway_ptr = NULL;
|
||||
|
||||
if (!switch_strlen_zero(var) && !switch_strlen_zero(val)) {
|
||||
switch_event_add_header(*v_event, SWITCH_STACK_BOTTOM, var, "%s", val);
|
||||
switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, var, val);
|
||||
|
||||
if (!strcasecmp(var, "register-gateway")) {
|
||||
if (!strcasecmp(val, "all")) {
|
||||
|
|
|
@ -168,7 +168,7 @@ static void event_handler(switch_event_t *event)
|
|||
case SWITCH_EVENT_LOG:
|
||||
return;
|
||||
default:
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Multicast-Sender", "%s", globals.hostname);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Multicast-Sender", globals.hostname);
|
||||
if (switch_event_serialize(event, &packet, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
|
||||
size_t len = strlen(packet) + sizeof(globals.host_hash);
|
||||
char *buf = malloc(len + 1);
|
||||
|
@ -309,7 +309,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
|
|||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nEVENT %d\n--------------------------------\n%s\n", (int) len, packet);
|
||||
if (switch_event_create_subclass(&local_event, SWITCH_EVENT_CUSTOM, MULTICAST_EVENT) == SWITCH_STATUS_SUCCESS) {
|
||||
char *var, *val, *term = NULL, tmpname[128];
|
||||
switch_event_add_header(local_event, SWITCH_STACK_BOTTOM, "Multicast", "yes");
|
||||
switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, "Multicast", "yes");
|
||||
var = packet;
|
||||
while (*var) {
|
||||
if ((val = strchr(var, ':')) != 0) {
|
||||
|
@ -324,7 +324,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
|
|||
}
|
||||
}
|
||||
switch_snprintf(tmpname, sizeof(tmpname), "Orig-%s", var);
|
||||
switch_event_add_header(local_event, SWITCH_STACK_BOTTOM, tmpname, "%s", val);
|
||||
switch_event_add_header_string(local_event, SWITCH_STACK_BOTTOM, tmpname, val);
|
||||
var = term + 1;
|
||||
} else {
|
||||
break;
|
||||
|
|
|
@ -481,7 +481,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
|
|||
}
|
||||
}
|
||||
if (var && val) {
|
||||
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, var, "%s", val);
|
||||
switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, var, val);
|
||||
if (!strcasecmp(var, "content-length")) {
|
||||
clen = atoi(val);
|
||||
|
||||
|
@ -655,10 +655,10 @@ static void *SWITCH_THREAD_FUNC api_exec(switch_thread_t *thread, void *obj)
|
|||
switch_event_t *event;
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-UUID", "%s", acs->uuid_str);
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-Command", "%s", acs->api_cmd);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-UUID", acs->uuid_str);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command", acs->api_cmd);
|
||||
if (acs->arg) {
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", "%s", acs->arg);
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Job-Command-Arg", acs->arg);
|
||||
}
|
||||
switch_event_add_body(event, "%s", reply);
|
||||
switch_event_fire(&event);
|
||||
|
@ -1186,10 +1186,10 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
|||
|
||||
switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event);
|
||||
switch_channel_event_set_data(channel, call_event);
|
||||
switch_event_add_header(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply");
|
||||
switch_event_add_header(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n");
|
||||
switch_event_add_header(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static");
|
||||
switch_event_add_header(call_event, SWITCH_STACK_BOTTOM, "Control", switch_test_flag(listener, LFLAG_FULL) ? "full" : "single-channel");
|
||||
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply");
|
||||
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n");
|
||||
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static");
|
||||
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Control", switch_test_flag(listener, LFLAG_FULL) ? "full" : "single-channel");
|
||||
|
||||
switch_event_serialize(call_event, &event_str, SWITCH_TRUE);
|
||||
if (!event_str) {
|
||||
|
|
|
@ -195,7 +195,7 @@ static JSBool request_add_header(JSContext * cx, JSObject * obj, uintN argc, jsv
|
|||
if (argc > 1) {
|
||||
char *hname = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
char *hval = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
|
||||
switch_event_add_header(ro->stream->param_event, SWITCH_STACK_BOTTOM, hname, "%s", hval);
|
||||
switch_event_add_header_string(ro->stream->param_event, SWITCH_STACK_BOTTOM, hname, hval);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -547,7 +547,7 @@ static JSBool event_add_header(JSContext * cx, JSObject * obj, uintN argc, jsval
|
|||
if (argc > 1) {
|
||||
char *hname = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
char *hval = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
|
||||
switch_event_add_header(eo->event, SWITCH_STACK_BOTTOM, hname, "%s", hval);
|
||||
switch_event_add_header_string(eo->event, SWITCH_STACK_BOTTOM, hname, hval);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -521,30 +521,30 @@ abyss_bool handler_hook(TSession * r)
|
|||
const char *const content_length = RequestHeaderValue(r, "content-length");
|
||||
|
||||
if (html)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "%s", "text/html");
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/html");
|
||||
else if (text)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "%s", "text/plain");
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/plain");
|
||||
if (fs_user)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-User", "%s", fs_user);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-User", fs_user);
|
||||
if (fs_domain)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Domain", "%s", fs_domain);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-Domain", fs_domain);
|
||||
if (path_info)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-Path-Info", "%s", path_info);
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-URI", "%s", r->requestInfo.uri);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-Path-Info", path_info);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-URI", r->requestInfo.uri);
|
||||
if (r->requestInfo.query)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", "%s", r->requestInfo.query);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", r->requestInfo.query);
|
||||
if (r->requestInfo.host)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-HOST", "%s", r->requestInfo.host);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-HOST", r->requestInfo.host);
|
||||
if (r->requestInfo.from)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-FROM", "%s", r->requestInfo.from);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-FROM", r->requestInfo.from);
|
||||
if (r->requestInfo.useragent)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-USER-AGENT", "%s", r->requestInfo.useragent);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-USER-AGENT", r->requestInfo.useragent);
|
||||
if (r->requestInfo.referer)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-REFERER", "%s", r->requestInfo.referer);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-REFERER", r->requestInfo.referer);
|
||||
if (r->requestInfo.requestline)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-REQUESTLINE", "%s", r->requestInfo.requestline);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-REQUESTLINE", r->requestInfo.requestline);
|
||||
if (r->requestInfo.user)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-USER", "%s", r->requestInfo.user);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-USER", r->requestInfo.user);
|
||||
if (r->requestInfo.port)
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-PORT", "%u", r->requestInfo.port);
|
||||
if (r->requestInfo.query || content_length) {
|
||||
|
@ -586,7 +586,7 @@ abyss_bool handler_hook(TSession * r)
|
|||
}
|
||||
}
|
||||
if (query) {
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", "%s", query);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", query);
|
||||
|
||||
qd = strdup(query);
|
||||
switch_assert(qd != NULL);
|
||||
|
@ -612,7 +612,7 @@ abyss_bool handler_hook(TSession * r)
|
|||
name = q;
|
||||
if ((val = strchr(name, '='))) {
|
||||
*val++ = '\0';
|
||||
switch_event_add_header(stream.param_event, SWITCH_STACK_BOTTOM, name, "%s", val);
|
||||
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, name, val);
|
||||
}
|
||||
q = next;
|
||||
} while (q != NULL);
|
||||
|
|
Loading…
Reference in New Issue