FS-4676 --resolve
This commit is contained in:
parent
f66fbe2eaf
commit
03d702fabc
|
@ -4185,7 +4185,7 @@ void sofia_presence_handle_sip_i_publish(nua_t *nua, sofia_profile_t *profile, n
|
|||
rpid = act->child->name;
|
||||
}
|
||||
}
|
||||
if (zstr(note_txt)) note_txt = rpid;
|
||||
if (zstr(note_txt)) note_txt = "Available";
|
||||
}
|
||||
|
||||
if (!strcasecmp(open_closed, "closed")) {
|
||||
|
|
|
@ -1952,10 +1952,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
|
|||
|
||||
channel->running_state = state;
|
||||
|
||||
if (state == CS_ROUTING || state == CS_HANGUP) {
|
||||
switch_channel_presence(channel, "unknown", (const char *) state_names[state], NULL);
|
||||
}
|
||||
|
||||
if (state <= CS_DESTROY) {
|
||||
switch_event_t *event;
|
||||
|
||||
|
@ -2942,11 +2938,6 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
|
|||
switch_mutex_unlock(channel->state_mutex);
|
||||
|
||||
|
||||
if (hangup_cause == SWITCH_CAUSE_LOSE_RACE) {
|
||||
switch_channel_presence(channel, "unknown", "cancelled", NULL);
|
||||
switch_channel_set_variable(channel, "presence_call_info", NULL);
|
||||
}
|
||||
|
||||
switch_channel_set_callstate(channel, CCS_HANGUP);
|
||||
channel->hangup_cause = hangup_cause;
|
||||
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n",
|
||||
|
|
|
@ -342,6 +342,23 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
|
|||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "(%s) State %s going to sleep\n", switch_channel_get_name(session->channel), __STATE_STR); \
|
||||
} while (silly)
|
||||
|
||||
|
||||
static void check_presence(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_state_t state = switch_channel_get_running_state(session->channel);
|
||||
|
||||
if (state == CS_ROUTING || state == CS_HANGUP) {
|
||||
if (switch_channel_get_cause(session->channel) == SWITCH_CAUSE_LOSE_RACE) {
|
||||
switch_channel_presence(session->channel, "unknown", "cancelled", NULL);
|
||||
switch_channel_set_variable(session->channel, "presence_call_info", NULL);
|
||||
} else {
|
||||
switch_channel_presence(session->channel, "unknown", switch_channel_state_name(state), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_state_t state = CS_NEW, midstate = CS_DESTROY, endstate;
|
||||
|
@ -472,6 +489,8 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||
break;
|
||||
}
|
||||
|
||||
check_presence(session);
|
||||
|
||||
if (midstate == CS_DESTROY) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue