[cisco-voip] TCL script to parse *ANI*DNIS*

Patrick Mowry pmowry at getgds.com
Tue Jan 24 16:18:32 EST 2006


-----Original Message-----
From: Teodor Georgiev [mailto:tgeorgiev at is-bg.net] 
Sent: Monday, January 02, 2006 5:14 AM
To: Patrick Mowry; cisco-voip at puck.nether.net
Subject: Re: [cisco-voip] TCL script to parse *ANI*DNIS*


Yes, it is possible.

you should use the "set ani" and "set dnis" commands. In example,
configure
in the incoming TCL to set both the ANI and DNIS
to the "ANI" number. Then configure an outgoing sed-style translation to
the
CCM to strip the "*" and the second part from the ANI
and to the "*" and first part from the DNIS. Should work, in theory
<grin>

---------------------------

How does this look?  Now I need to find out if a 2800 supports custom
scripts.  I'm having trouble getting it loaded. AS for Feature Group D,
This trunk is using DTMF signaling, and it is not sending in
#<DD><ANI>*#<DNIS>* format like Cisco expects.  My understanding is I
can only change this expected format on the as5X00 gateways.

Thanks for all the help,

-Patrick



# app_NetPro.tcl
# Script Version 0.0.1
#------------------------------------------------------------------
#
# This tcl script collects DTMF digits, separates into ANI and DNIS 
# Then places the call.
#
#
proc init { } {
global param
set param(interruptPrompt) true
}
#################

proc act_Setup { } {
global dest
leg setupack leg_incoming
leg collectdigits leg_incoming param
}
}
################

proc act_GotDest { } {
global ani
global dnis
global fields
global digits
set status [infotag get evt_status]
if { $status == "cd_004" } {
set digits [infotag get evt_dcdigits]
set fields [split $digits *]
set ani [lindex $fields 1]
set dnis [lindex $fileds 2]
leg proceeding leg_incoming

set callinfo(destinationNum) $dnis
set callinfo(originationNum) $ani

leg setup $dnis callInfo leg_incoming
} else {
puts "\nCall [infotag get con_all] got event $status collecting
destination"
call close
}
}
################

proc act_Ignore { } {
# Dummy
puts "Event Capture"
}
################

proc act_Cleanup { } {
call close
}
#----------------------------------
# State Machine
#----------------------------------
set TopFSM(any_state,ev_disconnected) "act_Cleanup,same_state"
set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup,GETDEST"
set TopFSM(GETDEST,ev_collectdigits_done) "act_GotDest,PLACECALL"
set TopFSM(PLACECALL,ev_setup_done) "act_CallSetupDone,CALLACTIVE"
set TopFSM(CALLACTIVE,ev_disconnected) "act_Cleanup,CALLDISCONNECTED"
set TopFSM(CALLDISCONNECTED,ev_disconnected) "act_Cleanup,same_state"
set TopFSM(CALLDISCONNECTED,ev_media_done) "act_Cleanup,same_state"
set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state"
set TopFSM(CALLDISCONNECTED,ev_leg_timer) "act_Cleanup,same_state"




More information about the cisco-voip mailing list