diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index cc4639cd0d..5e909f1ab5 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -806,24 +806,22 @@ static void pres_event_handler(switch_event_t *event) 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_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(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);