diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-08-02 18:18:51 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-08-02 18:18:51 +0200 |
| commit | 072ead85ee2f9a2979ec888c5f75a0fa2e1d34f6 (patch) | |
| tree | 2dc19bcbb9ac62f596ae9ba4f3756d3276544605 /src/callnotifier/CallMonitor.php | |
| parent | 84708b02e32a6774c20a90d0c2cdc63dd9f11ab7 (diff) | |
| download | auerswald-callnotifier-072ead85ee2f9a2979ec888c5f75a0fa2e1d34f6.tar.gz auerswald-callnotifier-072ead85ee2f9a2979ec888c5f75a0fa2e1d34f6.zip | |
filter out the ("duplicate") internal call on outgoing calls
Diffstat (limited to 'src/callnotifier/CallMonitor.php')
| -rw-r--r-- | src/callnotifier/CallMonitor.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/callnotifier/CallMonitor.php b/src/callnotifier/CallMonitor.php index ebc9a50..be155e1 100644 --- a/src/callnotifier/CallMonitor.php +++ b/src/callnotifier/CallMonitor.php @@ -62,6 +62,26 @@ class CallMonitor $this->handleParams($call, $msg); break; case EDSS1_Message::ALERTING: + if ($call->type == CallMonitor_Call::OUTGOING) { + /** + * There may be two alerts: One from the telephone to the + * switchboard, and one from the switchboard to the target. + * + * The alert from the switchboard to the target call is + * sent first, so we can remove the call from the telephone + * to the switchboard. + */ + $bFound = false; + foreach ($this->currentCalls as $otherCallId => $otherCall) { + if ($otherCallId != $callId && $otherCall->to == $call->to) { + $bFound = true; + break; + } + } + if ($bFound) { + unset($this->currentCalls[$otherCallId]); + } + } $this->log->log('startingCall', array('call' => $call)); break; |
