public bool CheckIfAvailable(string ip) { log.Debug("Checking if codec at " + ip + " is reachable"); try { using (var client = new UmacClient(ip, Sdk.Umac.ExternalProtocolIpCommandsPort)) { return(true); } } catch (Exception ex) { return(false); } }
public LineStatus GetLineStatus(string ip, int line) { log.Debug("Getting line status from Umac codec at {0}", ip); try { using (var client = new UmacClient(ip, Sdk.Umac.ExternalProtocolIpCommandsPort)) { var lineStatus = client.GetLineStatus(); return(lineStatus); } } catch (Exception ex) { return(new LineStatus { StatusCode = LineStatusCode.ErrorGettingStatus, DisconnectReason = DisconnectReason.None }); } }
public bool HangUp(string hostAddress, Codec codec) { log.Debug("Hanging up Umac codec at {0}", hostAddress); /* Example dialog: * admin> hangup * admin> not streaming * CALL_STATE disconnected [tx: idle, rx: idle] */ try { using (var client = new UmacClient(hostAddress, Sdk.Umac.ExternalProtocolIpCommandsPort)) { var lineStatus = client.HangUp(); return(lineStatus); } } catch (Exception ex) { log.Warn("", ex); return(false); } }
public bool Call(string hostAddress, Call call) { log.Debug("Call from Umac codec at {0}", hostAddress); if (call.Profile != "Telefon") { // We can't deal with anything but the phone profile for now return(false); } try { using (var client = new UmacClient(hostAddress, Sdk.Umac.ExternalProtocolIpCommandsPort)) { var lineStatus = client.Call(call); return(lineStatus); } } catch (Exception ex) { log.Warn("", ex); return(false); } }