Example Usage:
using Mocean.Voice;
using Mocean.Voice.Mapper;
var mcBuilder = (new McBuilder())
.add(Mc.say("for english please press 1"))
.add(Mc.collect("https://test.com/collect"))
.add(Mc.sleep(2000))
.add(Mc.bridge("60123456789"))
.add(Mc.play("http://test.com/play"));
mocean.Voice.Call(new VoiceRequest
{
mocean_to = "60123456789",
mocean_command = mcBuilder
});
Hangup Example:
mocean.Voice.Hangup("xxx-xxx-xxx-xxx"); //call-uuid
Recording Example:
var recording = mocean.Voice.Recording("xxx-xxx-xxx-xxx"); //call-uuid
//save to file
using (FileStream fs = new FileStream(recording.Filename, FileMode.OpenOrCreate))
{
using (BinaryWriter writer = new BinaryWriter(fs))
{
writer.Write(recording.RecordingBuffer);
}
}