cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1879
Views
4
Helpful
17
Replies

TCL: Check if DigitCollect is active on call leg

Hi all,

Can you please advise how i can verify if DigitCollect is already active on a call leg.

If ( DigitCollectLeg is not Active on leg)

{

# Issue DigitCollect on Leg

leg collectdigits leg_incoming PARAM

}

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

Can you please also collect deb voip app tcl and deb voip app scr.

I see you try to collect digit again, in what condition ? No digit entered ? Wrong digit ?

17 REPLIES 17
Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

You need to keep track of it by yourself.

For example

initialize "commandHandle" or a variable beginning of you script -- set commandHandle 0

Then somewhere in your script when you call leg collectdigits command

leg collectdigits leg_incoming PARAM2

set commandHandle [infotag get last_command_handle]

Now we have something else for commandHandle

You can check the value of commandHandle when it is needed and use "command terminate" if you need to terminate  "leg collectdigits" command

set returnCode [command terminate $commandHandle]

Re: TCL: Check if DigitCollect is active on call leg

Hi Yawchen,

Thank you!.

I still receive an error even when the terminate command is issued.

Code Snippet:

set commandHandle [infotag get last_command_handle]

        puts "\ncommandHandle = $commandHandle"

        set ifDigitCollect [string first "DigitCollect" $commandHandle]

        if { $ifDigitCollect == "0" } {

            puts "\n Digit Collect already exists"

            command terminate $commandHandle

            leg collectdigits leg_incoming PARAM

            media play leg_incoming _welcome.au

        } else {           

            puts "\n Issuing Digit Collect"

            leg collectdigits leg_incoming PARAM

            media play leg_incoming _welcome.au

        }

Logs:

7786038: Apr 14 16:35:20.716: //14297//TCL :/tcl_PutsObjCmd:

commandHandle = DigitCollect_0x49BD855C_0_1135919956

7786039: Apr 14 16:35:20.716:

7786040: Apr 14 16:35:20.716: //14297//TCL :/tcl_PutsObjCmd:

Digit Collect already exists

7786041: Apr 14 16:35:20.716:

7786042: Apr 14 16:35:20.716: //14297//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR

7786043: Apr 14 16:35:20.716: TCL script failure

        Result:

                         DigitCollect Command already active on leg

7786044: Apr 14 16:35:20.716:   TCL script failure errorInfo:

                        DigitCollect Command already active on leg

    while executing

"leg collectdigits leg_incoming PARAM"

    (procedure "act_Again" line 22)

    invoked from within

Highlighted
Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

Can not see the whole picture you may need to post your script or at least related section.

Re: TCL: Check if DigitCollect is active on call leg

Hi Yawchen,

Here is the script and callflow:

Thanks and Regards,

Bhavya Ramaswamy

Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

Can you please also collect deb voip app tcl and deb voip app scr.

I see you try to collect digit again, in what condition ? No digit entered ? Wrong digit ?

Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

Hi Bhavya,

As Yawming suggested, initially you can set commandHandle 0, when first time your issuing the leg collectdigits you can set last_command_handle then before second time your issuing leg collectdigits check if commandHandle not equal to zero if so terminate the command and issue the leg collectdigits.

Thanks,

Raghavendra

Re: TCL: Check if DigitCollect is active on call leg

Hi Yawchen, Raghavendra,

Thanks much.

set returnCode [command terminate $commandHandle] worked.

I was trying command terminate [$commandHandle] per the documents and it did not work.

http://www.cisco.com/c/en/us/td/docs/ios/voice/tcl/developer/guide/tclivrv2/tclivrv2_ch3.html#wp1047668

The step started working after i removed the square braces.

if { $dest == "1" } {
   media play leg_incoming _address.au   
   set commandHandle [infotag get last_command_handle]
   puts "\ncommandHandle = $commandHandle"
   set ifDigitCollect [string first "DigitCollect" $commandHandle]
   if { $ifDigitCollect == "0" } {
   puts "\n Cancelling digit collect"
   command terminate $commandHandle
   }  
    }

....

Beginner

Re: TCL: Check if DigitCollect is active on call leg

Hi

is worked this script ? But I uploaded can not workimg.please share last script

Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

Hi Aydin,

If you are looking for its-cisco.2.0.2.0 script, you can download from the below link.

https://software.cisco.com/download/release.html?mdfid=277641082&softwareid=283451126&release=2.0.2.0&rellifecycle=&relind=AVAILABLE&reltype=all

latest 2.0.3.0 is available in the below location.

https://developer.cisco.com/site/voice-gateway/downloads/sample-scripts/index.gsp

Thanks,
Raghavendra

Beginner

Re: TCL: Check if DigitCollect is active on call leg

Hi Gutty

Now this scrit working .But I changing script.I want to menu option ; for examle press 1 to 4000 , press 2 3000 and wrong number repeat position.

Thanks

Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

You can check the conditions after collecting the digits in act_GotDest procedure.

For example :

if { $dest == "0" } {
    set dest $oprtr
}

Thanks,
Raghavendra

Beginner

Re: TCL: Check if DigitCollect is active on call leg

Hi

Thank you for your help.I change below for menü option 1-2-3 .but not worked.

if { ($status == "cd_004") } {

set dest

set destExtLen

set extLength

if { $dest == "0" } {

set dest $oprtr

}

if { $dest == "1" } {

leg setup "94735646" callInfo leg_incoming

}

if { $dest == "2" } {

leg setup "94735648" callInfo leg_incoming

}

if { $dest == "3" } {

leg setup "94735649" callInfo leg_incoming

}

#handoff callappl leg_incoming default "DESTINATION=$dest"

if {($maxExtensionLen > 0) && ($extLength >= 0)} {

leg setup $dest callInfo leg_incoming

} else {

set busyPrompt invalidextn.au

act_Select

}

Cisco Employee

Re: TCL: Check if DigitCollect is active on call leg

I think you can set destination as below instead of issuing leg setup agian as there is code below to do that.

set dest 94735646

Thanks,
Ragahvendra

Beginner

Re: TCL: Check if DigitCollect is active on call leg

I changed set dest 94735646 , but not work  , play reenter prompt.

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.