Пример #1
0
        protected Channel(EventMessage eventMessage, EventSocket eventSocket) : base(eventMessage, eventSocket)
        {
            //populate empty bridge status
            Bridge       = new BridgeStatus(false, null);
            ExitOnHangup = true;

            Task.WhenAll(
                new[]
            {
                eventSocket.SubscribeEvents(),                         //subscribe to minimum events
                eventSocket.Filter(HeaderNames.UniqueId, UUID),        //filter for our unique id (in case using full socket mode)
                eventSocket.Filter(HeaderNames.OtherLegUniqueId, UUID) //filter for channels bridging to our unique id
            }).ContinueWith(
                t =>
            {
                if (t.IsFaulted && t.Exception != null)
                {
                    Log.ErrorException("Channel [{0}] - failed to configure outbound socket for Channel usage".Fmt(UUID), t.Exception.InnerException);
                    return;
                }

                this.InitializeSubscriptions();
            });
        }
Пример #2
0
 public static Task <CommandReply> Filter(this EventSocket eventSocket, string eventName)
 {
     return(eventSocket.Filter("Event-Name", eventName));
 }
Пример #3
0
 public static Task <CommandReply> Filter(this EventSocket eventSocket, EventName eventName)
 {
     return(eventSocket.Filter(eventName.ToString().ToUpperWithUnderscores()));
 }