aboutsummaryrefslogtreecommitdiff
path: root/src/callnotifier/CallMonitor.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-08-02 21:30:15 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-08-02 21:30:15 +0200
commitb1fe50cb5391273bc40902660ceee038d846ca35 (patch)
treed1e89df31e3c2de417eb94520a1b76b594c78b41 /src/callnotifier/CallMonitor.php
parent8e44aa0931cae4a831f81a22dd1f215998ae9d23 (diff)
downloadauerswald-callnotifier-b1fe50cb5391273bc40902660ceee038d846ca35.tar.gz
auerswald-callnotifier-b1fe50cb5391273bc40902660ceee038d846ca35.zip
filter out duplicate incoming calls
Diffstat (limited to 'src/callnotifier/CallMonitor.php')
-rw-r--r--src/callnotifier/CallMonitor.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/callnotifier/CallMonitor.php b/src/callnotifier/CallMonitor.php
index be155e1..b8f904d 100644
--- a/src/callnotifier/CallMonitor.php
+++ b/src/callnotifier/CallMonitor.php
@@ -49,7 +49,7 @@ class CallMonitor
$call->type = CallMonitor_Call::OUTGOING;
}
- $this->handleParams($call, $msg);
+ $this->handleParams($msg, $call, $callId);
}
@@ -59,7 +59,7 @@ class CallMonitor
switch ($msg->type) {
case EDSS1_Message::INFORMATION:
- $this->handleParams($call, $msg);
+ $this->handleParams($msg, $call, $callId);
break;
case EDSS1_Message::ALERTING:
if ($call->type == CallMonitor_Call::OUTGOING) {
@@ -94,7 +94,7 @@ class CallMonitor
}
}
- protected function handleParams($call, $msg)
+ protected function handleParams($msg, $call, $callId)
{
foreach ($msg->parameters as $param) {
switch ($param->type) {
@@ -107,7 +107,18 @@ class CallMonitor
$call->to = $this->getFullNumber(
$param->number, $param->numberType
);
+ if ($call->type == CallMonitor_Call::INCOMING
+ && $param->numberType != EDSS1_Parameter_Names::NUMBER_SUBSCRIBER
+ ) {
+ //only keep incoming calls that arrive at the switchboard,
+ // not the ones from the switchboard to the telephones
+ unset($this->currentCalls[$callId]);
+ }
break;
+ case EDSS1_Parameter::KEYPAD:
+ if ($call->to === null) {
+ $call->to = $param->data;
+ }
}
}
}