예제 #1
0
 public void ChatEnded(object sender, AvChatEventArgs args)
 {
     cboChatType.Invoke(new CboChatEndedDelegate(cboChatEnded));
     btnDial.Invoke(new BtnChatEndedDelegate(btnChatEnded));
     //if (args.ChatType == AvChatTypeE.Video)
     //{
     //    lock (typeof(WebCam))
     //    {
     //        if (WebCam.IsLoaded)
     //        {
     //            WebCam.Instance.Dispose();
     //            WebCam.IsLoaded = false;
     //        }
     //    }
     //}
     if (OnHangup != null)
     {
         OnHangup.Invoke(this, new EventArgs());
     }
 }
예제 #2
0
        private void HangupData(string data, string host, int port)
        {
            _logger.LogDebug("Start GoIp Hangup event");

            GoIpHangupPacket packet = new GoIpHangupPacket(data);

            // if auth error
            if (packet.authid != _options.AuthId || packet.password != _options.AuthPassword)
            {
                // TODO: log?
                _logger.LogInformation("GoIp Hangup event authentication error. Data: {0}", data);
                Send(ACKPacketFactory.ACK("HANGUP", packet.receiveid.ToString(), "Hangup event authentication error!"), host, port);
                OnHangup?.Invoke(this, new GoIpHangupEventArgs("GoIp Hangup event authentication error!", packet, host, port));
                return;
            }

            packet.password = "";  // Delete password for security reasons

            _logger.LogInformation("Received GoIp Hangup event. ReceiveId: {0} Number: {1} Cause: {2}", packet.receiveid, packet.num, packet.cause);

            Send(ACKPacketFactory.ACK("REMAIN", packet.receiveid.ToString(), ""), host, port);
            OnHangup?.Invoke(this, new GoIpHangupEventArgs("OK", packet, host, port));
        }