本文整理汇总了C#中TwilioResponse.Hangup方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.Hangup方法的具体用法?C# TwilioResponse.Hangup怎么用?C# TwilioResponse.Hangup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwilioResponse
的用法示例。
在下文中一共展示了TwilioResponse.Hangup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_Generate_Single_Hangup
public void Can_Generate_Single_Hangup()
{
var response = new TwilioResponse();
response.Hangup();
Assert.True(IsValidTwiML(response.ToXDocument()));
}
示例2: Example_1
public void Example_1()
{
var response = new TwilioResponse();
response.Hangup();
Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
}
示例3: GetResponseVoicemail
//create a TwiML response to send the call to voicemail; appends the response to an existing response
public static TwilioResponse GetResponseVoicemail(TwilioResponse resp, TwilioRequestVoice request, Entity.Client client, Entity.Call call)
{
if (log.IsDebugEnabled) { log.Debug("GetResponseVoicemail.request." + (request == null ? "null" : request.ToJsonString())); }
//TODO: create valid voicemail box dial plan
resp.Pause(1);
resp.Say("You are being transferred to voicemail, but it's not setup yet. Goodbye.");
resp.Pause(1);
resp.Hangup();
//log the current call state
if (call != null)
{
call.CallResult = "sent to voicemail";
call.Save();
}
return resp;
}
示例4: GetResponseUnknownClient
//create a TwiML response for calls to an unknown client
public static TwilioResponse GetResponseUnknownClient(TwilioRequestVoice request, Entity.Call call)
{
if (log.IsDebugEnabled) { log.Debug("GetResponseUnknownClient.request." + (request == null ? "null" : request.ToJsonString())); }
TwilioResponse resp = new TwilioResponse();
resp.Pause(1);
resp.Say("We're sorry. The person you are trying to reach could not be found.");
resp.Pause(1);
resp.Hangup();
//log the current call state
if (call != null)
{
call.CallResult = "unknown client";
call.Save();
}
return resp;
}
示例5: GetResponseIgnore
//create a TwiML response to ignore the call
public static TwilioResponse GetResponseIgnore(TwilioRequestVoice request, Entity.Client client, Entity.Call call)
{
if (log.IsDebugEnabled) { log.Debug("GetResponseIgnore.request." + (request == null ? "null" : request.ToJsonString())); }
TwilioResponse resp = new TwilioResponse();
//TODO: create an ignored voicemail box to send the call to
resp.Pause(1);
resp.Say("Your call was ignored.");
resp.Pause(1);
resp.Hangup();
//log the current call state
if (call != null)
{
call.CallResult = "call was ignored";
call.Save();
}
return resp;
}