We help IT Professionals succeed at work.
Get Started

C# and TAPI(3.1)

JeePeeTee
JeePeeTee asked
on
5,512 Views
Last Modified: 2012-05-09
Hello experts,

Im trying to get C# to work with TAPI to generate a db search query and popups on certain events.
Ive installed the ActiveTSP to communicate with the Asterisks VoIP server, thats the TSP i want to use.

Lucky for me, i cant even get C# to enumerate TSP's.. Ive tried the tutorial on codeprojects (http://www.codeproject.com/KB/IP/devangpro.aspx) and some similair script on the same site.
---------------------------------------------------------------------------------------------
Error:
Cannot convert method group 'EnumerateAddresses' to non-delegate type 'TAPI3Lib.IEnumAddress[]'. Did you intend to invoke the method?

Script:
TAPIClass controller = new TAPIClass();
controller.Initialize();
IEnumAddress[] lines = controller.EnumerateAddresses;
foreach (IEnumAddress line in lines)
{
    outputBox.Text += line.Name;
}

---------------------------------------------------------------------------------------------

I also used the C# Wrapper located at http://www.julmar.com/blog/mark/2008/07/23/ATAPIAssemblyUpdated.aspx but it generated an error.
---------------------------------------------------------------------------------------------
error:
System.ArgumentOutOfRangeException was unhandled - Message="Index and count must refer to a location within the buffer.\r\nParameter name: bytes"

Script:
er controller = new TapiManager("CallerMAX");
try
{
    if (controller.Initialize() && controller.Lines.Length > 0)
    {
        outputBox.Text = ("I found the following TSP's:...\r\n");
        TapiLine[] lines = controller.Lines;
        for (int i = 0; i < 8; i++)
        {
            outputBox.Text += i + ". " + lines[i].Name + "\r\n";
        }
    }
    else
    {
        outputBox.Text = ("Nothing found!");
    }
}
catch (TapiException e)
{
    Console.WriteLine(e.Message);
}
controller.Shutdown();
---------------------------------------------------------------------------------------------

My question:
- Does someone have a good, easy to follow, tutorial on how to achieve what i want ?
- Does someone know where my mistake is in the above script ?
- If none of the above counts then can someone tell me the best way to achieve my goal ?

To all the experts: Thanks in advance! P.S. My experience in C# is low.
Comment
Watch Question
CEO @ Arkro IT
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 16 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE