I need some help on how to do an attended transfer using the event socket library protocol.

Original call:
Channel A                      <-------------> Channel B
(transferring endpoint)                       (other endpoint of original call)

Channel C                      <-------------> Channel D
(transferring endpoint)                       (endpoint to transfer to)

How do I go about disconnecting Channels A and Channel C, and bridging Channel B with Channel D? In the scenario that I have described, I do know the UUIDs for all four of the channels involved.

I also need some help on how to conference in a third party into an existing phone call using the event socket library. In this scenario, the call is already connected and I know the UUID of both of the channels of the call. How do I go about conferencing in a third party using the event socket library protocol?