|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
using VoIP;
//using VoIP;
namespace FunnyPhone
{
class PongCallListener : IPhoneCallListener
{
public void DtmfReceived(object sender, VoIPEventArgs<DTMF> e)
{
var dtmf = e.Item;
var call = (PhoneCall)sender;
Console.WriteLine("Dtmf received");
call.SendDTMFSignal(VoIPMediaType.Audio, e.Item);
}
public void CallErrorOccured(object sender, VoIPEventArgs<CallError> e)
{
var call = (PhoneCall)sender;
Console.WriteLine("Call error occured: " + e.Item);
}
public void MediaDataReceived(object sender, VoIPEventArgs<VoIPMediaData> e)
{
var call = (PhoneCall)sender;
call.SendMediaData(e.Item.MediaType, e.Item.PCMData);
}
public void CallStateChanged(object sender, VoIPEventArgs<CallState> e)
{
var call = (PhoneCall)sender;
Console.WriteLine("Call state changed: " + e.Item);
if (e.Item > CallState.InCall)
call.DetachListener(this);
}
public void PlainMediaDataReceived(object sender, VoIPEventArgs<EncodedMediaData> e)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.