How to implement conversation AI agent in Asterisk

Thanks for all of your many quick replies.

Yes, I’ve already seen several topics. Here is what I have known about it from this topic - How to get real time audio streams of both Calling party and called party independently - #5 by shamnusln.

  1. Get the bridgeId of the current active call
  2. Take each channels in that bridge
  3. For each channel, create a snoopChannel.
  4. Then, create an externalMedia channel, corresponds to each snoopChannel.
  5. Finally create a new bridge and add these externalMedia channels to this bridge.

Regarding the step 1, should I get the bridge id from bridge list using setInterval and then go to the next step from there?