Example #1
0
function gotDTMF($dtmf)
{
    global $state;
    global $collect;
    //    Yate::Output("Overlapped gotDTMF('$dtmf') in state: $state collected: '$collect'");
    switch ($dtmf) {
        case "*":
            setState("");
            return;
        case "#":
            Yate::Output("Overlapped clearing already collected: '{$collect}'");
            $collect = "";
            setState("prompt");
            return;
    }
    $collect .= $dtmf;
    routeTo($collect);
}
Example #2
0
function timerTick()
{
    global $state;
    global $final;
    global $interdigit;
    global $timer;
    global $collect;
    global $queue;
    if ($interdigit <= 0) {
        return;
    }
    if ($timer++ >= $interdigit) {
        $timer = 0;
        Yate::Debug("Overlapped timeout in state: '{$state}' collected: '{$collect}' queued: '{$queue}'");
        if ($state == "routing") {
            return;
        }
        $interdigit = 0;
        $final = true;
        $collect .= $queue;
        routeTo($collect);
    }
}