예제 #1
0
        internal static async Task <Channel> Create(OutboundSocket outboundSocket)
        {
            var channel = new Channel(outboundSocket);

            channel.ExitOnHangup = true;

            await outboundSocket.Linger().ConfigureAwait(false);


            await outboundSocket.SubscribeEvents(
                EventName.ChannelProgress,
                EventName.ChannelBridge,
                EventName.ChannelUnbridge,
                EventName.ChannelAnswer,
                EventName.ChannelHangup,
                EventName.ChannelHangupComplete,
                EventName.Dtmf).ConfigureAwait(false);                                                                           //subscribe to minimum events

            await outboundSocket.Filter(HeaderNames.UniqueId, outboundSocket.ChannelData.UUID).ConfigureAwait(false);            //filter for our unique id (in case using full socket mode)

            await outboundSocket.Filter(HeaderNames.OtherLegUniqueId, outboundSocket.ChannelData.UUID).ConfigureAwait(false);    //filter for channels bridging to our unique id

            await outboundSocket.Filter(HeaderNames.ChannelCallUniqueId, outboundSocket.ChannelData.UUID).ConfigureAwait(false); //filter for channels bridging to our unique id

            channel.InitializeSubscriptions();
            return(channel);
        }
예제 #2
0
 public Channel(OutboundSocket outboundSocket) : this(outboundSocket.ChannelData, outboundSocket)
 {
     outboundSocket.Linger().Wait();
 }
예제 #3
0
 public Channel(OutboundSocket outboundSocket) : this(outboundSocket.ChannelData, outboundSocket)
 {
     outboundSocket.Linger().Wait();
 }