示例#1
0
 public async Task OnConnected(ConnectedCall connectedInfo,
                               IChannel channel)
 {
     ConnectedCall = connectedInfo;
     Channel       = channel;
     await ResumeAsync();
     await MyEventsAsync();
     await DivertEventsAsync(true);
     await PreHandleAsync();
     await AnswerAsync();
     await HandleAsync();
 }
        public override async void ChannelActive(IChannelHandlerContext context)
        {
            var channel = context.Channel;

            _logger.Debug(
                "received a new connection from freeswitch {0}. Sending a connect command...",
                channel.RemoteAddress);
            var connectCommand = new ConnectCommand();
            var reply          = await SendCommandAsync(connectCommand, channel);

            if (!reply.IsOk)
            {
                return;
            }
            var connectedCall = new ConnectedCall(new EslEvent(reply.Response, true));
            await _inboundListener.OnConnected(connectedCall, channel);
        }