Error 404 bridge not found when add the user I originate the call for

Hi guys,

thank you for your work, I’m new in this forum, I tried to check if this topic already exists and it seems new.

I’m trying to realize a simple application using Freepbx/Asterisk v.13, with ARI wrapper, AsterNET.
I have an issue managing bridges. For instance, these are the steps:

  1. using Asterisk ARI, I call someone using “Originate” function;
  2. when the user answer, I make a simple bridge;
  3. then, It’s time to add another user to the bridge;
  4. at last I’m going to add the former user (the one I originate the call for) to the bridge,

more or less, 25% of trials end in 404 error: “bridge not found” (according to Asterisk ARI documentation).
This error occurs always when I add the user I originate the call for. Other channels never give errors, operations on bridge work fine, so the bridge is correctly instanced.
So please, help me.

Thank you.

Here two snippet from Originator and Bridge instance:

// ---- Originator snippet ----

Channel agentChannel = await client.Channels.OriginateAsync(
                        channelId: channelIds + "." + agent.Id,
                        endpoint: endpoint,
                        app: Ids.AppName,
                        appArgs: appArgs,
                        callerId: number,
                        variables: variables);
												
						
// ---- Bridge snippet ----
						
var bridge = await sender.Bridges.CreateAsync("mixing");
 
 //problem is here <<<---------
 await sender.Bridges.AddChannelAsync(bridge.Id, e.Channel.Id, "agent");
 await sender.Bridges.AddChannelAsync(bridge.Id, context.CustomerCall.Channel.Id, "user");