Добрый день!
Имеется задача, принять звонок на fxo-порт, проиграть приветствие, предложить набрать номер абонента или ожидать ответа оператора.
Вроде всё просто, но не работает.
Имеется 1760, во флэше лежит ivr-скрипт aa_simple.tcl (нашёл где-то в интернете) и аудио-файлы:
ru_enter_dest.au
ru_invalid_ext.au
ru_welcome.au
aa_simple.tcl Описано приложение:
application
service aa flash:aa_simple.tcl
param max-extension-length 4
param reception-number 1000 (телефон оператора на CCM)
Есть диал-пиры:
dial-peer voice 1000 voip
destination-pattern 1...
progress_ind setup enable 3
session target ipv4:172.8.0.2 (CCM)
dtmf-relay h245-alphanumeric
no vad
dial-peer voice 9 pots
service aa
destination-pattern 9T
port 2/0
Звоню на этот порт, идёт просто вызов, в терминале выскакивает:
Aug 10 13:16:45: йLL_CONTROL-6-APP_NOT_FOUND: Application aa in dial-peer 9 not found. Handing callid 37 to the alternate app .
Но апликешн то-есть:
show call application voice aa
Script Name : aa
URL : flash:aa_simple.tcl
Type : Service
State: Loaded
Life : Configured
Exec Instances: 0
Script Code Begin:
--------------------------------
TCL Script version 2.0 - 2.1
# aa_simple.tcl
proc init { } {
global PARAM
set PARAM(interruptPrompt) true
set PARAM(dialPlanTerm) true
set PARAM(initialDigitTimeout) 1
set PARAM(terminationKey) #
set PARAM(abortKey) *
}
proc init_ConfigVars { } {
global rcptNumber
global configFail
global maxExtensionLen
# aa-pilot is the IVR number configured on the gateway to be used by the customer
set configFail 0
if [infotag get cfg_avpair_exists reception-number] {
set rcptNumber [string trim [infotag get cfg_avpair reception-number]]
} else {
set rcptNumber "NONE"
puts -nonewline "TCL AA: -- ERROR: Mandatory parameter reception-number does not exist --"
set configFail 1
call close
}
if [infotag get cfg_avpair_exists max-extension-length] {
set maxExtensionLen [string trim [infotag get cfg_avpair max-extension-length]]
if { $maxExtensionLen < 0 } {
puts -nonewline "TCL AA: -- ERROR: max-extension-length $maxExtensionLen is invalid --"
set configFail 1
call close
}
} else {
set maxExtensionLen 4
puts -nonewline "TCL AA: -- max-extension-length is set to default value of $maxExtensionLen --"
}
}
proc init_perCallVars { } {
puts "\nproc init_perCallvars"
global ani
global dnis
set ani ""
set dnis ""
set ani [infotag get leg_ani]
set dnis [infotag get leg_dnis]
}
proc act_Setup { } {
global configFail
if { $configFail == 0} {
leg setupack leg_incoming
leg proceeding leg_incoming
leg connect leg_incoming
media play leg_incoming flash:ru_welcome.au
puts -nonewline "++ Playing Welcome Prompt ++"
fsm setstate WELCOMEPLAYING
} else {
call close
}
}
after 3000
proc act_GotDestNoOption { } {
global PARAM
puts -nonewline "+++ Collect Extension Digits +++"
leg collectdigits leg_incoming PARAM
media play leg_incoming flash:ru_enter_dest.au
fsm setstate CALLTOEXTENSION
}
proc act_ExtDialFailed { } {
puts -nonewline "+++ Dial Failed +++"
media play leg_incoming flash:ru_invalid_ext.au
fsm setstate DIALFAILEDQUEUE
}
proc act_ExtDialFailedQueue { } {
global rcptNumber
handoff appl leg_incoming default "DESTINATION=$rcptNumber"
}
proc act_HandoffToExtension { } {
global maxExtensionLen
global invalidExtension
global rcptNumber
set status [infotag get evt_status]
if {$status == "cd_004"} {
set destExtension [infotag get evt_dcdigits]
set destExtLen [string length $destExtension]
set extLength [expr $maxExtensionLen - $destExtLen]
if {($maxExtensionLen > 0) && ($extLength >= 0)} {
handoff appl leg_incoming default "DESTINATION=$destExtension"
} elseif {$maxExtensionLen == 0} {
handoff appl leg_incoming default "DESTINATION=$destExtension"
} elseif {($maxExtensionLen > 0) && ($extLength < 0)} {
act_ExtDialFailed
} else {
act_ExtDialFailed
}
} elseif { ($status == "cd_001") || ($status == "cd_002") } {
handoff appl leg_incoming default "DESTINATION=$rcptNumber"
} else {
act_ExtDialFailed
}
}
proc act_Cleanup { } {
call close
}
requiredversion 2.0
init
init_ConfigVars
#----------------------------------
# State Machine
#----------------------------------
set fsm(any_state,ev_disconnected) "act_Cleanup same_state"
set fsm(CALL_INIT,ev_setup_indication) "act_Setup GETDEST"
set fsm(CALL_INIT,ev_setup_indication) "act_Setup OPTIONSELECTED"
set fsm(WELCOMEPLAYING,ev_media_done) "act_GotDestNoOption NEWCALLMSG"
set fsm(CALLTOEXTENSION,ev_collectdigits_done) "act_HandoffToExtension same_state"
set fsm(DIALFAILEDQUEUE,ev_media_done) "act_ExtDialFailedQueue same_state"
set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup same_state"
set fsm(CALLDISCONNECT,ev_leg_timer) "act_Cleanup same_state"
fsm define fsm CALL_INIT
--------------------------------
Что неправильно?!