cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
998
Views
0
Helpful
4
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Varun Sharma on 09-02-2012 01:06:30 PM
Hey,
 
I'm working on a script where we want all incoming calls to the voice gateway hear a welcome prompt before the call gets connected to the CME phones.
 
We also want the ability to accept a escape key (say digit '5'). If the caller hits the escape key while the prompt is being played. the prompt will be skipped and call will be transferred to the phone.
 
If the caller doesn't hit the escape key they will hear the welcome prompt and then be transferred to the phone.
 
In our script, we can successfully play the welcome prompt and transfer the call to the phone. How do we incorporate the logic of the escape key?
Here is our script:
 
proc act_Setup { } {
   
    puts "\n PLAY WELCOME PROMPT"
    leg setupack leg_incoming
    leg proceeding leg_incoming
    leg connect leg_incoming
    media play leg_incoming flash:6900.au
}

proc act_GetDest { } {

    puts "\n COLLECT ESCAPE KEY FROM USER"
    set param(dialPlan) true
    set param(dialPlanTerm) true
    leg collectdigits leg_incoming param
}


proc act_GotDest { } {
    global dest
 
    puts "\n RECEIVED DIGITS"
    set status [infotag get evt_status]
    puts "\n DIGIT COLLECT STATUS = $status"
    set dest [infotag get evt_dcdigits]
    leg setup $dest callInfo leg_incoming
}

proc act_CallSetupDone { } {
 
    puts "\n CALL SETUP"
    set status [infotag get evt_status]
    puts "\n CALL STATUS = $status"
 
    if { $status == "ls_000"} {
        puts "\n You have sucessfully placed the call to the destination !"
    } else {       
        puts "\n Sorry your call was not connnected !"
        call close
    }
}

proc act_Cleanup { } {
   
    puts "\n DISCONNECTING CALL"
    set status [infotag get evt_status]
    puts "\n STATUS is $status"
    call close
}

#----------------------------------
#   State Machine
#----------------------------------
  set FSM(any_state,ev_disconnected) "act_Cleanup,same_state"
  set FSM(CALL_INIT,ev_setup_indication) "act_Setup,MEDIAPLAY"
  set FSM(MEDIAPLAY,ev_media_done)  "act_GetDest,GETDEST"
  set FSM(GETDEST,ev_collectdigits_done) "act_GotDest,PLACECALL"
  set FSM(PLACECALL,ev_setup_done)  "act_CallSetupDone,CALLDISCONNECTED"
  set FSM(CALLDISCONNECTED,ev_disconnected) "act_Cleanup,same_state"
  set FSM(CALLDISCONNECTED,ev_media_done)  "act_Cleanup,same_state"
  set FSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state"

fsm define FSM  CALL_INIT
 
 
 
I tried to include the act_GetDest and act_GotDest functions, but now every caller has to hit the escape key ('0') to get the call connected after the prompt is played. I was the escape key to be more of a hidden option.
 
Is it possible to do the above in a TCL script? Any assistance would be appreciated.

Subject: RE: TCL Media Play - Escape key to skip prompt
Replied by: Anusha Kannappan on 10-02-2012 12:15:21 AM
Hi Varun,

You can try setting the following param in your act_GetDest procedure

set params(interruptPrompt) true

param¿An array of parameters that defines how the digits are to be collected.
param(interruptPrompt)¿Whether to interrupt the prompt when a key is pressed. Possible values are true and false. The default is false.


Thanks,
Anusha

Subject: RE: TCL Media Play - Escape key to skip prompt
Replied by: Varun Sharma on 10-02-2012 12:02:21 PM
Hey Anusha,

We wouldn't get to the act_GetDest procedure until the Media play completes playing the prompt. So shouldn't I include the "set params(interruptPrompt) true" in the act_Setup procedure?
I did include the "set params(interruptPrompt) true" in the act_Setup procedure and still the prompt isn't interrupted after a key press..

Thanks,
Varun

Subject: RE: TCL Media Play - Escape key to skip prompt
Replied by: Yaw-Ming Chen on 10-02-2012 12:40:10 PM
remove
    set param(dialPlan) true
    set param(dialPlanTerm) true
If you don't need
set params(interruptPrompt) true" should be set before leg collectdigit
You can set maxDigit you like to collect then analyze digit(s) in script
Comments
augthoma
Cisco Employee
Cisco Employee

Is this resolved?

Can you give the solution for this..

Raghavendra G V
Cisco Employee
Cisco Employee

Could you please explain more detail about your issue.

Thanks,

Raghavendra

nthrivik
Cisco Employee
Cisco Employee

I have given like this.

    set params(interruptPrompt) true

    set params(maxDigit) 1

but not able to skip the media by a key press.

proc act_Setup { } {

  

    puts "\n PLAY WELCOME PROMPT"

    leg setupack leg_incoming

    leg proceeding leg_incoming

    leg connect leg_incoming

    media play leg_incoming flash:6900.au

}

proc act_GetDest { } {

    puts "\n COLLECT ESCAPE KEY FROM USER"

    set params(interruptPrompt) true

    set params(maxDigit) 1

    leg collectdigits leg_incoming param

}

proc act_GotDest { } {

    global dest

    puts "\n RECEIVED DIGITS"

    set status [infotag get evt_status]

    puts "\n DIGIT COLLECT STATUS = $status"

    set dest [infotag get evt_dcdigits]

    leg setup $dest callInfo leg_incoming

}

proc act_CallSetupDone { } {

    puts "\n CALL SETUP"

    set status [infotag get evt_status]

    puts "\n CALL STATUS = $status"

    if { $status == "ls_000"} {

        puts "\n You have sucessfully placed the call to the destination !"

    } else {      

        puts "\n Sorry your call was not connnected !"

        call close

    }

}

proc act_Cleanup { } {

  

    puts "\n DISCONNECTING CALL"

    set status [infotag get evt_status]

    puts "\n STATUS is $status"

    call close

}

#----------------------------------

#   State Machine

#----------------------------------

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

  set FSM(CALL_INIT,ev_setup_indication) "act_Setup,MEDIAPLAY"

  set FSM(MEDIAPLAY,ev_media_done)  "act_GetDest,GETDEST"

  set FSM(GETDEST,ev_collectdigits_done) "act_GotDest,PLACECALL"

  set FSM(PLACECALL,ev_setup_done)  "act_CallSetupDone,CALLDISCONNECTED"

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

  set FSM(CALLDISCONNECTED,ev_media_done)  "act_Cleanup,same_state"

  set FSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state"

fsm define FSM  CALL_INIT

Raghavendra G V
Cisco Employee
Cisco Employee

You are trying to collect digits after media is completed, try as below in act_setup procedure
  
    media play leg_incoming flash:6900.au
    set params(interruptPrompt) true
    set params(maxDigit) 1

    leg collectdigits leg_incoming params

set FSM(CALL_INIT,ev_setup_indication) "act_Setup,MEDIAPLAY"

set FSM(MEDIAPLAY,ev_collectdigits_done) "act_GotDest,PLACECALL"

Thanks,
Raghavendra

Getting Started

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:

Quick Links