ivr_machine.dsl 4.17 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 || (digression.wait_answer.visited == 1 && digression.machine.visited == 1)) {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");
        someone: goto fitness_not_qualified on true;
        maybe_bot: goto answering_machine on timeout 5000;*/
    }
}

digression wait_answer // дигрессии 
{
    conditions
    {
        on #messageHasIntent("robot_marker") || #messageHasIntent("answering_machine") && digression.wait_answer.visited < 3 priority 110000;
    }
    var visited = 0;
    do
    {
        $cjm.push("wait_answer_dig");
        digression disable hello;
        set $conversation_result = "автоответчик";
        set $status = "wait_answer";
        set digression.wait_answer.visited += 1;
        if(digression.wait_answer.visited == 2 || (digression.wait_answer.visited == 1 && digression.machine.visited == 1)) {goto do_before_exit;}
        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");
        someone: goto fitness_not_qualified on true;
        maybe_bot: goto answering_machine on timeout 5000;*/
    }
}

/*digression ivr // дигрессии 
{
    conditions
    {
        on #messageHasIntent("robot_marker") && digression.wait_answer.visited == 0 && digression.ivr.visited < 3 priority 110000;
    }
    var visited = 0;
    do
    {
        $cjm.push("ivr_dig");
        set $status = "ivr";
        set digression.ivr.visited += 1;
        set $conversation_result = "автоответчик";
        return;
    }
    transitions
    {
    }
}*/

node fitness_not_qualified
{
    do
    {
        $cjm.push("fitness_not_qualified");
       // #say("deal");
        digression enable {repeat, hello};
        #waitingMode(duration: 2000);
        wait *;
    }
    transitions
    {
        bot: goto its_machine on #messageHasAnyIntent(["robot_marker", "answering_machine"]);
        //yes: goto offer on #messageHasAnyIntent(["accept", "what_question"]) || #messageHasSentiment("positive") && !#messageHasAnyIntent(["decline", "cant_talk_rn"]);
        //no_busy: goto letme_40sec on (#messageHasAnyIntent(["decline", "cant_talk_rn", "call_later"]) || #messageHasSentiment("negative")) && !#messageHasIntent("not_interested");
        //time: goto been_registred on timeout 10000;
       // other: goto offer on true;
    }
    onexit
    {
    }
}

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 #messageHasAnyIntent(["robot_marker", "answering_machine"]);
        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 = "автоответчик";
        }
    }
}