cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14505
Views
5
Helpful
62
Replies

TBCT from Voice Gateway using IVR TCL

Tervis Tumbler
Level 1
Level 1

Here is my Scenario:

When call comes in to my voicegateway, normally they go to CUCM then UCCX, and people hear the prompt and the rest of story. Now, if I  redirect call to third party company from my UCCX script, two call legs are active during a call, and I loose two B channel while call is active.

Now, I talked to my career, and they can do TBCT, but this needs some TCL scripting on my voicegateway to release a call after redirection to third party company.

This is supposed to happen just if customer reaches specific phone number. So, basically if called number is for example "4444444" play a prompt to customer: " For order status press 1, For other query press 2." So if customer press 1, redirect call to another third party phone number then release call from our voicegateway, and if they press 2, normally send call to CUCM and the rest of story.

First, is there any sample script that I can look to get an idea.

Second, how do I apply this app to my dial-peer that can do the job correctly.

Any help would be appreciated.

Thank you,

62 Replies 62

From your debug you can see there is an error.

1762722: Jul 27 13:06:40.214: //11221592//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR

1762723: Jul 27 13:06:40.214: TCL script failure

        Result:

                         invalid command name "elseif"

1762724: Jul 27 13:06:40.214:   TCL script failure errorInfo:

                        invalid command name "elseif"

    while executing

"elseif {$select == "2"} {

        leg proceeding leg_incoming

        leg setup 4659 callInfo leg_incoming

"         }

    (procedure "act_GotPrompt" line 19)

    invoked from within

"act_GotPrompt"

Check out your "if" "else" "elseif" pairing

Thank you for respond. But here is the thing, I do choose "1" after prompt plays, how even script gets to that part to errors out. Unless I am not understanding this corredctly.

elseif {$select == "2"} {

        leg proceeding leg_incoming

        leg setup 4659 callInfo leg_incoming

This part should be run if I choose "2" from prompt.

I think it will go through script once to check the syntax when loading the script. Also check if there is any hidden character.

I think you might have extra "}"

I count them one more time they are even. But I am still wondering why when I put "1" as my choice to prompt, why it goes to elseif as if I chose "2".

Also, when I load the script I see it gets registered successfully.

Thank you,

Check for the control character call is disconnected because of that ERROR in debug.

It did go to "1" selection

according to debug

1762713: Jul 27 13:06:40.210: //11221592//TCL :/tcl_LegObjCmd:  leg setup 89990748 callInfo leg_incoming

Then somehow it doesn't recognize "elseif" and prompt the error

So, as you said it goes to "1" selection, then it should make a call to that external number, why even it goes to "elseif" when the first part of "if" matches. Unless this is the way TCL script works.

No,

It doesn't recognize it as "elseif" and then think it is a command that's why you got

invalid command name "elseif"

why don't you remove the space or change "elseif" to "if" see if you can pass that error

Thank you,

It was my if/then issue with placing one of the "}" in a wrong spot.Now the script is working,but still waiting for my career to enable TBCT.

I have one more thing here.In the script, if caller do not enter any option like 1 to transfer or 2 to get to internal extension, at this point I am waiting for 10 seconds ( which is the default), then I close the call.

Is there a way to replay the prompt ( which I can do this part) and give caller second chance to enter any options.Basically in the script, I want say if caller did not enter any number, play the prompt again, which I do but then what, how should I send caller to the part of the script that gets number and the rest of actions.

Here is the completed script :

proc init {} {

global param

set param(interruptPrompt) true

set param(terminationKey) #

}

proc act_Setup {} {

     leg proceeding leg_incoming

     leg connect leg_incoming

     media play leg_incoming en_enter_dest.au

}   

proc act_MediaDone {} {

     global param

     global select

     set pattern(select) .

     set callinfo(alertTime) 30   

     leg collectdigits leg_incoming param pattern

}

proc act_GotPrompt {} {

      

    global select

        set status [infotag get evt_status]

        if {$status == "cd_005"} {

        set select [infotag get evt_dcdigits]

      

        if {$select == "1"} {

        set callInfo(mode) redirect_at_connect

        set callInfo(notifyEvents) "ev_transfer_status ev_connected ev_progress"

        set callInfo(newguid) true

        leg setup 8444444444 callInfo leg_incoming

        } elseif {$select == "2"} {

        leg setup 4444 callInfo leg_incoming

        } else {

        puts "you  enter wrong number"

        }

        } else {

         puts "you did not enter any number" 

       # here is what I am pointing to, I want to replay the prompt, and caller have another chance to enter their option, instead of just closing call.

         act_Cleanup

        }

        }

     

proc act_CallSetupDone {} {

          

        set status [infotag get evt_status]

        if {$status == "ls_000"} {

        puts "call has been hairpinned"

        } elseif {$status == "ls_040"} {

        puts "call transfer sucessful statusis $status"

        act_Cleanup

        } else {

        puts "transfer status is %status"

        }

        }

proc act_Cleanup {} {

      call close

}

init

        #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_MediaDone MEDIAPLAY"

        set fsm(MEDIAPLAY,ev_collectdigits_done) "act_GotPrompt PLACECALL"

        set fsm(PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"

        set fsm(PLACECALL,ev_transfer_status) "act_CallSetupDone same_state"

        set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"

        set fsm(CALLDISCONNECT,ev_disconnected) "act_Cleanup same_state"

        fsm define fsm CALL_INIT

You check if there is digit entered, if not you can repeat the same step -- play prompt and collect digit.

There is a sample

its-CISCO.2.0.3.0.zip

in https://developer.cisco.com/site/voice-gateway/documentation/


Thank you, It worked.

TBCT is enabled, and  am testing this but still call gets haippinned. One thing I saw in TBCT configuration for IOS was that the incoming call needs to be answered. What I do is:

I have dial-peer with this config:

incoming called-number 4659 (DID)

service app_sample

port 0/0/0:23

Then I call 941-***-4659, and script start, asking for order status press 1. When they press 1, It makes call to external number. So before they choose option 1. I do not see any call active when I do " show voice call status". Could this be a reason that call does not get transferred since  the first incoming call does not get answered ( as I said before I am redirecting call before gets answred), and it just get connected to VG. Or something else causing call to get hairpinned.

Maybe you can open a DevNet support ticket. Cisco DevNet: Support

They can help you directly.

TBCT scritp is not much different from normal transfer script the only line need to add is set callinfo(mode) .....

People handles TBCT in different way that's why there is no standard script. If there is only one way to do TBCT I think Cisco will not ask user to use Tcl script.

If call is still hairpined I would also check with service provider. According to my experience chance is big that PSTN side TBCT feature is still not working right. Check from service provider side to see if transfer request is received and proper handled.

set callInfo(mode)  REDIRECT_AT_ALERT
set callInfo(destinationNumTon) "ton_subscriber"
fsm setstate PLACECALL2
leg setup $tbct_num callInfo leg_incoming

#TBCT transfer setup done

proc act_CallSetupDone2 { } {

set status [infotag get evt_status]

puts "callsetupdone2 status is : $status"

  

if { $status == "ls_000"} {
   puts "call transfer sucessful status is $status, but hairpined"  
   handoff appl leg_all default
   call close
} elseif {$status == "ls_040" || $status == "ls_041" || $status == "ls_026"} {
   puts "TBCT transfer sucessful status is $status"  
   call close
} else {
   puts "TBCT transfer unsucessful status is $status"
   call close
}

}