06-09-2015 12:27 AM
Hi,
This is my first encounter with TCL scripting.
I have a cisco router as a voice gateway (H323). It has a E1-ISDN connected to PSTN and a G0/0 to it's LAN. Whenever there is a call from one of the IP Phones to an external number (PSTN), can the voice-gateway play a message to the CALLED party before they start talking? The message should be "This call may be recorded."
Best regards,
Ivana
Solved! Go to Solution.
06-17-2015 06:16 AM
No, below one is fine you need to add one more for ev_setup_done event.
set fsm(CALL_INIT,ev_setup_indication) "act_Setup PLACECALL"
Please go through the sample scripts and programming guide which are present in above link.
Thanks,
Raghavendra
06-09-2015 01:59 AM
Hi Ivana,
Yes, you can destroy connection once you got ev_setup_done event, play message to outgoing leg and then create connection.
media play leg_outgoing greating.au
Thanks,
Raghavendra
06-17-2015 05:22 AM
Hi Raghavendra,
Thank you for your reply.
I think I understand how it would work, however, being new to TCL scripting I am having trouble creating the script. I was hoping you could take a look at it:
# initialize the parameters that configured from IOS CLI
proc init_configs { } {
global announcement
set announcement flash:announcement.au
}
#destroy connection
proc act_Setup { } {
global dest
set dest [infotag get leg_outgoing]
leg setup $dest callInfo leg_incoming
connection destroy con_all
}
#play prompt to called number
proc act_Media { } {
global announcement
media play leg_outgoing $announcement
}
#create connection
proc act_Setup { } {
global incoming
global outgoing
set incoming [infotag get leg-incoming]
set outgoing [infotag get leg-outgoing]
connection create $incoming $outgoing
}
proc act_CallSetupDone { } {
puts ">>> Tcl: act_CallSetupDone <<<"
set status [infotag get evt_status]
handoff appl leg_all default
call close
}
proc act_Cleanup { } {
call close
}
init_configs
set fsm(any_state,ev_disconnected) "act_Cleanup same_state"
set fsm(CALL_INIT,ev_setup_indication) "act_Setup PLACECALL"
set fsm(PLACECALL,ev_destroy_done) "act_Media PLAYPROMPT"
set fsm(PLACECALL,ev_media_done) "act_CallSetupDone CALLACTIVE"
set fsm(CALLACTIVE,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
Aslo, if I understand correctly, I would configure this script on the inbound VoIP dial-peer, not on the outbound pots dial-peer?
Best regards,
Ivana
06-17-2015 05:36 AM
Hi Ivana,
You should destroy connection once you got ev_setup_done. You can refer our sample scripts in below location.
Thanks,
Raghavendra
06-17-2015 05:45 AM
Doesn't ev_setup_done indicate that the leg setup command has finished?
This is why I thought I should destroy the connection after eg setup $dest callInfo leg_incoming.
If this is not the case, can you tell me when/where I should destroy the connection?
Also, could you confirm that I configure the application on the inbound VoIP dial-peer?
06-17-2015 05:52 AM
leg setup command has to be finished then only you can get outgoing leg using [infotag get leg_outgoing] .
Yes you can configure script under incoming voip dial peer.
Thanks,
Raghavendra
06-17-2015 06:00 AM
I just noticed I made a mistake.
I should have set fsm(CALL_INIT,ev_setup_done) "act_Setup PLACECALL" instead of
set fsm(CALL_INIT,ev_setup_indication) "act_Setup PLACECALL"
Is it OK now?
06-17-2015 06:16 AM
No, below one is fine you need to add one more for ev_setup_done event.
set fsm(CALL_INIT,ev_setup_indication) "act_Setup PLACECALL"
Please go through the sample scripts and programming guide which are present in above link.
Thanks,
Raghavendra
08-24-2015 08:22 AM
Hi Ivana,
I was wondering if you were ever able to get this to work?
Thanks,
Jeff
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: