ContactCenter on Asterisk

On the basis of Asterisk we render a service our clients (Contact Center).
The brief description of service: We give a client telephone number
from which redirection it is established on its real landline and cellphone numbers.
These number are incorporated in groups (1,2,3).
Service is constructed on the basis of a traditional digital telephony

Example (how does service work):

  1. Incoming call has come to number of ContactCenter.
  2. The voice greeting (IVR) plays and propose subscriber to choose any
    from conditions:
  • press 1 for connection with a department of sales
    (group 1)
  • press 2 for connection with a department of technical supports (group 2).
  1. After the subscriber has chosen any from conditions, for example the first,
    the station begins to make calls to numbers of this group (to all the
    numbers which the given group includes) until then there will be no yet a connection with
    a free phone number (successful connection).

1.How to define on what number from the group the call (successful connection)
has come to the end.
2.How to define time of a call (successful connection).