Hi there,
We run a standard medical center and I we're planning to improve our Voip based telephone system in order to build a more effective way of communication between nurses and patients.
We have a
Cisco Unified CM PBX and we'd like to add some new features into that. The most important one is the 'virtual receptionist'. Its main objective would be the automated receiving of incoming calls. So it would play in different greetings for different time of the day allowing that calls get routed appropriately during the lunch hour, and it would manage call groups to route calls to the correct department properly.
To tell the truth I am not too experienced in VoIP development... I presume we will need a Voip toolset.
Now I'm there that I have found a Voip toolset (
Ozeki Voip SDK) that is compatible with our Cisco Unified CM. I use C#.
By using the code example below I'm working on the implementation of an auto answer system. But I have no idea how to implement the ring group feature. I'm sure I was inattentive, but I kindly ask you please send me a short code snippet that helps me to get started with this ring group project!
namespace Auto_Answer
{
class Program
{
static ISoftPhone mySoftphone;
static IPhoneLine phoneLine;
static IPhoneCall call;
private static void Main(string[] args)
{
mySoftphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000, 5060);
var registrationRequired = true;
var userName = "sipusername";
var displayName = "sipdisplayname";
var authenticationId = "authenticationid";
var registerPassword = "password";
var domainHost = "pbxip.voipprovider.com";
var domainPort = 5060;
mySoftphone_Register(mySoftphone, registrationRequired, displayName, userName, authenticationId, registerPassword,
domainHost, domainPort);
while (true) Thread.Sleep(10);
}
static void mySoftphone_Register(ISoftPhone softphone, bool registrationRequired, string displayName, string userName,
string authenticationId, string registerPassword, string domainHost, int domainPort)
{
try
{
var account = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort);
var natConfiguration = new NatConfiguration(NatTraversalMethod.None);
phoneLine = softphone.CreatePhoneLine(account, natConfiguration);
softphone.IncomingCall += softphone_IncomingCall;
phoneLine.PhoneLineStateChanged += mySoftphone_PhoneLineStateChanged;
softphone.RegisterPhoneLine(phoneLine);
}
catch (Exception ex)
{
Console.WriteLine("Error during SIP registration: " + ex.ToString());
}
}
static void softphone_IncomingCall(object sender, VoIPEventArgs<IPhoneCall> e)
{
call = e.Item;
call.CallStateChanged += call_CallStateChanged;
call.CallErrorOccured += call_CallErrorOccured;
call.Accept();
}
private static void Auto_Answer_Method()
{
Console.WriteLine("Auto Answer does its job.");
}
static void mySoftphone_PhoneLineStateChanged(object sender, VoIPEventArgs<PhoneLineState> e)
{
if (e.Item == PhoneLineState.RegistrationTimedOut || e.Item == PhoneLineState.RegistrationFailed)
Console.WriteLine("Registration failed!");
if (e.Item == PhoneLineState.RegistrationSucceeded || e.Item == PhoneLineState.NoRegNeeded)
Console.WriteLine("Registration succeeded - Online!");
}
static void call_CallStateChanged(object sender, VoIPEventArgs<CallState> e)
{
Console.WriteLine("Call state: {0}.", e.Item);
if (e.Item == CallState.Answered)
Auto_Answer_Method();
}
static void call_CallErrorOccured(object sender, VoIPEventArgs<CallError> e)
{
Console.WriteLine("Error occured during the call: {0}.", e.Item);
}
}
}
(Soruce:
http://voip-sip-sdk.com/p_354-how-to-implement-auto-answer-using-csharp-voip.html)
I’m looking forward to your solutions here or even in e-mail (cliff.bradshaw@hotmail.com)! Many thanks in advance!
Regards,
Cliff