cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3359
Views
0
Helpful
11
Replies

Why my script is not running?

luisbethancourt
Level 1
Level 1

I have a 2901 with IOS 15.0(1r)M16 with CME (telephony services version 8.6), And I have been trying to emulate the way Nortel manages pin numbers, and so far, I think the only way of achieving this on the CME, is to have a custom script to capture the PIN and compare it to a stored parameter value.

So I have been reading the documentation nonstop for the past couple of days, and I have found a way that should work.  However, the scripts that I have been testing (even the simplest ones) don't even care to run...  so I was wondering if my specific configuration is the problem...

I have 3 dial-peers, and I created a new one just to test my script,  one of the dial-peers has a 22... prefix, the other a 32... prefix, the othe a 9T prefix, and the new one I created is has a dial pattern of 22482 (my extension),  this is the configuration:

dial-peer voice 5 voip

service fac_test

destination-pattern 22482

session protocol sipv2

session target ipv4:10.1.0.51

incoming called-number 22482

dtmf-relay rtp-nte

codec g711ulaw

this is the fac_test script:

proc init { } {

    puts "testing"

    puts "this is the init procedure"       

}

proc act_Cleanup { } {

    puts "testing"

    puts "this is the act_Cleanup procedure"

    set evt_name [infotag get evt_event]

    call close

}

init

set FSM(any_state,ev_setup_indication)     "act_Cleanup, same_state"

set FSM(any_state,ev_disconnected)         "act_Cleanup, same_state"

fsm define FSM CALL_INIT

When I load my script, the trace shows the test on the init procedure, but when I dial my extension, I expect the script to run and at least to see some kind of output on the trace that I have on the router, but nothing comes up...  I have been debugging with debug voice application and I can trace the sequence of events, however, I am not sure why the events doesn't trigger my script functions.

Any help will be appreciated.

Best regards,

LC

11 Replies 11

Raghavendra G V
Cisco Employee
Cisco Employee

Hi LC,

Your initial state should be as below.

set fsm(CALL_INIT,ev_setup_indication) "act_Setup  GETDEST"

fsm define fsm CALL_INIT

you can refer TCL IVR programming guide and also refer our videos in below location, it will be helpful.

https://developer.cisco.com/site/collaboration/call-control/voice-gateway/documentation/

Thanks,

Raghavendra

Hello Raghavendra,

Thank you very much for the response.

I just changed the script to:

proc init { } {

    puts "testing"

    puts "this is the init procedure"       

}

proc act_Setup { } {

    puts "testing"

    puts "this is the act_Setup procedure"

    set evt_name [infotag get evt_event]

}

proc act_Cleanup { } {

    puts "testing"

    puts "this is the act_Cleanup procedure"

    set evt_name [infotag get evt_event]

    call close

}

init

set fsm(CALL_INIT,ev_setup_indication) "act_Setup  GETDEST"

set fsm(any_state,ev_disconnected)     "act_Cleanup same_state"

fsm define fsm CALL_INIT

Still nothing going on,  when I load the application, the init procedure runs, and I can see the output of the PUTS commands, the show dial-peer voice 5 shows that the fac_test is linked as the "inbound application associated",  when I load the application with call application voice load fac_test, I get:

Jul  5 12:37:18.858: //-1//HIFS:/hifs_ifs_cb: hifs ifs file read succeeded. size=517, url=tftp://10.1.101.129/fac/test.tcl

Jul  5 12:37:18.858: //-1//HIFS:/hifs_free_idata: hifs_free_idata: 0x2AD46124

Jul  5 12:37:18.858: //-1//HIFS:/hifs_hold_idata: hifs_hold_idata: 0x2AD46124

Jul  5 12:37:18.858: //-1//AFW_:EE2B28D788000:/Tcl_Link: Linking script fac_test

Jul  5 12:37:18.862: //-1//TCL :EE2B28D788000:/tcl_PutsObjCmd: testing

Jul  5 12:37:18.862:

Jul  5 12:37:18.862: //-1//TCL :EE2B28D788000:/tcl_PutsObjCmd: this is the init procedure

Jul  5 12:37:18.862:

Jul  5 12:37:18.862: //-1//TCL :EE2B28D788000:/tcl_FSMObjCmd:  fsm define fsm CALL_INIT

Jul  5 12:37:18.862: //-1//TCL :EE2B28D788000:/tcl_FSMDefineObjCmd: State Machine: Array fsm: Start State: CALL_INIT

Jul  5 12:37:18.862: //-1//TCL :EE2B28D788000:/tcl_FSMDefineObjCmd: FSM Data structure

Jul  5 12:37:18.862: (any_state(0), ev_disconnected(20)--(act_Cleanup)-->(any_state(0))

Jul  5 12:37:18.862: (CALL_INIT(1), ev_setup_indication(34)--(act_Setup)-->(GETDEST(2))

Jul  5 12:37:18.862: FSM start state CALL_INIT(1)

Jul  5 12:37:18.862: //-1//AFW_:EE2B28D788000:/Tcl_Link: Script fac_test succesfully linked.

still, when I dial the extension, nothing happens.  I turned on all application debugging, and I can trace all the events, and I noticed that the dial-peer is selected much later than the ev_setup_indication event takes, place...  maybe this is the problem?

Any other help will be highly appreciated.

LC

I did a full debug on the app, I am attaching the output.

Thanks in advance

LC

Hi LC,

From your logs the dial peer 5 is picked as outbound dial peer not incoming dial peer. If you want script to be trigger for outbound you need configure as "service fac_test outbound".

Jul  5 13:12:23.630: //91//Dest:/DestDialPeerFilter: Checking peer [5]

Jul  5 13:12:23.630: //91//Dest:/DestPeerFilterRouteCode: Route Code not available in callInfo

Jul  5 13:12:23.630: //-1//Dest:/DestOutboundCallUsingPeer: Outgoing Tag(5) calling[3804] called[22482]

Thanks,

Raghavendra

Hello again Raghavendra,

I wonder if you can post the output of a script that is actually running?

Also I wonder if there is a place where I can take a look at the workflow of how a script gets triggered,  I think my problem may be that when the call event setup indicator is launched, the dialpeer has not been selected yet, so the router has no indication to execute the act_Setup procedure.

Best regards,

LC

Hi LC,

you can refer "Configuring an Outbound Application" section in below document.

https://developer.cisco.com/fileMedia/download/39458a9d-2357-4dd0-a274-4028a2deed04

Example:

configure terminal

dial-peer voice number voip

   application name out-bound

   destination-pattern string

Thanks,

Raghavendra

Hello Raghavendra and thank you very much for the insight,

Finally I am seeing some light at the end of the tunnel, I configured the "service fac_test out-bound" and the script is launching when the peer 5 is activating.  However, It is only picking the call close event,  I wonder if the application itself should be different for inbound and outbound dial-peers.  I saw one script (but can't find it right now) that instead of using a FSM, it made a while loop on the main program to capture the information and controlling the flow of the call.

Should I be changing my program approach?

Best regards,

yes, your programming approach should be different when you apply script under outgoing dial peer, normally script should be applied on the incoming dial peer.

please refer programming guide for more information in below link.

https://developer.cisco.com/site/collaboration/call-control/voice-gateway/documentation/

Thanks,

Raghavendra

I think I am not following something here.  How can I make the dial peer to be inbound and not outbound?  I have read documentation on configuring inbound and outbound dial-peers, but can't seem to force the peer to be marked as inbound.

LC

i think in your case call is going out of gateway, if call is coming into the gateway then you can apply script under incoming dial peer.

If you apply script under outgoing dial peer then the script will receive ev_handoff instead of ev_setup_indication,so your code should be like below

set fsm(CALL_INIT,ev_handoff) "act_Setup  GETDEST"

Thanks,

Raghavendra

If you receive the call, IOS will identify an incoming dial-peer. It is a universal dial-peer as any other but for this very

call it was identified as THE incoming. Next step the IOS perfoms digit analysis, performs digit translation etc. An outcome of this is a set of ultimate numbers like DNIS, ANI etc. This will be used to match THE outgoing dial-peer. Again a universal peer. If you link the dial-peer to an application like TCL or VXML, it will receive different events. Most TCL an VXML

applications have been written to be used with inbound dialpeers. If you want to take an existing application that was designed to be used as inbound and want to use it as outbound, you have to change it significantly.