Bring another call in with AMI

I have an ongoing call I need to dial another party and attach it to the current call, all with AMI.

For some reason, I am having issues with this. When I try to create a new call and then bringing there is no sound on ether line.

Any suggestions?

Suggestion: Provide enough information that we can see what you have done and have a clue as to what went wrong.

I am thinking there is a proper way to do this AMI, given that this is core feature in telephony and that is why I did not see any reason to post details of how I am trying to do this. But here is info on how I do this,

I have simple dial plan for third party call, which also begin recording.

exten => thirdparty,1,Answer()
exten => thirdparty,n,Monitor(wav,recfile)
exten => thirdparty,n,Dial(SIP/sw-dial/5100553700,R)
exten => thirdparty,n,Hangup()

While I am in a call, I make originate request to above dialplan, then I need to bring them together, there are two options I have ether bridge them or use ChanSpy .

Option one is bridging

  1. I get on a call
  2. Run AMI command to originate thirdparty ext
  3. Run AMI command to Bridge my call and one just created for the thirdparty
  4. I see bridge created, third-party extensions execute as expected and begin recording and call its target I hear no audio in the original channel.

Option two is Chanspy

  1. I get on a call
  2. Run AMI command to originate thirdparty ext. Inside the same AMI request, I invoke Chanspy application linking, third party channel to original channel.
  3. initially I could not get any audio ether, but by accident, I found that if I forced playback into the original channel, while playback was happening I can hear third-party channel audio, in the original channel. But only as long as playback in the original channel keeps playing, as soon as it stops, audio from the third-party channel is gone.
    What I found by watching AMI activity is that as soon as Playback on the original channel ends, there is ChanSpy Stop event for some unknown reason.

My goal is very simple - call another extension and bring it into the current call so all parties could speak.

You can’t originate to an extension. Do you mean you originate to a local channel on that extension?

Originate needs to have both a channel and either an application or an extension. You’ve only mentioned an extension, which I have to guess really means a local channel. It is not clear which channel you are trying to bridge, but note that a local channel may well optimise out when the call answers.

Your goal requires a conference bridge.

As an aside, Answer and Hangup are redundant in most dialplans.