سلام
یک سری شماره داریم که افراد به این شماره ها زنگ میزنند و به ivr متصل میشوند.ivr از آنها user , pass میخواهد و در صورت authenticat شدن ، مقدار اعتبار کاربر برایش پخش میشودوبرای او یک آهنگ پخش میشد
من دستورات زیر را نوشتم
آیا دستورات زیر در عمل هم ابل پیاده ساز
دستوری که پررنگ است درست است؟
دستور %a$num ،آیا num یک فایل صوتی با پسوند au. است؟
بی زحمت اگه مشکلی داره بگین
ممنون
Config router
aaa new-model
aaa authentication login h323 group radius
aaa authentication login home local
aaa authentication ppp ppp local
aaa authorization exec h323 group radius
aaa authorization network ppp local
aaa accounting update newinfo
aaa accounting connection h323 start-stop group radius
call fallback probe-timeout 2
call rsvp-sync
call application voice callapp tftp://192.168.1.1
voice class codec 1
codec preference 1 g723ar53 bytes 140
codec preference 2 g729r8 bytes 140
!
dial-peer voice 1 pots
application callapp
session target ipv4:192.168.1.1
!
dial-peer voice 666 voip
destination-pattern .T
session target ipv4:gatway ip
tcl script
acceptCall
set event [authenticate [ani] [dnis] info]
if {$event != "authenticated"} {
set state get_account
} else {
set state authen_pass
}
while {$state != "end"} {
if {[info proc do_$state] == do_$state}
do_$state
}
proc do_get_account {} {
global state
global account
set prompt(url) tftp://192.168.1.10/get_accoount.au
set prompt(interrupt) true
set prompt(abortKey) *
set prompt(terminationKey) #
set patterns(account) .+
set event [promptAndCollect prompt info patterns ]
if {$event == "collect success"} {
set state get_pin
set account $info(digits)
return 0
}
if {$event == "collect aborted"} {
set state get_account
return 0
}
if {$event == "collect fail"} {
set state get_account
return 0
}
set state end
return 0
}
proc do_get_pin {} {
global state
global pin
set prompt(url) tftp://enter_pin.au
set prompt(interrupt) true
set prompt(abortKey) *
set prompt(terminationKey) #
set patterns(account) .+
set event [promptAndCollect prompt ReturnInfo patterns ]
if {$event == "collect success"} {
set state authenticate
set pin $info(digits)
return 0
}
if {$event == "collect aborted"} {
set state get_account
return 0
}
if {$event == "collect fail"} {
# timeout
if {$info(code) == 102} {
set state get_pin
return 0
}
# invalid number
if {$info(code) == 28} {
set state get_pin
return 0
}
}
set state end
return 0
}
proc do_authenticate {} {
global state
global pin
global account
set event [authenticate $account $pin info]
if { $event == "authenticated" } {
set state authen_pass
return 0
}
if {$event == "authentication failed"} {
set state authen_fail
return 0
}
set state end
return 0
proc do_authen_pass {} {
set num [getVariable aaa h323-credit-amount CrediTime]
set param(interrupt) true
set param(abortKey) *
set param(dialPlan) true
set param(terminationKey) #
setLocation tftp://192.168.1.1
set ev [playPrompt param info en_you_have.au %a$num %s1000 ahangt.au]
return 0
}
proc do_authen_fail {} {
global state
set prompt(url) tftp://:auth_failed.au
set prompt(playComplete) true
set event [promptAndCollect prompt info ]
set state end
return 0
}