// Callback for ApplicationEndpoint's BeginEstablish(). static void EndEndpointEstablish(IAsyncResult ar) { LocalEndpoint currentEndpoint = ar.AsyncState as LocalEndpoint; try { currentEndpoint.EndEstablish(ar); _currentEndpoint = currentEndpoint; // Here, we have the endpoint fully established // So let's get started _currentEndpoint.RegisterForIncomingCall <AudioVideoCall>(IncomingAVCallReceived); _locations.Add(new Location(0, "Airport", ConfigurationManager.AppSettings["AirportRoomMusic"], _currentEndpoint)); _locations.Add(new Location(1, "Bus", ConfigurationManager.AppSettings["BusRoomMusic"], _currentEndpoint)); _locations.Add(new Location(2, "Outdoor", ConfigurationManager.AppSettings["OutdoorRoomMusic"], _currentEndpoint)); } catch (ConnectionFailureException connFailEx) { Console.WriteLine("ConnectionFailure Exception: " + connFailEx.ToString()); } catch (RealTimeException realTimeEx) { Console.WriteLine("RealTimeException : " + realTimeEx.ToString()); } catch (Exception Ex) { Console.WriteLine("Exception : " + Ex.ToString()); } }
// Callback for ApplicationEndpoint's BeginEstablish(). static void EndEndpointEstablish(IAsyncResult ar) { LocalEndpoint currentEndpoint = ar.AsyncState as LocalEndpoint; try { currentEndpoint.EndEstablish(ar); _currentEndpoint = currentEndpoint; // Here, we have the endpoint fully established // So let's get started _currentEndpoint.RegisterForIncomingCall<AudioVideoCall>(IncomingAVCallReceived); _locations.Add(new Location(0, "Airport", ConfigurationManager.AppSettings["AirportRoomMusic"], _currentEndpoint)); _locations.Add(new Location(1, "Bus", ConfigurationManager.AppSettings["BusRoomMusic"], _currentEndpoint)); _locations.Add(new Location(2, "Outdoor", ConfigurationManager.AppSettings["OutdoorRoomMusic"], _currentEndpoint)); } catch (ConnectionFailureException connFailEx) { Console.WriteLine("ConnectionFailure Exception: " + connFailEx.ToString()); } catch (RealTimeException realTimeEx) { Console.WriteLine("RealTimeException : " + realTimeEx.ToString()); } catch (Exception Ex) { Console.WriteLine("Exception : " + Ex.ToString()); } }