cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1233
Views
5
Helpful
0
Replies

[Full call control in tcl] Call transfer

A C
Level 1
Level 1

Hello all,

this is a post to clarify how call transfer works in tcl.

Background info and rationale: my goal is to create a full replacement of builtin:Session_Service.C in TCL with superset of enhancements (like talking to and notifying external HTTP servers).

I'll start (if that's ok with the community) a few posts to clarify some spots of TCL-IVR programming that, imho, are not well documented.

Hopefully this will be handy for me, in the first place, and other users of the community struggling with some blind spots of the manual.

I think, sometimes, RTFM it's not the right answer.

Cheers!

  • The big picture


Call transfers in tcl has to be seen as a multi-step operation.


  1. First, a call has to be created (or inherited) by a tcl script.
    This call will have 2 legs: say leg 1 is incoming and 2 is outgoing.
    At a certain moment in time, user on leg A (or B, but let's assume it is A...) will want to transfer the call to another extension.
    He presses the "Transfer" button on the phone.

  2. Here comes the second step: a new call is started from phone A to phone C.
    This call is internally assigned a consultation id.
    Once user C answers user on A talks to C and tells him he want to transfer B to him.
    After talking to C, user on A presses the transfer button once again.
    (Actually, A can press the transfer button even before C answers, but this makes no difference for the purpose of this post).
    This phase can happen in another tcl script or in the default session.

  3. Here starts the third step: a notification (event) is sent to the tcl script that is managing the call between A and B (legs 1 and 2).
    This notification holds the information about the call leg that has to be transferred, such as who is starting the transfer, who must receive the transfer and the consultation id of the call that was setup at second step.

  4. Now, tcl script starts the fourth step.
    At this point, tcl script must destroy the connection between leg 1 and leg 2 (user A and B) and wait for the confirmation that the conference has really been destroyed.

  5. Once confirmed, the tcl script starts the fifth step.
    A new call has to be setup with some special informations, such as the user (C) to which the leg (2) has to be transferred to and the consultation id that was assigned at step two and received during step three.
    This is not quite a regular phone call, it is just a leg handoff to the handler (another tcl script, perhaps) that is taking care of the second call that was started at step two.

  6. The sixth (and final) step is to wait for the call created at step five to be "connected" (actually, handoff) and send a message to leg 1 (A) in order to disconnect this leg properly.

  • Recap


So, if this was TL;DR ... here's a shorter version:


  1. TCL SCRIPT receives a call from A and connects it to B
  2. A presses transfer and enters the digits
  3. A presses transfer again
  4. TCL SCRIPT receives an event, disconnects A from B
  5. TCL SCRIPT calls B with a special crafted leg setup message and waits for B to get the call (the leg)
  6. TCL SCRIPT disconnects A

  • Example code

See attached tcl

Hope you liked my first post

0 Replies 0
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: