From 24b4f9e0e0b4423f6ee1ab9bdced6fcecc0a674b Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Thu, 27 Aug 2009 03:03:33 +0000 Subject: [PATCH] Only update for known extensions --- functions/functions.voip.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/functions/functions.voip.php b/functions/functions.voip.php index 312efa05..d09e818d 100644 --- a/functions/functions.voip.php +++ b/functions/functions.voip.php @@ -434,24 +434,36 @@ class voipWatch extends voip { */ if (eregi("Event: Dial.*SubEvent: Begin.*Channel: SIP/([0-9]+)",$line,$regs)) { - print T_("Ringing") . T_(" Extension ") . $regs[1] . "\n"; - $this->setState($this->getCallId($regs[1]),2); + $call_id = $this->getCallId($regs[1]); + if ($call_id != 0) + { + print T_("Ringing") . T_(" Extension ") . $regs[1] . "\n"; + $this->setState($call_id,2); + } } /** * The call has been answered */ else if (eregi("Event: Bridge.*Channel1: SIP/([0-9]+)",$line,$regs)) { - print T_("Answered") . T_(" Extension ") . $regs[1] . "\n"; - $this->setState($this->getCallId($regs[1]),3); + $call_id = $this->getCallId($regs[1]); + if ($call_id != 0) + { + print T_("Answered") . T_(" Extension ") . $regs[1] . "\n"; + $this->setState($call_id,3); + } } /** * The call has been hung up */ else if (eregi("Event: Hangup.*Channel: SIP/([0-9]+)",$line,$regs)) { - print T_("Hangup") . T_(" Extension ") . $regs[1] . "\n"; - $this->setState($this->getCallId($regs[1]),4,true); + $call_id = $this->getCallId($regs[1]); + if ($call_id != 0) + { + print T_("Hangup") . T_(" Extension ") . $regs[1] . "\n"; + $this->setState($call_id,4,true); + } } //print $line . "\n\n";