Всем привет.
Есть Cisco 2851 в качестве CUBE. Имеется подключение к POTS E1, входящий диалпир, на нем крутится апликейшн IVR написанный на TCL. Звонят на входящий номер XXXXX попадают на автосекретаря который предлагает набрать внутренний номер абонента или дождаться ответа секретаря.Тут все в порядке.
Есть второе подключение к другому провайдеру SIP-trunk.
Необходимо настроить тот-же функционал на этом подключенни.По аналогии повесил на входящий диалпир этого подключения тот-же апликейшн(соответственно поправив входящий номер и номер опереатора на который должен уходить звонок по тайм-ауту). Но не работает.
Срабатывает событие при котором проигрывается disconnect.au и звонок отбивается.
В TCL не силен, поэтому прошу о помощи.voice service voip
allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
fax protocol pass-through g711ulaw
sip
Тут работает.
dial-peer voice 1 pots
service ivr2pots
incoming called-number XXXXX
direct-inward-dial
port 0/0/0:15
Тут не работает.
dial-peer voice 300 voip
service ivr2sip
destination-pattern YYYYY
session protocol sipv2
session target ipv4:sipserver
incoming called-number YYYYY
codec g711ulaw
no vad
ivr2sip.tcl
proc init { } {
global param
global selectCnt
global callInfo
global legConnected
set param(interruptPrompt) true
set param(terminationKey) #
set selectCnt 0
set legConnected false
}
proc init_ConfigVars { } {
global destination
global aaPilot
global oprtr
if [infotag get cfg_avpair_exists aa-pilot] {
set aaPilot [string trim [infotag get cfg_avpair aa-pilot]]
} else {
set aaPilot "YYYYY"
}
if [infotag get cfg_avpair_exists operator] {
set oprtr [string trim [infotag get cfg_avpair operator]]
} else {
set oprtr "ZZZZ"
}
}
proc init_perCallVars { } {
puts "\nproc init_perCallvars"
global ani
global digit_enabled
global fcnt
global retrycnt
global dnis
set fcnt 0
set retrycnt 6
set ani "ZZZZ"
set dnis "YYYYY"
set digit_enabled "FALSE"
# set ani [infotag get leg_ani]
puts "\nANI $ani"
# set dnis [infotag get leg_dnis]
puts "\nDNIS $dnis"
}
proc act_Setup { } {
global param
global selectCnt
global dest
global beep
global callInfo
global dnis
global fcnt
global aaPilot
global oprtr
global busyPrompt
global legConnected
puts "proc act_Setup"
set busyPrompt _dest_unreachable.au
set beep 0
init_perCallVars
infotag set med_language 1
if { ($dnis == "") || ($dnis == $aaPilot) } {
leg setupack leg_incoming
leg proceeding leg_incoming
leg connect leg_incoming
set legConnected true
puts "\nNo DNIS\n"
set param(dialPlan) true
leg collectdigits leg_incoming param
media play leg_incoming %s3000 _welcome.au %s1000 _operator.au
} else {
set fcnt 6
leg setupack leg_incoming
handoff callappl leg_incoming default "DESTINATION=$dnis"
fsm setstate HANDOFF
}
}
proc act_GotDest { } {
global dest
global digit1
global callInfo
global oprtr
global busyPrompt
puts "\n proc act_GotDest"
set status [infotag get evt_status]
set callInfo(alertTime) 30
if { ($status == "cd_004") } {
set dest [infotag get evt_dcdigits]
set digit1 [string range $dest 0 0]
# puts "Digit1 = $digit1"
if { $digit1 == "8" } {
set busyPrompt _dest_unreachable.au
puts "\nCall [infotag get con_all] got event $status collecting destination"
act_Select
}
if { $digit1 == "9" } {
set busyPrompt _dest_unreachable.au
puts "\nCall [infotag get con_all] got event $status collecting destination"
act_Select
}
if { $dest == "0" } {
set dest $oprtr
leg setup $dest callInfo leg_incoming
}
leg setup $dest callInfo leg_incoming
} elseif { ($status == "cd_001") || ($status == "cd_002") } {
set dest $oprtr
leg setup $dest callInfo leg_incoming
# set busyPrompt _welcome.au
# act_Select
} else {
if { $status == "cd_006" } {
set busyPrompt _dest_unreachable.au
}
puts "\nCall [infotag get con_all] got event $status collecting destination"
set dest [infotag get evt_dcdigits]
if { $dest == "0" } {
set dest $oprtr
leg setup $dest callInfo leg_incoming
} else {
act_Select
}
}
}
proc act_CallSetupDone { } {
global busyPrompt
global legConnected
set status [infotag get evt_handoff_string]
if { [string length $status] != 0} {
regexp {([0-9][0-9][0-9])} $status StatusCode
puts "IP IVR Disconnect Status = $status"
switch $StatusCode {
"016" {
puts "\n Connection success"
fsm setstate CONTINUE
act_Cleanup
}
default {
if { $legConnected == "false" } {
leg proceeding leg_incoming
leg connect leg_incoming
set legConnected true
}
puts "\n Call failed. Play prompt and collect digit"
if { ($StatusCode == "017") } {
set busyPrompt _dest_busy.au
}
act_Select
}
}
} else {
puts "\n Caller disconnected"
fsm setstate CALLDISCONNECT
act_Cleanup
}
}
proc act_Select { } {
global destination
global promptFlag2
global destBusy
global param
global fcnt
global retrycnt
global busyPrompt
puts "\n proc act_Select"
set promptFlag2 0
set param(interruptPrompt) true
set param(abortKey) *
set param(terminationKey) #
set param(dialPlan) true
set param(dialPlanTerm) true
leg collectdigits leg_incoming param
if { $fcnt < $retrycnt } {
media play leg_incoming $busyPrompt %s500 _reenter_dest.au
incr fcnt
fsm setstate GETDEST
} else {
act_DestBusy
}
}
proc act_DestBusy { } {
puts "\n proc act_DestBusy"
media play leg_incoming _disconnect.au
fsm setstate CALLDISCONNECT
}
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(GETDEST,ev_collectdigits_done) "act_GotDest HANDOFF"
set fsm(HANDOFF,ev_returned) "act_CallSetupDone CONTINUE"
set fsm(CALLDISCONNECT,ev_media_done) "act_Cleanup same_state"
fsm define fsm CALL_INIT
Вот дебаг
Когда звонят на YYYYY
deb voice application error
Mar 11 10:56:28.562: //-1//PACK:/Media_LangCode_GetByIndex: Unable to retrieve language element with index 1
Mar 11 10:56:28.570: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.574: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.578: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.578: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.582: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.586: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.586: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.590: //9969//Digi:/act_DCRunning_RDone: callid=9969 error. Enable failed.
Mar 11 10:56:28.590: //9969//AFW_:/AFW_FSM_Drive: FSM no match for (CALLDISCONNECT[2],ev_collectdigits_done[202])
Mar 11 10:56:28.854: //-1//AFW_:/AFW_Util_GetTgCicValue: CIC Not found for tag(56)