ivr_machine.dsl 2.9 KB
library

preprocessor digression machine
{
    conditions { on #messageHasIntent("robot_marker") || #messageHasIntent("answering_machine") priority 110000; }
    var visited = 0;
    do
    {
        $cjm.push("machine_dig");
        digression disable hello;
        set $conversation_result = "автоответчик";
        set $status = "wait_answer";
        set digression.machine.visited += 1;
        if(digression.machine.visited == 2) {goto do_before_exit;}
        //return;
        wait *;
    }
    transitions
    {
        do_before_exit: goto do_before_exit;
        cantalk: goto fitness_not_qualified on timeout 5000;
        bot: goto answering_machine on #messageHasIntent("robot_marker") || #messageHasIntent("answering_machine");
        someone: goto fitness_not_qualified on true;
        //maybe_bot: goto answering_machine on timeout 5000;
    }
}

node fitness_not_qualified
{
    do
    {
        $cjm.push("fitness_not_qualified");
        #say("greetings");
        digression enable {repeat, hello};
        #waitingMode(duration: 2000);
        wait *;
    }
    transitions
    {
        targeted_action_vm_botmachine: goto answering_machine on #messageHasIntent("robot_marker");
        bot: goto its_machine on #messageHasIntent("robot_marker");
      /*  what_webinar: goto webinar_name on #messageHasIntent("what_webinar");
        other: goto been_at_webinar on #messageHasAnyIntent(["what_question",
                                                            "who_are_you",
                                                            "where_my_number"]);

        positive: goto been_at_webinar on #messageHasAnyIntent(["accept", "may_continue"]) || #messageHasSentiment("positive");
        negative: goto call_later on #messageHasAnyIntent(["decline", "cant_talk_rn"]) || #messageHasSentiment("negative");  */
    }
}

node its_machine
{
    do
    {
        $cjm.push("its_machine");
        set $status = "voice_menu";
        wait *;
    }
    transitions
    {
        //someone: goto fitness_not_qualified on #messageHasIntent("can_you_hear_me") priority -100;
        bot: goto answering_machine on #messageHasIntent("robot_marker");
        someone: goto fitness_not_qualified on true;
        maybe_bot: goto answering_machine on timeout 5000;
        //targeted_action_vm_nqa_1: goto fitness_not_qualified on true;
    }
}

node answering_machine
{   
    do
    {
        $cjm.push("answering_machine");
        //#waitingMode(duration: 1500);
        digression disable {repeat, dont_understand, can_hear_you};
        set $status = "answering_machine";
        goto do_before_exit;
        //exit;
    }
    transitions
    {
        do_before_exit: goto do_before_exit;
        //targeted_action_bot_yes: goto fitness_validation_yes;
        //off_target_action_am: goto root;
    }
    onexit
    {
    default: do
        {
          set $conversation_result = "автоответчик";
        }
    }
}