Example #1
0
        ///// <summary>
        ///// 获得所在组播的信息
        ///// </summary>
        ///// <returns></returns>
        //public Multicast GetMulticast()
        //{
        //    return this.Channel.Context.Client.GetMulticast(this.Channel.HostAddress);
        //}

        internal static void Process(AnycastClient client, ClientEvents.MessageReceivedEventArgs ea)
        {
            var data = RtpDataAnalyzer.Deserialize(ea.Message.Origin, ea.Message.Body);

            if (TryProcessCall(ea.Message, data))
            {
                return;
            }

            var header    = ea.Message.Header;
            var origin    = ea.Message.Origin;
            var eventName = header.GetValue <string>(FieldRtpEventName);

            RaiseLocalEvent(client, origin, eventName, data);
        }
Example #2
0
        public RtpCapabilityCallProxy(Message msg)
        {
            this.Name      = msg.Header.GetValue <string>(RtpCapability.FieldRtpCapabilityName, string.Empty);
            this.EventName = msg.Header.GetValue <string>(RtpCapability.FieldRtpEventName, string.Empty);
            if (!string.IsNullOrEmpty(this.Name))
            {
                this.Data = RtpDataAnalyzer.Deserialize(msg.Origin, msg.Body);

                var destination = msg.Header.GetValue <string>(MessageField.Destination, string.Empty);
                if (!string.IsNullOrEmpty(destination))
                {
                    this.Destination = destination;
                }

                var destinations = msg.Header.GetList(MessageField.Destinations, false)?.ToArray <string>();
                if (destinations != null)
                {
                    this.Destinations = destinations;
                }

                this.RequestId = msg.Header.GetValue <Guid>(RtpCapability.FieldRtpCallRequestId, Guid.Empty);
            }
        }
Example #3
0
 public static RtpData GetData(string origin, byte[] data)
 {
     return(RtpDataAnalyzer.Deserialize(origin, data));
 }