This is not for transfer, just an example showing paly a meesge before connect the call.
You can add code to collect the digit to transfer out.
Thanks !
Ok, I would like to use your code, but I need a paramater to set the transfer extension. I added a couple things but still doesn't transfer for me.
# initialize the parameters that configured from IOS CLI
proc init_configs { } {
global welcomePrompt
global oprtr
if [infotag get cfg_avpair_exists welcome-prompt] {
setwelcomePrompt [string trim [infotag get cfg_avpair welwome-prompt]]
} else {
set welcomePrompt flash:en_welcome.au
}
if [infotag get cfg_avpair_exists operator] {
set oprtr [string trim [infotag get cfg_avpair operator]]
} else {
set oprtr "NONE"
}}
#procedure to play audio file on incoming dial peer
proc act_Media { } {
global dest
global welcomePrompt
global oprtr
set dest $oprtr leg setupack leg_incoming
leg proceeding leg_incoming
leg connect leg_incoming
media play leg_incoming $welcomePrompt
}
# setup the call, connect caller to called party
proc act_Setup { } {
global dest
puts ">>> Tcl: proc act_Setup <<<"
puts ">>> TCL:Final Dest: $dest <<<"
handoff callappl leg_incoming default "DESTINATION=$dest"
act_Cleanup
}
# disconnect the call
proc act_Cleanup { } {
puts ">>> Tcl: act_Cleanup <<<"
call close
}
init_configs
set fsm(any_state,ev_disconnected) "act_Cleanup same_state"
set fsm(CALL_INIT,ev_setup_indication) "act_Media PLAYPROMPT"
set fsm(PLAYPROMPT,ev_media_done) "act_Setup PLACECALL"
set fsm(PLACECALL,ev_disconnected) "act_Cleanup CALLDISCONNECT"
set fsm(CALLDISCONNECT,ev_disconnected) "act_Cleanup same_state"
set fsm(CALLDISCONNECT,ev_media_done) "act_Cleanup same_state"
set fsm(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup same_state"
fsm define fsm CALL_INIT
It works and I can now play the recording to the caller, and what ever I have setup for operator it will transfer to that number. Here is the "debug voice application error" output from a call.
000728: Feb 17 15:08:04.494 EST: //99//TCL :/tcl_PutsObjCmd: >>> Tcl: proc act_Setup <<<
000729: Feb 17 15:08:04.494 EST:
000730: Feb 17 15:08:04.494 EST: //99//TCL :/tcl_PutsObjCmd: >>> TCL:Final Dest: 55001 <<<
000731: Feb 17 15:08:04.494 EST:
000732: Feb 17 15:08:04.494 EST: //-1//AFW_:/AFW_Module_ParseHandle: ERROR: Separator not found
000733: Feb 17 15:08:04.494 EST: //99//TCL :/tcl_PutsObjCmd: >>> Tcl: act_Cleanup <<<
000734: Feb 17 15:08:04.494 EST:
000735: Feb 17 15:08:04.494 EST: //99//Hand:/AFW_M_Handoff_Terminate: Can't cleanup, 1 calls out
000736: Feb 17 15:08:04.494 EST: //-1//AFW_:/AFW_Util_GetTgCicValue: CIC Not found for tag(56)
000737: Feb 17 15:08:05.758 EST: //99//Dest:/DestStartMediaNegotiation: Interworking Leg does not need renegotiation
000738: Feb 17 15:08:23.194 EST: //99//AFW_:/Session_HandoffReturn: Cannot return leg with connections
000739: Feb 17 15:08:23.194 EST: //99//AFW_:/Session_HandoffReturn: No incoming leg to handoff return
000740: Feb 17 15:08:23.202 EST: //99//AFW_:/Session_HandoffReturn: No incoming leg to handoff return