TAPI 3.0 events non raising
I'm a noob to C#, so please sorry me for bad coding.
I'm trying to make this application that while a call is happening, it gets the phone number of the caller and it will use it to take information from a CRM, and after that, it creates a Balloon from NotifyIcon that shows the information about the caller.
The CRM connection and the search-by telephone number is working fine, same for the NotifyIcon, but all the TAPI part is not working. No events are raised when I try with my telephone to call my office Zoiper5 number.
Here is the class where TAPI:
using System;
using System.Windows.Forms;
using TAPI3Lib;
namespace CallHelper
{
class TapiApplication : ApplicationContext
{
private static NLog.Logger logger =
NLog.LogManager.GetCurrentClassLogger();
private TAPIClass tapi;
private string number;
private Notification notification;
private ITAddress address;
public TapiApplication()
{
try
{
tapi = new TAPIClass();
tapi.Initialize();
//Notification.cs : handle the NotifyIcon
notification = new Notification();
tapi.ITTAPIEventNotification_Event_Event += new
ITTAPIEventNotification_EventEventHandler(callNotificationHandler);
tapi.EventFilter = (int) (TAPI_EVENT.TE_CALLNOTIFICATION);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
private void callNotificationHandler(TAPI_EVENT TapiEvent, object
pEvent)
{
try
{
ITCallNotificationEvent cne = pEvent as ITCallNotificationEvent;
number = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);
//creates the balloon containing the information of the caller
notification.showBalloon(number);
}
catch (Exception ex)
{
logger.Error(ex.Message);
tapi.Shutdown();
}
}
}
}
I really don't know where to search anymore; I've read many articles here on SOF, and other site talking about almost the same thing, but still, I haven't resolved.
Thanks for any help.
c# events event-handling notifyicon tapi
add a comment |
I'm a noob to C#, so please sorry me for bad coding.
I'm trying to make this application that while a call is happening, it gets the phone number of the caller and it will use it to take information from a CRM, and after that, it creates a Balloon from NotifyIcon that shows the information about the caller.
The CRM connection and the search-by telephone number is working fine, same for the NotifyIcon, but all the TAPI part is not working. No events are raised when I try with my telephone to call my office Zoiper5 number.
Here is the class where TAPI:
using System;
using System.Windows.Forms;
using TAPI3Lib;
namespace CallHelper
{
class TapiApplication : ApplicationContext
{
private static NLog.Logger logger =
NLog.LogManager.GetCurrentClassLogger();
private TAPIClass tapi;
private string number;
private Notification notification;
private ITAddress address;
public TapiApplication()
{
try
{
tapi = new TAPIClass();
tapi.Initialize();
//Notification.cs : handle the NotifyIcon
notification = new Notification();
tapi.ITTAPIEventNotification_Event_Event += new
ITTAPIEventNotification_EventEventHandler(callNotificationHandler);
tapi.EventFilter = (int) (TAPI_EVENT.TE_CALLNOTIFICATION);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
private void callNotificationHandler(TAPI_EVENT TapiEvent, object
pEvent)
{
try
{
ITCallNotificationEvent cne = pEvent as ITCallNotificationEvent;
number = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);
//creates the balloon containing the information of the caller
notification.showBalloon(number);
}
catch (Exception ex)
{
logger.Error(ex.Message);
tapi.Shutdown();
}
}
}
}
I really don't know where to search anymore; I've read many articles here on SOF, and other site talking about almost the same thing, but still, I haven't resolved.
Thanks for any help.
c# events event-handling notifyicon tapi
add a comment |
I'm a noob to C#, so please sorry me for bad coding.
I'm trying to make this application that while a call is happening, it gets the phone number of the caller and it will use it to take information from a CRM, and after that, it creates a Balloon from NotifyIcon that shows the information about the caller.
The CRM connection and the search-by telephone number is working fine, same for the NotifyIcon, but all the TAPI part is not working. No events are raised when I try with my telephone to call my office Zoiper5 number.
Here is the class where TAPI:
using System;
using System.Windows.Forms;
using TAPI3Lib;
namespace CallHelper
{
class TapiApplication : ApplicationContext
{
private static NLog.Logger logger =
NLog.LogManager.GetCurrentClassLogger();
private TAPIClass tapi;
private string number;
private Notification notification;
private ITAddress address;
public TapiApplication()
{
try
{
tapi = new TAPIClass();
tapi.Initialize();
//Notification.cs : handle the NotifyIcon
notification = new Notification();
tapi.ITTAPIEventNotification_Event_Event += new
ITTAPIEventNotification_EventEventHandler(callNotificationHandler);
tapi.EventFilter = (int) (TAPI_EVENT.TE_CALLNOTIFICATION);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
private void callNotificationHandler(TAPI_EVENT TapiEvent, object
pEvent)
{
try
{
ITCallNotificationEvent cne = pEvent as ITCallNotificationEvent;
number = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);
//creates the balloon containing the information of the caller
notification.showBalloon(number);
}
catch (Exception ex)
{
logger.Error(ex.Message);
tapi.Shutdown();
}
}
}
}
I really don't know where to search anymore; I've read many articles here on SOF, and other site talking about almost the same thing, but still, I haven't resolved.
Thanks for any help.
c# events event-handling notifyicon tapi
I'm a noob to C#, so please sorry me for bad coding.
I'm trying to make this application that while a call is happening, it gets the phone number of the caller and it will use it to take information from a CRM, and after that, it creates a Balloon from NotifyIcon that shows the information about the caller.
The CRM connection and the search-by telephone number is working fine, same for the NotifyIcon, but all the TAPI part is not working. No events are raised when I try with my telephone to call my office Zoiper5 number.
Here is the class where TAPI:
using System;
using System.Windows.Forms;
using TAPI3Lib;
namespace CallHelper
{
class TapiApplication : ApplicationContext
{
private static NLog.Logger logger =
NLog.LogManager.GetCurrentClassLogger();
private TAPIClass tapi;
private string number;
private Notification notification;
private ITAddress address;
public TapiApplication()
{
try
{
tapi = new TAPIClass();
tapi.Initialize();
//Notification.cs : handle the NotifyIcon
notification = new Notification();
tapi.ITTAPIEventNotification_Event_Event += new
ITTAPIEventNotification_EventEventHandler(callNotificationHandler);
tapi.EventFilter = (int) (TAPI_EVENT.TE_CALLNOTIFICATION);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
private void callNotificationHandler(TAPI_EVENT TapiEvent, object
pEvent)
{
try
{
ITCallNotificationEvent cne = pEvent as ITCallNotificationEvent;
number = cne.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLEDIDNUMBER);
//creates the balloon containing the information of the caller
notification.showBalloon(number);
}
catch (Exception ex)
{
logger.Error(ex.Message);
tapi.Shutdown();
}
}
}
}
I really don't know where to search anymore; I've read many articles here on SOF, and other site talking about almost the same thing, but still, I haven't resolved.
Thanks for any help.
c# events event-handling notifyicon tapi
c# events event-handling notifyicon tapi
edited Nov 14 '18 at 12:57
Masoud Zarjani
4051312
4051312
asked Nov 14 '18 at 12:24
E. PeracchiaE. Peracchia
427
427
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Problem solved. I was missing part of the initialization. On incoming calls event, you must have initialized the lines on wich you want to receive the notification, as written here ITTAPI::RegisterCallNotifications method
You do that using
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
You can either select one single ITAddress, or cicle all Address in your tapi.Address as ITCollection and do RegisterCallNotifications for each one of them. In first case you will receive the notification only if the incoming call is directed in the address line you specified, in the second case you will receive notification any time there is a call in any of the address.
This sample project helped me a lot:
TAPI 3.0 Application development using C#.NET
add a comment |
I'm not sure if you're registering for the event you want. I would suggest using the Julmar Tapi 3.0 .Net wrapper found here: https://github.com/markjulmar/itapi3. When you initialize Tapi using this wrapper it registers for all events and also finds all devices available.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300185%2ftapi-3-0-events-non-raising%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Problem solved. I was missing part of the initialization. On incoming calls event, you must have initialized the lines on wich you want to receive the notification, as written here ITTAPI::RegisterCallNotifications method
You do that using
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
You can either select one single ITAddress, or cicle all Address in your tapi.Address as ITCollection and do RegisterCallNotifications for each one of them. In first case you will receive the notification only if the incoming call is directed in the address line you specified, in the second case you will receive notification any time there is a call in any of the address.
This sample project helped me a lot:
TAPI 3.0 Application development using C#.NET
add a comment |
Problem solved. I was missing part of the initialization. On incoming calls event, you must have initialized the lines on wich you want to receive the notification, as written here ITTAPI::RegisterCallNotifications method
You do that using
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
You can either select one single ITAddress, or cicle all Address in your tapi.Address as ITCollection and do RegisterCallNotifications for each one of them. In first case you will receive the notification only if the incoming call is directed in the address line you specified, in the second case you will receive notification any time there is a call in any of the address.
This sample project helped me a lot:
TAPI 3.0 Application development using C#.NET
add a comment |
Problem solved. I was missing part of the initialization. On incoming calls event, you must have initialized the lines on wich you want to receive the notification, as written here ITTAPI::RegisterCallNotifications method
You do that using
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
You can either select one single ITAddress, or cicle all Address in your tapi.Address as ITCollection and do RegisterCallNotifications for each one of them. In first case you will receive the notification only if the incoming call is directed in the address line you specified, in the second case you will receive notification any time there is a call in any of the address.
This sample project helped me a lot:
TAPI 3.0 Application development using C#.NET
Problem solved. I was missing part of the initialization. On incoming calls event, you must have initialized the lines on wich you want to receive the notification, as written here ITTAPI::RegisterCallNotifications method
You do that using
tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
You can either select one single ITAddress, or cicle all Address in your tapi.Address as ITCollection and do RegisterCallNotifications for each one of them. In first case you will receive the notification only if the incoming call is directed in the address line you specified, in the second case you will receive notification any time there is a call in any of the address.
This sample project helped me a lot:
TAPI 3.0 Application development using C#.NET
answered Nov 16 '18 at 11:05
E. PeracchiaE. Peracchia
427
427
add a comment |
add a comment |
I'm not sure if you're registering for the event you want. I would suggest using the Julmar Tapi 3.0 .Net wrapper found here: https://github.com/markjulmar/itapi3. When you initialize Tapi using this wrapper it registers for all events and also finds all devices available.
add a comment |
I'm not sure if you're registering for the event you want. I would suggest using the Julmar Tapi 3.0 .Net wrapper found here: https://github.com/markjulmar/itapi3. When you initialize Tapi using this wrapper it registers for all events and also finds all devices available.
add a comment |
I'm not sure if you're registering for the event you want. I would suggest using the Julmar Tapi 3.0 .Net wrapper found here: https://github.com/markjulmar/itapi3. When you initialize Tapi using this wrapper it registers for all events and also finds all devices available.
I'm not sure if you're registering for the event you want. I would suggest using the Julmar Tapi 3.0 .Net wrapper found here: https://github.com/markjulmar/itapi3. When you initialize Tapi using this wrapper it registers for all events and also finds all devices available.
answered Nov 15 '18 at 22:27
TomTom
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53300185%2ftapi-3-0-events-non-raising%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown