git.cweiske.de
/
auerswald-callnotifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add incoming/outgoing type to calls
[auerswald-callnotifier.git]
/
src
/
callnotifier
/
Logger
/
CallEcho.php
diff --git
a/src/callnotifier/Logger/CallEcho.php
b/src/callnotifier/Logger/CallEcho.php
index fe8b9b48af258c8ab21a6fc79431a276bcf85eb8..825bc2476a1cbf6465ad52010714a5553072a2b4 100644
(file)
--- a/
src/callnotifier/Logger/CallEcho.php
+++ b/
src/callnotifier/Logger/CallEcho.php
@@
-6,8
+6,8
@@
class Logger_CallEcho implements Logger
public function log($type, $arData)
{
switch ($type) {
public function log($type, $arData)
{
switch ($type) {
- case '
incom
ingCall':
- $this->display
Incoming
($arData['call']);
+ case '
start
ingCall':
+ $this->display
Start
($arData['call']);
break;
case 'finishedCall':
$this->displayFinished($arData['call']);
break;
case 'finishedCall':
$this->displayFinished($arData['call']);
@@
-16,18
+16,26
@@
class Logger_CallEcho implements Logger
}
}
- protected function display
Incoming
(CallMonitor_Call $call)
+ protected function display
Start
(CallMonitor_Call $call)
{
{
- echo 'Incoming call from ' . $call->from
+ echo 'Starting ' . $this->getTypeName($call)
+ . ' call from ' . $call->from
. ' to ' . $call->to . "\n";
}
protected function displayFinished(CallMonitor_Call $call)
{
. ' to ' . $call->to . "\n";
}
protected function displayFinished(CallMonitor_Call $call)
{
- echo 'Finished call from ' . $call->from
+ echo 'Finished ' . $this->getTypeName($call)
+ . ' call from ' . $call->from
. ' to ' . $call->to
. ', length ' . date('H:i:s', $call->end - $call->start - 3600)
. "\n";
}
. ' to ' . $call->to
. ', length ' . date('H:i:s', $call->end - $call->start - 3600)
. "\n";
}
+
+ protected function getTypeName($call)
+ {
+ return $call->type == CallMonitor_Call::INCOMING
+ ? 'incoming' : 'outgoing';
+ }
}
?>
}
?>