Open mguerrieri opened 7 years ago
This is what I use:
if (!channel.IsBridged)
{
ColorConsole.WriteLine("Bridge Failed - {0}"
.Fmt(channel.GetVariable("last_bridge_hangup_cause")).Red());
await channel.Play("ivr/ivr-call_rejected.wav");
await channel.Hangup(HangupCause.NormalTemporaryFailure);
}
The idea that by keeping all the state accessible via the channel
object your code will be more succinct.
I'm considering there may be a case for strongly typed access to the most commonly-used channel vars eg channel.Variables.BridgeHangupCause
ColorConsole.WriteLine("Bridge Failed - {0}".Fmt(channel.Variables.BridgeHangupCause).Red());
^ that's a bit better.
I've been going around around on this trying to make this API usable as you can see here: https://github.com/danbarua/NEventSocket/issues/18
Is there a reason that the BridgeTo method swallows the result of the bridge instead of returning it? This makes getting the results of the bridge attempt challenging.