tapi integration

Hi

I have received an sdk for the avaya ip office telephony platform, and I need to start developing an interface for the very basic functions. All the documentation relates to c or c++ . They do mntion however that Devlink.dll, (which is what applications need to link to) can be used in any language that supports dynamic link libraries. I believe that c# supports dll's, therefore that means I can access the functionality via this dll even though I'm developing in C#? All I would need to do link to it? How is this normally achived in C#. This application will eventually be a .net application by the way.
ramrod
ramrod1979Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

billtouchCommented:
C# is managed code where it is most likely that Devlink.dll is not managed code. You will have to tell C# how to connect to the various unmanged functions. There is a linking construct "DllImport". The following examples are from the samples Microsoft gives in the .NET distribution.


public class Win32
{
        [DllImport("Kernel32.dll")]
        public static extern void GetSystemTime(ref SystemTime sysTime);

        [DllImport("User32.dll", EntryPoint="MessageBox", CharSet=CharSet.Auto)]
        public static extern int MsgBox(int hWnd, String text, String caption, uint type);
}

public class TestPInvoke
{
        public static void Main()
        {
              SystemTime sysTime = new SystemTime();
              Win32.GetSystemTime(ref sysTime);

              String date = String.Format("System time is: \nYear: {0}\nMonth: {1}\nDayOfWeek: {2}\nDay: {3}",
                  sysTime.wYear,
                  sysTime.wMonth,
                  sysTime.wDayOfWeek,
                  sysTime.wDay);

                Win32.MsgBox(0, date, "PInvoke Sample", 0);
        }
}

Bill

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ramrod1979Author Commented:
Ok a bit clearer now. Can you give me a link with a few more examples and explanotary detail on how to handle\access the unmanaged code? Or should I just look up dllimport on msdn?

Many thanks
billtouchCommented:
Here is a link that gives a tutorial on linking to unmanaged code:
http://www.devsource.com/article2/0,1759,1764101,00.asp

Here is one that touches upon code with a heaping helping of data structures info (marshalling):
http://www.codeproject.com/netcf/compframe2.asp

Of course, no tutorial collection would be complete without a word from Microsoft:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcwlkSysimportAttributeTutorial.asp

Let me know if there is something you don't understand.

Bill
ramrod1979Author Commented:
Many thanks there BillTouch. This has certainly pointed me in the right direction. The only difficulty I have now is gettig it to fit into the asp.net application I'm writing (and to fully understand the syntax and how it relates to everything else). The idea being to have a browser based outbound dialling program in which an agent logs in to the asp.net app with a user name and extension\trunk line number. Once this trunk number has been input the ip office telephony will know which extension\line to use in order to make an outbound call when the 'make call' button is pressed.

Many thanks



billtouchCommented:
Thanks a lot. I haven't done much with asp. But if you run into a road bock, I can try to get you an answer.

Bill
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.