J'utilise l'emballage TAPI 2.0 de JulMar (https://atapi.codeplex.com/) et j'ai des problèmes avec cela.Atapi CallInfoChangeEvent non déclenché
L'initialisation
void initTAPI()
{
myTAPI = new TapiManager("GetCaller");
if (!myTAPI.Initialize())
{
MessageBox.Show("FAILED!");
}else
{
name = myTAPI.Lines[0].Name;
lineName = (myTAPI != null && myTAPI.Lines.Length > 0 ? name : string.Empty);
foreach(TapiLine line in myTAPI.Lines)
{
line.NewCall += this.OnNewCall;
line.Ringing += this.OnRinging;
line.CallStateChanged += this.OnCallState;
line.CallInfoChanged += this.OnCallInfo;
}
MessageBox.Show(lineName);
}
}
Alors je reçois le lineName
. Quand je compose maintenant un numéro à travers le programme, il tire
OnCallState
private void OnCallState(object sender, CallStateEventArgs e)
{
if (InvokeRequired == true)
{
this.BeginInvoke(new EventHandler<CallStateEventArgs>(this.OnCallState), new object[] { sender, e });
return;
}
label1.Text = "Outgoing Call...";
}
Mais ce que je veux vraiment faire est d'obtenir le numéro d'un appel entrant, mais ne se tira pas.
OnCallInfo
private void OnCallInfo(object sender, CallInfoChangeEventArgs e)
{
if (InvokeRequired == true)
{
this.BeginInvoke(new EventHandler<CallInfoChangeEventArgs>(this.OnCallInfo), new object[] { sender, e });
return;
}
label1.Text = "Incoming Call...";
}
Il dit somehwere, que cela fonctionne uniquement avec x86, donc je changé la cible, mais toujours sans succès. PS: J'ai un gestionnaire d'appels (ProCall) installé sur la même machine, qui me dit quand quelqu'un appelle, donc je devrais être capable d'obtenir l'information en C# aussi bien?
Voici le code entier si quelqu'un est intéressé: http://pastebin.com/Q5W5iGun
Pourriez-vous de line.Monitor() le partage de la façon dont un 'lineGetCallInfo' ressemblerait? Je suis assez nouveau pour les auditeurs en C#. Merci! – PrimuS