cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10925
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,

1 Accepted Solution

Accepted Solutions

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

View solution in original post

62 Replies 62

yawming
Cisco Employee
Cisco Employee

There are many ways to do TBCT. In yous case looks like the trigger is pulled by customer.

Call first reach the GW, Tcl script play prompt if caller press 1 the TBCT will be triggered, otherwise will go to CUCM.

There is no TBCT script flowing around. I think mainly is due to the transfer scenarios can be so different.

You configure TBCT Tcl script just like normal Tcl IVR script but you do need to do some IOS config for TBCT service.

Cisco IOS Voice Command Reference - Commands: isdn bind-l3 through ixi transport http  [Cisco IOS Software Releases 12.3…

I think it may be worth to open a DevNet support ticket if you are not sure about Tcl script.

Cisco DevNet Support

Thank you for respond.

Is it possible to open a DevNet support just for one case, or we need to have a DevNet support contract?

Thank you,

Yes, now is case by by case. Cisco DevNet Support

Before you open the ticket you may want to confirm your call scenario is what bed I have described. And think about when do yo want to release B channel ? 1. When transfer to party is ringing ? Or 2. When transfer to party answered ?

What if transfer to party is unable to answer for whatever reason, what would you like to do ? (How t handle the exception ?)

Voice Gateway API is the technology you will use for opening ticket.

Thanks.

One more thing. How resource consuming will be this script to run, since this is a main number that we get 90 percent of our calls on it? So, basically this script will be running almost all the time.

Also I found a template scrip on this link : TBCT TCL Script template

Is this where TBCT happening in this script or to clarify when the script initiate TBCT request:

proc act_CallSetupDone { } {

global beep

set status [infotag get evt_status]

if { $status == "ls_000"} {

puts " call has been hairpinned "

puts "CLI_3:END:FAIL "

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

puts "call transfer sucessful status is $status "

puts "CLI_3:ENDASSED "

act_Cleanup

} else {

puts " transfer status is $status "

Let's say customer calls 4444 which is DID, then under Dial-Peer that I make exactly for that called number I send call to external number. Now at this point script receives Ls_040 as a status then call get closed.

Is this how TBCT work. Or I am not understanding this correctly?

There are REDIRECT_AT_ALERT and REDIRECT_AT_CONNECT, commonly used for TBCT.

REDIRECT_AT_ALERT -- if doing TBCT, PSTN switch will disconnect transfer by leg and trying to connect to transfer to leg. (there is a chance that transfer to leg won't get connected but transfer by leg disconnected already)

REDIRECT_AT_CONNECT transfer by leg is disconnected only when the transfer to leg is connect.


Apart from TCL script , you also need to configure IOS side for TBCT.


Thanks,

Raghavendra

Thank you for respond Raghavendra

Ok, here is my scenario: User call to 941-441-4659 number, number gets redirected to my voicegateway, and there is a DID setup for 4659. Now, I have dial-peer incoming called-number 4659. Call hits Dial-peer, then I play prompt to say " for order status press 1", and I will redirect call to external number and TBCT should happen, and " for other query press 2" then if they press 2 I send call to CUCM for the rest of stuff.

Here is the script I put together, can you please take a look and tell me if I am way off the track, or I am in a right track.

Any help would be appreciated.

proc init { } {

global param

set param(interruptPrompt) true

set param(terminationKey) #

}

    

     

proc act_Setup {} {

             

     global select

     leg proceeding leg_incoming

     leg connect leg_incoming

     set callInfo(mode) redirect_at_connect

     set callInfo(notifyEvents) "ev_transfer_status ev_connected ev_progress"

     media play leg_incoming _welcome.au

     set pattern(select) .

     leg collectdigits leg_incoming params pattern

proc act_GotPrompt{} {

     

        set status [infotag get evt_status]

          if { status == "cd_005" }

          set select [ infotag get evt_dcdigits]

          if { select == "1" }  {

          leg proceeding leg_incomong

          leg setup 819414444444 callInfo leg_incoming

          }

         

          elseif { select == "2" } {

          leg proceeding leg_incomong

          leg setup 4659 callInfo leg_incoming

          } 

         

          else  {

          call close

          }

          else {

          call close

          }

          }

          }

      

           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"

           } 

           }

           #state Machine

          

           set fsm(any_state,ev_disconnected) "act_Cleanup same_state"

           set fsm(CALL_INIT,ev_setup_indication) "act_setup GETPROMPT"

           set fsm(GETPROMPT,ev_collectdigits_done) "act_GorPrompt PLACECALL"

           set fsm( PLACECALL,ev_setup_done) "act_CallSetupDone CALLACTIVE"

           set fsm( PLACECALL,ev_transfer_status) "act_CallSetupDone same_state"

You need to set callInfo before leg setup command, consider raising a Dev Net support case if you have any issues with the script.

Thanks,

Raghavendra

Thank you,

I simplified my script in a way that if someone call 941-441-**** in which **** is a DID, call hits VoceGateway then gets redirected to 88888888. Now, what is happening is call rings to that external phone, but as soon as I answer, call gets ended with this error. here is a debug when call takes place:

1750164: Jul 22 16:19:12.463: //11185160//TCL :/tcl_LegObjCmd:  leg proceeding leg_incoming

1750165: Jul 22 16:19:12.463: //11185160//TCL :/tcl_LegProceedObjCmd: proceeding leg_incoming

1750166: Jul 22 16:19:12.463: //11185160//AFW_:/vtd_lg_incoming: argc 2

1750167: Jul 22 16:19:12.463: //11185160//AFW_:/vtd_lg_incoming: Legs [11185160 ]

1750168: Jul 22 16:19:12.463: //11185160//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1750169: Jul 22 16:19:12: %VOICE_IEC-3-GW: TCL_IVR: Internal Error (Invalid action in script): IEC=1.1.180.2.25.6 on callID 11185160 GUID=B8C91F002FE511E5B8E440553986D010

1750170: Jul 22 16:19:12.463: //11185160//AFW_:/AFW_FSM_Drive: Tcl_Eval to drive FSM inside Tcl modulespace. code=1 code=ERROR

1750171: Jul 22 16:19:12.467: TCL script failure

        Result:

                         Illegal Operation: Leg not incoming or in wrong state

1750172: Jul 22 16:19:12.467:   TCL script failure errorInfo:

                        Illegal Operation: Leg not incoming or in wrong state

    while executing

"leg proceeding leg_incoming

    (procedure "act_setup" line 3)

    invoked from within

"act_setup"

And here is my simplified script:

     global param

    

     set param(interruptPrompt) true

     set param(terminationKey) #

}

proc act_setup {} {

     leg proceeding leg_incoming

     leg connect leg_incoming

     set callInfo(mode) redirect_at_connect

     set callInfo(notifyEvents) "ev_transfer_status ev_connected ev_progress"   

     set callInfo(newguid) true

     leg setup 88888888 callInfo leg_incoming

     

}

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 PLACECALL"

set fsm(PLACECALL,ev_setup_done) "act_setup CALLACTIVE"

set fsm(PLACECALL,ev_transfer_status) "act_setup CALLACTIVE"

set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"

set fsm(CALLDISCONNECT,ev_disconnected) "act_Cleanup same_state"

fsm define fsm CALL_INIT

Please help me understand  what is that error about?

The error because you are calling act_setup again once call is established.

set fsm(PLACECALL,ev_setup_done) "act_setup CALLACTIVE"

Please refer TCL IVR programming guide and our samples in below location. You can also refer our videos.

Cisco VGAPI

Thanks,

Raghavendra

Thank you again, I fixed it and now call gets connected. I added this part :

proc act_SetupDone {} {

      set status [infotag get evt_status]

      if {$status == "ls_040"} {

      puts "call transfer sucessful statusis $status"     

      } else {

      puts "transfer status is %status"

}

and expect to see " call transfer successful statusis $status" ,but what I see is the else part which say " puts "transfer status is %status" .

I want to make sure that I am transferring call correctly before turn on TBCT on IOS.


Am I doing right thing to transfer call? if yes why I do not see status of call as transferred. And here is a corrected script:

If not, how can I transfer ( or better say redirect )call from VoiceGateway to another external number.

proc init {} {

     global param

    

     set param(interruptPrompt) true

     set param(terminationKey) #

}

proc act_setup {} {

     leg proceeding leg_incoming

     leg connect leg_incoming

     set callInfo(mode) redirect_at_connect

     set callInfo(notifyEvents) "ev_transfer_status ev_connected ev_progress"   

     set callInfo(newguid) true

     leg setup 88888888 callInfo leg_incoming

}

proc act_SetupDone {} {

      set status [infotag get evt_status]

      if {$status == "ls_040"} {

      puts "call transfer sucessful statusis $status"     

      } 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 PLACECALL"

set fsm(PLACECALL,ev_setup_done) "act_SetupDone CALLACTIVE"

set fsm(PLACECALL,ev_transfer_status) "act_SetupDone CALLACTIVE"

set fsm(CALLACTIVE,ev_disconnected) "act_Cleanup CALLDISCONNECT"

set fsm(CALLDISCONNECT,ev_disconnected) "act_Cleanup same_state"

fsm define fsm CALL_INIT

What is the status code you got is it ls_000, if so call is hair pinned. You Need to configure TBCT on IOS side and also make sure TBCT enabled from service provider side.

Thanks,

Raghavendra

Thank you Raghavendra ,

Yes, the status code I get is ls_000, and call is hair pinned.  I have not configure TBCT yet, but I thought  I should get ls_040 as call is being transferred although I do not have configure TBCT. That is because I thought TBCT just help to release the channel and I should see ls_040 as status code regardless.

So, you are saying the way I am transferring is correct, I just need to enable TBCT. Honestly I was thinking because I am redirecting call before It gets answer, I see ls_000.

It will be appreciated if you clarify, I want to make sure I understand this correctly. Thank you again.

I think you are doing correct way, you can enable TBCT feature and test.

Thanks,

Raghavendra

Thank you again.

While I am waiting for my career to enable TBCT, I am trying to finalized my script as I want it to be at the end.

I put this together, I hear prompt asking to enter number then as soon as I put " 1 " call gets disconnected. Her is the 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 tftp://10.172.28.134/en_enter_your_choice.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 89990748 callInfo leg_incoming

       

         }

         

        elseif {$select == "2"} {

        leg setup 4659 callInfo leg_incoming

          } 

         

        else  {

        call close

        }

        else {

        call close

        }

        }

        }

      

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

And here is a debug when I call the script:

1762685: Jul 27 13:06:36.814: //11221592//TCL :/tcl_LegObjCmd:  leg proceeding leg_incoming

1762686: Jul 27 13:06:36.814: //11221592//TCL :/tcl_LegProceedObjCmd: proceeding leg_incoming

1762687: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: argc 2

1762688: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: Legs [11221592 ]

1762689: Jul 27 13:06:36.814: //11221592//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1762690: Jul 27 13:06:36.814: //11221592//TCL :/tcl_LegObjCmd:  leg connect leg_incoming

1762691: Jul 27 13:06:36.814: //11221592//TCL :/tcl_LegConnectObjCmd: connect leg_incoming

1762692: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: argc 2

1762693: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: Legs [11221592 ]

1762694: Jul 27 13:06:36.814: //11221592//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1762695: Jul 27 13:06:36.814: //11221592//PACK:/tcl_MediaObjCmd:  media play leg_incoming tftp://10.172.28.134/en_enter_dest.au

1762696: Jul 27 13:06:36.814: //11221592//PACK:/tcl_MediaPlayObjCmd:  play leg_incoming tftp://10.172.28.134/en_enter_dest.au

1762697: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: argc 3

1762698: Jul 27 13:06:36.814: //11221592//AFW_:/vtd_lg_incoming: Legs [11221592 ]

1762699: Jul 27 13:06:36.814: //11221592//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1762700: Jul 27 13:06:36.814: //11221592//PACK:/Media_Play_Start:

1762701: Jul 27 13:06:36: %ISDN-6-CONNECT: Interface Serial0/0/0:5 is now connected to 9419990748 N/A    

1762702: Jul 27 13:06:39.258: //11221592//TCL :/tcl_LegObjCmd:  leg collectdigits leg_incoming param pattern

1762703: Jul 27 13:06:39.258: //11221592//AFW_:/vtd_lg_incoming: argc 4

1762704: Jul 27 13:06:39.258: //11221592//AFW_:/vtd_lg_incoming: Legs [11221592 ]

1762705: Jul 27 13:06:39.258: //11221592//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1762706: Jul 27 13:06:40.206: //11221592//TCL :/tcl_InfotagObjCmd:  infotag get evt_status

1762707: Jul 27 13:06:40.210: //11221592//TCL :/tcl_InfotagGetObjCmd: infotag get evt_status

1762708: Jul 27 13:06:40.210: //11221592//AFW_:/vtr_ev_status: argc 2 argindex 2

1762709: Jul 27 13:06:40.210: //11221592//TCL :/tcl_InfotagObjCmd:  infotag get evt_dcdigits

1762710: Jul 27 13:06:40.210: //11221592//TCL :/tcl_InfotagGetObjCmd: infotag get evt_dcdigits

1762711: Jul 27 13:06:40.210: //11221592//AFW_:/vtr_ev_dcdigits: argc 2

1762712: Jul 27 13:06:40.210: //11221592//AFW_:/vtr_ev_dcdigits: DCDIGITS [1]

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

1762714: Jul 27 13:06:40.210: //11221592//AFW_:/vtd_lg_incoming: argc 4

1762715: Jul 27 13:06:40.210: //11221592//AFW_:/vtd_lg_incoming: Legs [11221592 ]

1762716: Jul 27 13:06:40.210: //11221592//Tcl :/tcl_parseCallID_vartagObj: VARTAG Translation Leg Count=1

1762717: Jul 27 13:06:40.210: //-1//CSPK:/tclSetControlParams: mode(7) = redirect_at_connect

1762718: Jul 27 13:06:40.210: //-1//CSPK:/tclSetControlParams: set new guid

1762719: Jul 27 13:06:40.210: //-1//CSPK:/tclSetControlParams: Notify Signaling Mask=148

1762720: Jul 27 13:06:40.210: //11221592//TCL :/tcl_FSMObjCmd:  fsm setstate PLACECALL

1762721: Jul 27 13:06:40.210: //11221592//TCL :/tcl_FSMSetStateObjCmd: setstate setstate PLACECALL

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"