Finding the ringing/answered extension after xfr a call

Discussion in 'Call Flow Designer' started by cognos1, Jan 13, 2018.

Thread Status:
Not open for further replies.
  1. cognos1

    Joined:
    Dec 18, 2015
    Messages:
    5
    Likes Received:
    0
    I'm trying to understand the Object Model with respect to how it models an incoming call and the chain of hops that it goes through to reach its final destination. Extensions may have forwarding rules in place so the call may hop a few times. Moreover, in the case where the call is passed to a Ring Group then the RG will decide the destination at that time. I want to use the CFD to change the status of the final destination extension to DND as soon as it starts to ring or is answered.

    One approach seems to be to use the session.callid variable (provided by CFD) and pass that to a 'LaunchExternalScript' component as a parameter value. If session.callid is the same as ActiveConnection.CallID then I could use that as a key to find the set of ActiveConnection objects that relate to the call.

    It looks like I can identify the object that relates to the final destination by using the
    ActiveConnection.Status flag (value 2 indicates ringing and value 3 indicates connection 'established'). However the explanations in the Object Model Help for the ConnectionStatus Enumeration are confusing me. They mention 'other participant' and 'owner object' but what are these? Do they relate back to ActiveConnection.DN somehow? It looks like ActiveConnection.DN is only part of the story and ActiveConnection.InternalParty is another.

    It would be useful to have 2 worked examples showing what objects the OM holds in the these cases:-
    a) where an incoming call is taken by the CFD which transfers it to a Ring Group with 2 Extensions, the first Extension being unavailable so that the RG sends the call to the second one;
    b) where an incoming call is taken by the CFD which transfers it to Extension 'A' but Extension 'A' has a forwarding rule in place to send the call to Extension 'B';

    My guess for (a) is:-
    Stage 1: CFD picks up call, so:-
    CFD.Session.CallID = X

    Stage 2: CFD transfers call to RG with virtual Extension no. 233:-
    ActiveConnections are:-
    ActiveConnection-A:

    - CallID = X
    - DN = DN of CFD ?
    - InternalParty = DN of RG
    - Status = Dialling
    ActiveConnection-B:
    - CallID = X
    - DN = DN of RG ?
    - InternalParty = DN of First Extension
    - Status = Dialling

    Stage 3: RG gives up trying First Extension and tries Second Extension:-
    ActiveConnection-B: object is destroyed
    ActiveConnection-C:

    - CallID = X
    - DN = DN of RG
    - InternalParty = DN of Second Extension
    - Status = Dialling

    Stage 4: RG has success on Second Extension:-
    ActiveConnection-C:

    - CallID = X
    - DN = DN of RG
    - InternalParty = DN of Second Extension
    - Status = Dialling
    ActiveConnection-D:
    - CallID = X
    - DN = DN of Second Extension
    - InternalParty = DN of RG
    - Status = Ringing

    Stage 5:Call is answered on Second Extension:-
    ActiveConnection-C: object is destroyed

    ActiveConnection-D:

    - CallID = X
    - DN = DN of Second Extension
    - InternalParty = DN of RG
    - Status = Connected

    Stage 6: Caller or Second Extension hangs up:-
    ActiveConnection-A: object is destroyed

    ActiveConnection-D: object is destroyed

    When is the value for
    ActiveConnection.OriginatedBy set?

    Just trying to work out how the OM works. Many thanks for your help.
    Regards,
    Stephen.





     
    #1 cognos1, Jan 13, 2018
    Last edited: Jan 13, 2018
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,372
    Likes Received:
    110
    Hi Stephen,

    Unfortunately we can't help you out with all these questions. As you can see in the 3CX Call Control API documentation page, we can't provide support for it. You will need to make tests, check the values from the different properties and find out what they have.

    However, I can give you an overview to shed some light on this, but you will need to go deeper by yourself... An ActiveConnection represents a call in 3CX. It might be an active call, or a reference to a finished call (when you receive a notification that the call has ended). The properties of the ActiveConnection show the state of that call at a specific point in time. When the call starts moving to different extensions, these properties change and there is no track of the history of the call in the ActiveConnection object. Some properties like DN, InternalParty, etc. might point to the same object, for example to the same extension. Also, please note that as soon as you transfer the call from the CFD app, the CFD app extension will not be part of the ActiveConnection anymore, the call is disconnected from it and continues being processed and sent to a new destination.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cognos1

    Joined:
    Dec 18, 2015
    Messages:
    5
    Likes Received:
    0
    Thank you, Ernesto. That's a start to understanding ActiveConnection.
    Regards,
    Stephen.
     
  4. cognos1

    Joined:
    Dec 18, 2015
    Messages:
    5
    Likes Received:
    0
    One more thing, Ernesto. Is there anyone who does offer support for the API?
    Thanks in advance.
     
  5. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,372
    Likes Received:
    110
    Hello Stephen,

    Not that I know, sorry.

    Kind regards.
    Ernesto.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.