Created by: James Clapper on 23-07-2012 11:09:24 AM Trying to capture digits after a hookflash event on a CAS T1. Tried to use the ev_hookflash but that would not even allow the script to load. Now trying to use the ev_feature event. It works in getting the hookflash and then triggering my digit collection, but only about 1 out of every 6 times. Not certain what is going on here? I have messed with the timing on the voice port, changed FSM, and now pretty much stuck. Here is the script. Below is the logs that show that there is a hookflash that occurs and that the event kicks off only sometimes. proc init { } { global dcparams global hooksxfrdest global status global dest set dcparams(enableReporting) true set dcparams(dialPlan) false infotag set evt_feature_report hookflash onhook offhook puts "\n Initializing script..................." } proc act_Setup { } { global dest # Ensure there is a DNIS or close if { [infotag get leg_isdid] } { set dest [infotag get leg_dnis] } else { call close } # Setup inbound leg leg setupack leg_incoming leg proceeding leg_incoming leg connect leg_incoming # Setup to the DNIS leg setup $dest callInfo leg_incoming } proc act_Connected { } { global status # Ensure DID connected set status [infotag get evt_status] if { $status == "ls_000"} { puts "\n Call to Number successful" } else { puts "\n Call to Number did not connect" call close } } proc act_DigitCollect { } { puts [infotag get evt_event] global dcparams puts "\n Collecting Digits..................." leg collectdigits leg_outgoing #leg collectdigits [infotag get leg_all] dcparams } proc act_Xfer { } { puts "\n Transfering..................." #Something here if I can get this to work all the time.... } proc act_Cleanup { } { puts "\n Cleaning up..................." call close } init #------------------ # State Machine #---------------------------------- set fsm(any_state,ev_disconnected) "act_Cleanup same_state" ############## "Meat" of the script set fsm(CALL_INIT,ev_setup_indication) "act_Setup CONNECT" set fsm(CONNECT,ev_setup_done) "act_Connected CONNECTED" set fsm(CONNECTED,ev_feature) "act_DigitCollect XFEROUT" set fsm(XFEROUT,ev_collectdigits_done) "act_Xfer CLEANUP" set fsm(CLEANUP,ev_media_done) "act_Cleanup CALLEND" ############## Cleanup set fsm(CALLEND,ev_media_done) "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
Subject: RE: TCL ev_feature event inconsistent Replied by: Yaw-Ming Chen on 23-07-2012 01:59:45 PM I wonder how the call can be established?
Looks like the incoming leg is SIP Jul 10 01:48:42.162: //239520//TCL :/tcl_LegObjCmd: leg setup sip:19528284207@10.170.47.11:5060 callInfo leg_incoming
Let setup command only takes digits, so before the leg setup you may want to extract the calling number like regexp {[0-9]+} $dnis dnis
Subject: RE: TCL ev_feature event inconsistent Replied by: James Clapper on 23-07-2012 04:30:57 PM Thats a good question. It does however connect as you can see. Also get the IVR recording and status code is ls_000. Shouldn't this fail actually? Will try and pull out the DNIS and see if that is the core of my issue.
These are my dial-peers:
dial-peer voice 4207 voip service cast1hookflash incoming called-number 19528284207 dtmf-relay rtp-nte digit-drop h245-alphanumeric
dial-peer voice 4208 pots destination-pattern 19528284207 port 1/0:0 forward-digits 0
Subject: RE: TCL ev_feature event inconsistent Replied by: James Clapper on 23-07-2012 04:46:22 PM Got the digits only by adding the regex.
regexp {[0-9]{11}} $dest dest leg setup $dest callInfo leg_incoming
Still works, but same issue as before. Only seeing the hookflash event every once and a while.
Subject: RE: TCL ev_feature event inconsistent Replied by: Yaw-Ming Chen on 23-07-2012 05:01:40 PM Also put "infotag set evt_feature_report hookflash" in the beginning of act_setup procedure see if it helps.
Subject: RE: TCL ev_feature event inconsistent Replied by: James Clapper on 24-07-2012 08:48:14 PM That did it! Hey thanks much. Guess it makes sense not to have it in init if I think about it.
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: