提交 00c46450 authored 作者: William King's avatar William King

In a case where calls to phones with presence enabled as well as presence disabled,

there were cases where the presence enabled calls weren't turning off lights
due to the fact that there were calls still up on the phone(though those calls had presence disabled).
上级 c94dd25e
...@@ -644,15 +644,31 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) ...@@ -644,15 +644,31 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
static int sofia_presence_dialog_callback(void *pArg, int argc, char **argv, char **columnNames) static int sofia_presence_dialog_callback(void *pArg, int argc, char **argv, char **columnNames)
{ {
struct dialog_helper *helper = (struct dialog_helper *) pArg; struct dialog_helper *helper = (struct dialog_helper *) pArg;
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
int done = 0;
if (argc >= 4) { if (argc >= 4) {
if (argc == 5 && !zstr(argv[4])) { if (argc == 5 && !zstr(argv[4])) {
if (!switch_ivr_uuid_exists(argv[4])) { if ((session = switch_core_session_locate(argv[4]))) {
channel = switch_core_session_get_channel(session);
if (!switch_channel_test_flag(channel, CF_ANSWERED) &&
switch_true(switch_channel_get_variable_dup(channel, "presence_disable_early", SWITCH_FALSE, -1))) {
done++;
}
switch_core_session_rwunlock(session);
} else {
return 0; return 0;
} }
} }
if (done) {
return 0;
}
if (mod_sofia_globals.debug_presence > 0) { if (mod_sofia_globals.debug_presence > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "CHECK DIALOG state[%s] status[%s] rpid[%s] pres[%s] uuid[%s]\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "CHECK DIALOG state[%s] status[%s] rpid[%s] pres[%s] uuid[%s]\n",
argv[0], argv[1], argv[2], argv[3], argv[4]); argv[0], argv[1], argv[2], argv[3], argv[4]);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论