Example FDM script file

Here is an example of a typical FDM script file. For another example, see Example FDM statements.

softkey _EXIT : "Exit" : "Exit" {
        exit;
}

softkey _HOME : "Exit" : "Exit" {
        trigger CUSTOM_EVENT_X;
}

softkey CW : "Take New Call" : "TakeNew" {
        do_hookflash;
        clear_display;
        clear_clipboard;
        display "Talking to:";
        display "New Caller";
        set_timer_for 3 sec;
        load_overlay CW_test_call2;
}

softkey CW_SWITCH : "Call 1" : "Call 1" {
        do_hookflash;
        clear_display;
        clear_clipboard;
        display "Talking to:";
        display "$Call1p";
        set_timer_for 3 sec;
        load_overlay CW_test_call1;
}

 main {
        on CUSTOM_EVENT_X
                clear_display;
                clear_clipboard;
                display "TELLIE PHONE SERVICES";
                install_softkey _EXIT;
        end
        on IN_CALL_ANS during 1
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
        on MAKING_CALL
                set_timer_for 12 sec;
                trigger CUSTOM_EVENT_X;
                load_overlay offHook;
        end
        on SERVICE_SELECT
                trigger CUSTOM_EVENT_X;
        end
        on NORMAL_RING
                clear_display;
                clear_clipboard;
                display "Incoming Call From:";
                display "$Call1p";
        end
        on RINGING_CEASED
                exit;
        end
}

overlay offHook {
        on CUSTOM_EVENT_X
                clear_display;
                clear_clipboard;
                display "Enter phone number:";
        end
        on AUDIBLE_RINGBACK
                clear_timer;
                clear_display;
        end
        on OUT_CALL_ANS
                clear_timer;
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
        on DIAL_TONE
                clear_timer;
        end
        on TIME_OUT
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
}

overlay stableCall {
        on CUSTOM_EVENT_X
                clear_display;
                clear_clipboard;
                display "Talking to:";
                display "$Call1p";
                install_softkey CW;
        end }

overlay CW_test_call2 {
        on TIME_OUT
                install_softkey CW_SWITCH;
        end
        on RECALL_DIAL_TONE
                trigger CUSTOM_EVENT_X;
        end
        on DIAL_TONE
                trigger CUSTOM_EVENT_X;
        end
        on CUSTOM_EVENT_X
                clear_timer;
                clear_display;
                clear_clipboard;
                display "New Caller hung up. " && "Back to Call 1.";
                delay 30;
                do_hookflash;
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
}

overlay CW_test_call1 {
        on TIME_OUT
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
        on RECALL_DIAL_TONE
                trigger CUSTOM_EVENT_X;
        end
        on DIAL_TONE
                trigger CUSTOM_EVENT_X;
        end
        on CUSTOM_EVENT_X
                clear_timer;
                clear_display;
                clear_clipboard;
                display "Call 1 hung up. " && "Back to New Call.";
                delay 30;
                do_hookflash;
                trigger CUSTOM_EVENT_X;
                load_overlay stableCall;
        end
}