cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
1661
Views
5
Helpful
7
Replies
shettyajey
Beginner

Need help on TCL scripting

Hello Guys,

I am trying to create a TCL scipt  to play the greeting before the call reaches the destination.

I do not want to apply it to the incoming dial-peer but to the out-bound dial-peer pointing to the call manager.

Can any one help me out with a script for the same.

1 ACCEPTED SOLUTION

Accepted Solutions

For script itself, we get the destination number from  set dest [infotag get evt_handoff dnis] (for outbound dial peer)

instead of  set dest [infotag get leg_dnis]   (for in bound dialpeer)

That's what we need to do for script in outbound dialpeer.

To place the app in outbound dialpeer we need to add "out-bount" at the end

            dial-peer voice xxx

                        service  <name> out-bound

But you need to manage your destination number to prevent looping

For example you have destination number 1111 that triggers the script, script will capture 1111 as destination number, then if you setup the call with 1111 it will create a loop. That's what I mean that will make it more complicated. So you may create a temp outbound dialpeer only for Tcl script then another real one to reach out and in script you will change the dest number to real one to prevent it come back to script again.

View solution in original post

7 REPLIES 7
yawming
Cisco Employee

Just like to clarify your questions  before jumping to the solution.

I am trying to create a TCL scipt  to play the greeting before the call reaches the destination.

Q. Play greeting to calling or called party ?

I do not want to apply it to the incoming dial-peer but to the out-bound dial-peer pointing to the call manager.

Q. Do you mean Tcl App to apply or you mean promt to play ?

If we are talking about Tcl app, is there a reason we have to apply to out-bound ? Not saying that we cannot do it but usually make it  more complicated.

Thanks,

Yawming

Hello Yawming,

Thank you for responding

Greeting should be played to the calling party. Ex: Your call will be recorded.

Yes. I want to apply the TCL application to the outbound Dial-peer. Because, incoming calls some are routed to UCCE and some are routed to Call manager. It would be easier for me to apply the TCL script only to the outbound VOIP Dial-peer pointing to the Call manager.

For script itself, we get the destination number from  set dest [infotag get evt_handoff dnis] (for outbound dial peer)

instead of  set dest [infotag get leg_dnis]   (for in bound dialpeer)

That's what we need to do for script in outbound dialpeer.

To place the app in outbound dialpeer we need to add "out-bount" at the end

            dial-peer voice xxx

                        service  <name> out-bound

But you need to manage your destination number to prevent looping

For example you have destination number 1111 that triggers the script, script will capture 1111 as destination number, then if you setup the call with 1111 it will create a loop. That's what I mean that will make it more complicated. So you may create a temp outbound dialpeer only for Tcl script then another real one to reach out and in script you will change the dest number to real one to prevent it come back to script again.

View solution in original post

"I want to apply the TCL application to the outbound Dial-peer. Because, incoming calls some are routed to UCCE and some are routed to Call manager."

If you cannot break it into 2 dialpeers you can filter in Tcl script too.

For example one you need to play greeting one don't need then the no need one just "handoff" to IOS.

Got it.  Thank you so much

One more question. For incoming calls to play media I write the function

proc act_Media { } {

   

    global dest

    set dest [infotag get leg_dnis]

    leg proceeding leg_incoming

    leg progress leg_incoming

    leg connect leg_incoming

    media play leg_incoming flash:recording1.wav


What should be the function for outbound call to play media ?

It's the same but you use different command to get destination number

set dest [infotag get evt_handoff dnis]

and to be safe check lag status:

    set legState [infotag get leg_state leg_incoming]

    puts "TCL : Leg State is $legState"

    if {$legState != "lg_005" && $legState != "lg_008"} {

       if {$legState == "lg_001"} {

          puts ">>> TCL: legstate = lg_001 <<< \n"

          leg setupack leg_incoming

          leg proceeding leg_incoming

          leg connect leg_incoming

       } elseif {$legState == "lg_002"} {

          puts ">>> TCL: legstate = lg_002 <<<\n"

          leg proceeding leg_incoming

          leg connect leg_incoming

       } else {

         puts ">>> TCL: legstate = $legState <<<\n"

         leg connect leg_incoming

       }

   }

media play leg_incoming flash:recording1.wav

}

I will try this out. Thank you so much

Content for Community-Ad

This widget could not be displayed.