<?php
    require 'common.php';
    try
    {
        error_log($_SESSION['call_flow_steps']);
        $r = new response();
        if(check_call_end($r) === false)
        {
            //initiate new collect dtmf object
            $item_list = getList($REPEAT_PINCODE);
            $numbers_list = getNumbers($_SESSION['selected_pincode']);
            //array_push($item_list,chunk_split($_SESSION['selected_pincode'], 1, ' '));
            array_push($item_list,...$numbers_list);
            error_log("confirm_pin:".print_r($item_list,true));
            $dtmf = create_collect_dtmf_with_messages($item_list,array(),$PINCODE_CONFIRMATION);
            $r->addCollectDtmf($dtmf);
            $r->addGoto($APP_BASE_URL."/validate_confirm_pincode.php");
            add_step($PINCODE_CONFIRMATION);
            $r->send();
        }
    }
    catch(Exception $e)
    {
        error_log("ERROR:".$e->getMessage());
    }
?>