NEventSocket
NEventSocket copied to clipboard
Schedule Hangup
Hi Dan, I added this to your code for scheduled hangup and I thought maybe you'd like to add something similar to your version as I find it handy:
--in apiextension.cs
public static Task<ApiResponse> ScheduleHangup(
this EventSocket eventSocket,
string uuid,
string value,
HangupCause hangupCause = HangupCause.NormalClearing)
{
return eventSocket.SendApi("sched_hangup +{0} {1} {2}".Fmt(
value, uuid, hangupCause.ToString().ToUpperWithUnderscores()));
}
--in basicchannel.cs
public Task ScheduleHangup(HangupCause hangupCause = FreeSwitch.HangupCause.NormalClearing)
{
return
RunIfAnswered(
() =>
eventSocket.SendApi("sched_hangup +10 {0} {1}".Fmt(UUID, hangupCause.ToString().ToUpperWithUnderscores())),
true);
}
Todo: include this in v2