/// <summary>
 /// Constructor, pbx connection must be provided by dependency injection
 /// </summary>        
 public PresenceHub(IPbxConnection connection)
 {
     _connection = connection;
     _connection.OnUserUpdated((e) =>
     {                
         Clients.All.SendAsync("UpdateUser", "updateuserobject");
     });
     _connection.Connect();
 }
Esempio n. 2
0
    public PresenceHub(IPbxConnection connection)
    {
        hubConnection = new HubConnectionBuilder().WithUrl("localhost\mysignalrhub").Build();
        hubConnection.StartAsync().Wait();

        _connection = connection;
        _connection.OnUserUpdated((e) =>
        {
            hubConnection.InvokeAsync("Send", e).Wait();
        });
        _connection.Connect();
    }