[cisco-voip] no audio played - Cisco IVR .. Pls help
yy
yylim at thiss.net
Wed Apr 20 05:11:46 EDT 2005
Sorry guys,
basically, I have a big problem here that I hope you guys can give me
some advise. I'm using the ivr script as follows for my Cisco 2620
router, but the audio file does not play!
test.tcl
-----------------------------
# app_session.tcl
#----------------------------------
# August 1999, Saravanan Shanmugham
#
# Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003 by cisco Systems, Inc.
# All rights reserved.
#------------------
#
# This tcl script mimics the default SESSION app
#
# If DID is configured, just place the call to the dnis
# Otherwise, output dial-tone and collect digits from the
# caller against the dial-plan.
#
# Then place the call. If successful, connect it up, otherwise
# the caller should hear a busy or congested signal.
# The main routine just establishes the statemachine and then exits.
# From then on the system drives the statemachine depending on the
# events it recieves and calls the appropriate tcl procedure
#---------------------------------
# Example Script
#-----------------
proc act_Setup { } {
global dest
global beep
set beep 0
if { [infotag get leg_isdid] } {
set dest [infotag get leg_dnis]
leg proceeding leg_incoming
leg setup $dest callInfo leg_incoming
fsm setstate PLACECALL
} else {
leg setupack leg_incoming
playtone leg_incoming tn_dial
set param(dialPlan) true
leg collectdigits leg_incoming param
}
}
proc act_GotDest { } {
global dest
set status [infotag get evt_status]
if { $status == "cd_004" } {
set dest [infotag get evt_dcdigits]
leg proceeding leg_incoming
leg setup $dest callInfo leg_incoming
} else {
puts "\nCall [infotag get con_all] got event $status collecting
destination"
# use invalid-number cause code
leg disconnect leg_incoming -c28
call close
}
}
proc act_CallSetupDone { } {
global beep
set status [infotag get evt_status]
if { $status == "ls_000"} {
set creditTimeLeft [infotag get leg_settlement_time leg_all]
if { ($creditTimeLeft == "unlimited") ||
($creditTimeLeft == "uninitialized") } {
puts "\n Unlimited Time"
} else {
# start the timer for ...
if { $creditTimeLeft < 10 } {
set beep 1
set delay $creditTimeLeft
} else {
set delay [expr $creditTimeLeft - 10]
}
timer start leg_timer $delay leg_incoming
}
} else {
puts "Call [infotag get con_all] got event $status collecting
destination"
puts "\n\n######"
puts "\n\n\n\nPlaying audio
file!!!\n\n\n\n"
<--------------------------------- Problem here!
media play leg_incoming tftp:en_test.au
puts "Completed Media play!!\n\n"
call close
}
}
proc act_Timer { } {
global beep
global incoming
global outgoing
set incoming [infotag get leg_incoming]
set outgoing [infotag get leg_outgoing]
if { $beep == 0 } {
#insert a beep ...to the caller
connection destroy con_all
set beep 1
} else {
connection destroy con_all
fsm setstate LASTWARN
}
}
proc act_LastWarn { } {
media play leg_incoming flash:out_of_time.au
}
proc act_Destroy { } {
media play leg_incoming flash:beep.au
}
proc act_Beeped { } {
global incoming
global outgoing
connection create $incoming $outgoing
}
proc act_ConnectedAgain { } {
timer start leg_timer 10 leg_incoming
}
proc act_Ignore { } {
# Dummy
connection create $incoming $outgoing
}
proc act_ConnectedAgain { } {
timer start leg_timer 10 leg_incoming
}
proc act_Ignore { } {
# Dummy
puts "Event Capture"
}
proc act_Cleanup { } {
call close
}
#-----------------
# 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 PLACECALL"
set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"
set fsm(CALLACTIVE,ev_leg_timer) "act_Timer INSERTBEEP"
set fsm(INSERTBEEP,ev_destroy_done) "act_Destroy same_state"
set fsm(INSERTBEEP,ev_media_done) "act_Beeped same_state"
set fsm(INSERTBEEP,ev_create_done) "act_ConnectedAgain CALLACTIVE"
set fsm(LASTWARN,ev_destroy_done) "act_LastWarn CALLDISCONNECT"
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"
set fsm(CALLDISCONNECT,ev_leg_timer) "act_Cleanup same_state"
fsm define fsm CALL_INIT
------------------------------------
Debug Output (debug ivr script for Cisco 2620 router)
---------
pppoe_server(config-dial-peer)#
*Apr 11 14:07:49.259: //-1//TCL2:HN429A52E3:/tcl_PutsObjCmd: Call got
event ls_007 collecting destination
*Apr 11 14:07:49.259:
*Apr 11 14:07:49.259: //-1//TCL2:HN429A52E3:/tcl_PutsObjCmd:
######
*Apr 11 14:07:49.259:
*Apr 11 14:07:49.259: //-1//TCL2:HN429A52E3:/tcl_PutsObjCmd:
Playing audio file!!!
*Apr 11 14:07:49.263:
*Apr 11 14:07:49.263: //-1//TCL2:HN429A52E3:/tcl_PutsObjCmd: Completed
Media play!!
Cisco 2600 configuration (the audio file is located in
tftp://192.168.4.11/test)
-------------------------
!
voice-port 1/0/0
cptone HK
timeouts ringing 10
connection plar 1003
caller-id enable
!
call application voice test tftp://192.168.4.11/scripts/test.tcl
call application voice test language 1 en
call application voice test set-location en 1 tftp://192.168.4.11
!
dial-peer voice 10 voip
application test
destination-pattern 100.
session protocol sipv2
session target sip-server
codec g729r8 bytes 50
ip qos dscp cs5 media
!
dial-peer voice 5 pots
destination-pattern 1003
port 1/0/0
forward-digits all
!
sip-ua
sip-server dns:lab.test.com.hk:5060
!
Many thanks,
YY
More information about the cisco-voip
mailing list