Call disconnection must be triggered from inside the callflow, so you would need to query your external source to know if it's the right moment to disconnect the call in some points in the callflow. To query your external source you have many options, like web interaction, web services, database access, socket and external code execution. You may choose the one that fits best in your scenario.