if (count) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
- if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", lot_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", lot_name, domain_name);
-
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "force-status", "Active (%d caller%s)", count, count == 1 ? "" : "s");
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "active");
- 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_string(event, SWITCH_STACK_BOTTOM, "unique-id", lot_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", "confirmed");
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound");
- switch_event_fire(&event);
- }
- found++;
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", lot_name);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", lot_name, domain_name);
+
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "force-status", "Active (%d caller%s)", count, count == 1 ? "" : "s");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", "active");
+ 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_string(event, SWITCH_STACK_BOTTOM, "unique-id", lot_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", "confirmed");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-direction", "inbound");
+ switch_event_fire(&event);
}
+ found++;
} else {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", VALET_PROTO);