In scriptcs, where async/await is not available, calling .Wait() on a long-running dial plan application such as conference or refer in the connections observable subscription blocks new connections.
Example:
using (var listener = new OutboundListener(8084))
{
var sub = listener.Connections.SubscribeOn(TaskPoolScheduler.Default).Subscribe(
socket => {
socket.Connect().Wait();
var uuid = socket.ChannelData.Headers[HeaderNames.UniqueId];
socket.SubscribeEvents().Wait();
socket.ExecuteApplication(uuid, "answer").Wait();
socket.ExecuteApplication(uuid, "conference", "test+1234").Wait(); //blocks
//socket.ExecuteApplication(uuid, "conference", "test+1234"); //does not block
});
listener.Start();
Console.WriteLine("Press [Enter] to exit.");
Console.ReadLine();
sub.Dispose();
}
In scriptcs, where async/await is not available, calling .Wait() on a long-running dial plan application such as
conference
orrefer
in the connections observable subscription blocks new connections.Example: