public async Task <ActionResult <bool> > Hangup([FromBody] HangupRequest request) { if (request == null) { return(BadRequest()); } log.Info($"Request to Hangup. SipAddress={request.SipAddress} DeviceEncoder={request.DeviceEncoder}"); string hangUpWithDeviceEncoder = string.IsNullOrEmpty(request.DeviceEncoder) ? "Program" : request.DeviceEncoder; var caller = new SipUri(request.SipAddress).UserAtHost; return(await Execute(caller, async (codecApi, codecInformation) => await codecApi.HangUpAsync(codecInformation.Ip, hangUpWithDeviceEncoder))); }
public void ToDictionary_Works() { var dict = new HangupRequest().ToDictionary(); Assert.Equal("Hangup", Assert.Contains("Command", dict).ToObject()); }