diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-15 17:19:28 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-15 17:19:28 +0000 |
commit | eb5f9ff2a19b8e283b71adc36f0a33040b759eb0 (patch) | |
tree | af86572efdc2f3d4e03e9615e4217258322b4c61 | |
parent | a336b1af16fead3cab01ebfb30da491c7b6747bd (diff) |
Update the SLAStation application to account for the case where the SLA thread
has a call out to the station, but the user has pressed a line button to answer
the call instead of picking up the handset. If they do, the phone sends out a
new INVITE. So, the SLAStation app must check to see if it is picking up a
ringing trunk, and ensure that the other stations stop ringing.
(reported internally, patched by me, tested by mogorman)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89296 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_meetme.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c index ef5af4c40..63cc0f346 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -4171,6 +4171,29 @@ static int sla_station_exec(struct ast_channel *chan, void *data) trunk_ref->state = SLA_TRUNK_STATE_UP; ast_device_state_changed("SLA:%s_%s", station->name, trunk_ref->trunk->name); } + } else if (trunk_ref->state == SLA_TRUNK_STATE_RINGING) { + struct sla_ringing_trunk *ringing_trunk; + + ast_mutex_lock(&sla.lock); + AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_trunks, ringing_trunk, entry) { + if (ringing_trunk->trunk == trunk_ref->trunk) { + AST_LIST_REMOVE_CURRENT(&sla.ringing_trunks, entry); + break; + } + } + AST_LIST_TRAVERSE_SAFE_END + ast_mutex_unlock(&sla.lock); + + if (ringing_trunk) { + ast_answer(ringing_trunk->trunk->chan); + sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_UP, ALL_TRUNK_REFS, NULL); + + free(ringing_trunk); + + /* Queue up reprocessing ringing trunks, and then ringing stations again */ + sla_queue_event(SLA_EVENT_RINGING_TRUNK); + sla_queue_event(SLA_EVENT_DIAL_STATE); + } } trunk_ref->chan = chan; |