예제 #1
0
 public async Task OnConnected(InboundCall connectedInfo,
                               IChannel channel)
 {
     InboundCall = connectedInfo;
     Channel     = channel;
     await ResumeAsync();
     await MyEventsAsync();
     await DivertEventsAsync(true);
     await PreHandleAsync();
     await AnswerAsync();
     await HandleAsync();
 }
예제 #2
0
        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 InboundCall(new EslEvent(reply.Response,
                                                             true));
            await _inboundListener.OnConnected(connectedCall,
                                               channel);
        }