mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-01 03:05:50 +00:00
always update state to CS_HANGUP for now, even if the channel is gone to handle race where we miss this update
This commit is contained in:
parent
ab99143d5f
commit
4fcf7c3443
@ -1756,7 +1756,7 @@ static char *parse_presence_data_cols(switch_event_t *event)
|
|||||||
|
|
||||||
#define MAX_SQL 5
|
#define MAX_SQL 5
|
||||||
#define new_sql() switch_assert(sql_idx+1 < MAX_SQL); if (exists) sql[sql_idx++]
|
#define new_sql() switch_assert(sql_idx+1 < MAX_SQL); if (exists) sql[sql_idx++]
|
||||||
#define new_sql_f() switch_assert(sql_idx+1 < MAX_SQL); if (force_exists) sql[sql_idx++]
|
#define new_sql_a() switch_assert(sql_idx+1 < MAX_SQL); sql[sql_idx++]
|
||||||
|
|
||||||
static void core_event_handler(switch_event_t *event)
|
static void core_event_handler(switch_event_t *event)
|
||||||
{
|
{
|
||||||
@ -1764,7 +1764,6 @@ static void core_event_handler(switch_event_t *event)
|
|||||||
int sql_idx = 0;
|
int sql_idx = 0;
|
||||||
char *extra_cols;
|
char *extra_cols;
|
||||||
int exists = 1;
|
int exists = 1;
|
||||||
int force_exists = 1;
|
|
||||||
char *uuid = NULL;
|
char *uuid = NULL;
|
||||||
|
|
||||||
switch_assert(event);
|
switch_assert(event);
|
||||||
@ -1786,10 +1785,7 @@ static void core_event_handler(switch_event_t *event)
|
|||||||
case SWITCH_EVENT_CALL_SECURE:
|
case SWITCH_EVENT_CALL_SECURE:
|
||||||
{
|
{
|
||||||
if ((uuid = switch_event_get_header(event, "unique-id"))) {
|
if ((uuid = switch_event_get_header(event, "unique-id"))) {
|
||||||
force_exists = exists = switch_ivr_uuid_exists(uuid);
|
exists = switch_ivr_uuid_exists(uuid);
|
||||||
if (!exists) {
|
|
||||||
force_exists = switch_ivr_uuid_force_exists(uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1980,6 +1976,11 @@ static void core_event_handler(switch_event_t *event)
|
|||||||
//case CS_HANGUP: /* marked for deprication */
|
//case CS_HANGUP: /* marked for deprication */
|
||||||
case CS_INIT:
|
case CS_INIT:
|
||||||
break;
|
break;
|
||||||
|
case CS_HANGUP: /* marked for deprication */
|
||||||
|
new_sql_a() = switch_mprintf("update channels set state='%s' where uuid='%s'",
|
||||||
|
switch_event_get_header_nil(event, "channel-state"),
|
||||||
|
switch_event_get_header_nil(event, "unique-id"));
|
||||||
|
break;
|
||||||
case CS_EXECUTE:
|
case CS_EXECUTE:
|
||||||
if ((extra_cols = parse_presence_data_cols(event))) {
|
if ((extra_cols = parse_presence_data_cols(event))) {
|
||||||
new_sql() = switch_mprintf("update channels set state='%s',%s where uuid='%q'",
|
new_sql() = switch_mprintf("update channels set state='%s',%s where uuid='%q'",
|
||||||
@ -2038,7 +2039,7 @@ static void core_event_handler(switch_event_t *event)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
new_sql_f() = switch_mprintf("update channels set state='%s' where uuid='%s'",
|
new_sql() = switch_mprintf("update channels set state='%s' where uuid='%s'",
|
||||||
switch_event_get_header_nil(event, "channel-state"),
|
switch_event_get_header_nil(event, "channel-state"),
|
||||||
switch_event_get_header_nil(event, "unique-id"));
|
switch_event_get_header_nil(event, "unique-id"));
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user