$m->Dispatch(); } switch ($answermode) { case "early": SendMsg("call.answered"); break; case "late": case "never": SendMsg("call.ringing"); break; } /* Prevent a warning if trying to ACK this message again */ $ev = false; break; case "chan.notify": Yate::Uninstall("chan.notify"); $m = new Yate("chan.attach"); $m->params["id"] = $ourcallid; $m->params["source"] = $newsource; $m->Dispatch(); $newsource = ""; if ($answermode == "late") { SendMsg("call.answered"); } break; } /* This is extremely important. We MUST let messages return, handled or not */ if ($ev) { $ev->Acknowledge(); }