From ce4cfc97c4a390b5f81d3a63e44f31a9c65e98b9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 11 Sep 2013 02:55:31 +0500 Subject: [PATCH] FS-5772 improve odds a little more but the phone is broken here --- src/include/switch_types.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 3 +-- src/switch_channel.c | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index f90f1e190e..1b28b5cd84 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1335,6 +1335,7 @@ typedef enum { CF_VIDEO_PASSIVE, CF_NOVIDEO, CF_VIDEO_ECHO, + CF_SLA_INTERCEPT, /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */ CF_FLAG_MAX diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index be0cfdde23..ca9ba7ddec 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8790,9 +8790,8 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); switch_channel_presence(b_channel, "unknown", "idle", NULL); - } - + switch_channel_set_flag(tech_pvt->channel, CF_SLA_INTERCEPT); tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "%sanswer,intercept:%s", codec_str, bridge_uuid); } else { diff --git a/src/switch_channel.c b/src/switch_channel.c index 771fd75042..950fb28257 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -740,7 +740,11 @@ SWITCH_DECLARE(void) switch_channel_perform_presence(switch_channel_t *channel, if (channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND) { call_info_state = "progressing"; } else { - call_info_state = "alerting"; + if (switch_channel_test_flag(channel, CF_SLA_INTERCEPT)) { + call_info_state = "idle"; + } else { + call_info_state = "alerting"; + } } }