How does Click2Call work with Line Extension Events

The majority of line extension state change events are generated from B Legs as a result of an inbound call.  The scenario below shows the difference between most calls (on the left) and Click2Call (on the right). Notice how the A legs and B legs are reversed as the Mango system first needs to verify that the extension is online and ready to initiate the B leg of the call. 

The Click2Call scenario presents an interesting problem where we do not want to send all of the events for ringing, answered, cancelled from the A Leg because it doesn't represent the connection to the customer has been established. Instead we have opted for the solution below. 



3rdParty->>+Mango: Start click2call (C2C) to 393-222-3333
Mango->>+Extension: Setup the call to A Leg
Extension->>Extension: Ringing
Extension->>Mango: Send Ringing
Mango->>3rdParty: A Leg Ringing Event
Extension->>+Mango: Dialing Extension picks up the Call
Mango->>3rdParty: A Leg Answered Event
Mango->>+393-222-3333: Initiate outbound call B Leg Ringing
Mango->>3rdParty: B Leg Ringing Event
393-222-3333->>Mango: Answers the call
Mango->>3rdParty: B Leg Answered Event
Mango->>393-222-3333: Audio Exchange
Mango->>Extension: Audio Exchange
Extension->>Mango: Hangup Issued
Mango->>3rdParty: A Leg Hangup
393-222-3333->>Mango: Hangup
Mango->>3rdParty: B Leg Hangup