URL: https://www.opennet.ru/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID6
Нить номер: 11428
[ Назад ]

Исходное сообщение
"Авторизация звонков"

Отправлено ashm , 04-Сен-06 19:10 
Приветствую!

Помогите пожалуйста со TCL скриптом, который используется для авторизации звонков через Radius. Есть CCO-логин - просто не могу найти его на циске.

Спасибо!


Содержание

Сообщения в этом обсуждении
"Авторизация звонков"
Отправлено spa , 05-Сен-06 06:09 
>Приветствую!
>
>Помогите пожалуйста со TCL скриптом, который используется для авторизации звонков через Radius.
>Есть CCO-логин - просто не могу найти его на циске.
>
>Спасибо!


#
# Script version 1.0.1
#
proc do_authenticate {} {
        global state
        global pin
        global account
        global prefix
        global param


        set event [authenticate $account $pin "" info]

        if {($event == "authenticated")} {
                set state get_dest
                return 0
        } else {
                set event [playPrompt param info tech_fail.au call_us_later.au]
                set state end
                return 0
        }
}

proc do_get_dest {} {
        global prefix
        global state
        global destination
        global pin
        global account

        set prompt(interrupt) true
        set prompt(abortKey) *
        set prompt(terminationKey) #
        set prompt(dialPlanTerm) true
        set prompt(maxDigits) 3

        set mesg(interrupt) true
        set mesg(abortKey) *
        set mesg(terminationKey) #
        set mesg(playComplete) true

        set event [authorize $account $pin "" [ani] info]

        set num [getVariable aaa h323-credit-amount info]

        set event [playPrompt prompt info [set prefix]_welcome.au]

        if {$event == "collect success"} {
                set state place_call
                set destination $info(digits)
                return 0
        }

        if {$event == "collect aborted"} {
                set state end
                return 0
        }

        if {$event == "collect timeout" || $event == "collect fail"} {
                set event [playPrompt mesg info invalid_dest.au]
                set state end
                return 0
        }

        set state end
        return 0
}

proc do_place_call {} {
        global state
        global destination

        set callInfo(destinationNum) $destination
        set event [placeCall $destination callInfo info]

        if {$event == "active"} {
                set state active_no_timer
                return 0
        }

        if {$event == "fail"} {
                set state end
                return 0
        }

        set state end
        return 0
}

proc do_active_no_timer {} {
        global state

        set event [waitEvent]
        while {$event == "digit"} {
                set event [waitEvent]
        }
        set state end
        return 0
}

#-------------------------------------------------
# main
#

acceptCall


set account 4
set pin 30501

set prefix ru
set state authenticate

set param(interrupt) true
set param(abortKey) *
set param(terminationKey) #
set param(playComplete) true

while {$state != "end"} {
        if {$state == "authenticate"} {
                do_authenticate
        } elseif {$state == "get_dest"} {
                do_get_dest
        } elseif {$state == "active_no_timer"} {
                do_active_no_timer
        } elseif {$state == "place_call"} {
                do_place_call
        } else {
                break
        }
}