Ejemplo n.º 1
0
                case "chan.notify":
                    if ($ev->GetValue("targetid") == $ourcallid) {
                        gotNotify();
                        $ev->handled = true;
                    }
                    break;
                case "chan.dtmf":
                    if ($ev->GetValue("targetid") == $ourcallid) {
                        $dtmfs = $ev->GetValue("text");
                        for ($i = 0; $i < strlen($dtmfs); $i++) {
                            gotDTMF($dtmfs[$i]);
                        }
                        $ev->handled = true;
                    }
                    break;
            }
            /* This is extremely important.
               We MUST let messages return, handled or not */
            if ($ev) {
                $ev->Acknowledge();
            }
            break;
        case "answer":
            if ($ev->name == "call.route") {
                endRoute($ev->retval, $ev->handled, $ev->GetValue("error"));
            }
            break;
    }
}
Yate::Output("PHP: bye!");
/* vi: set ts=8 sw=4 sts=4 noet: */
Ejemplo n.º 2
0
                    }
                    break;
                case "chan.notify":
                    gotNotify();
                    $ev->handled = true;
                    break;
                case "chan.dtmf":
                    gotDTMF($ev->GetValue("text"));
                    $ev->handled = true;
                    break;
            }
            /* This is extremely important.
               We MUST let messages return, handled or not */
            if ($ev) {
                $ev->Acknowledge();
            }
            break;
        case "answer":
            switch ($ev->name) {
                case "call.route":
                    endRoute($ev->retval, $ev->handled, $ev->GetValue("error", "noroute"), $ev->params);
                    break;
                case "engine.timer":
                    timerTick();
                    break;
            }
            break;
    }
}
Yate::Output("PHP: bye!");
/* vi: set ts=8 sw=4 sts=4 noet: */