TAPI

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

TAPI

 
0
  #1
Aug 19th, 2008
Hi, I was wondering how to use TAPI in C++ to communicate with my modem. How would I accomplish this? I'm not using Visual C++. I'm using dev-c++ 4.9.9.2.
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: TAPI

 
0
  #2
Aug 20th, 2008
Anyone?
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: TAPI

 
0
  #3
Aug 20th, 2008
What do you mean "how"?

How I would do it would be
- STW for tutorials and examples
- Read the manual pages
- Try some examples
- Do some design work on the system I want to implement
- Write some code, then test it.
And so on.

Same as any other software problem really. The "TAPI" and "C++" isn't special in that respect.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: TAPI

 
0
  #4
Aug 20th, 2008
By "How", I mean I looked for like an hour finding only stuff about .Net, and was wondering what the code would be, what libraries I might have to get, and so on. Like I said before, I'm using Dev-C++ 4.9.9.2, so anything that could be compiled with that IDE would help me a lot.
Last edited by TheBeast32; Aug 20th, 2008 at 2:09 am.
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: TAPI

 
0
  #5
Aug 20th, 2008
C++ doesn't care whether your IDE is "Visual" or "Dev".
Again, if you've already found some C++ code, you're already like 95%+ of the way there.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: TAPI

 
0
  #6
Aug 20th, 2008
How would you compile this in Dev?

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using JulMar.Tapi3;
  5.  
  6. namespace TestTapi
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. TTapi tapi = new TTapi();
  13. TCall call = null; TAddress modemAddr = null;
  14.  
  15. tapi.Initialize();
  16. tapi.TE_CALLNOTIFICATION += delegate(object sender, TapiCallNotificationEventArgs e)
  17. {
  18. Console.WriteLine("New call {0} detected from {1}", e.Call.ToString(), e.Event);
  19. };
  20. tapi.TE_CALLSTATE += delegate(object sender, TapiCallStateEventArgs e)
  21. {
  22. Console.WriteLine("{0}:{4} has changed state to {1} due to {2} - current={3}:{5}",
  23. e.Call, e.State, e.Cause, e.Call == call, e.Call.GetHashCode(), (call != null) ? call.GetHashCode() : 0);
  24. if (e.State == CALL_STATE.CS_INPROGRESS && e.Call == call)
  25. {
  26. Console.WriteLine("Dropping call");
  27. e.Call.Disconnect(DISCONNECT_CODE.DC_NORMAL);
  28. }
  29. };
  30.  
  31. foreach (TAddress addr in tapi.Addresses)
  32. {
  33. if (String.Compare(addr.ServiceProviderName, "unimdm.tsp", true) == 0 &&
  34. addr.QueryMediaType(TAPIMEDIATYPES.AUDIO))
  35. modemAddr = addr;
  36. }
  37.  
  38. if (modemAddr != null)
  39. {
  40. Console.WriteLine("{0} = {1} ({3}) [{2}]", modemAddr.AddressName, modemAddr.State, modemAddr.ServiceProviderName, modemAddr.DialableAddress);
  41. modemAddr.Monitor(TAPIMEDIATYPES.AUDIO);
  42. ConsoleKey ki = ConsoleKey.A;
  43.  
  44. while (ki != ConsoleKey.Q)
  45. {
  46. // Flip the auto-destroy flag
  47. if (ki == ConsoleKey.D)
  48. {
  49. tapi.AutoDestroyCalls = !tapi.AutoDestroyCalls;
  50. Console.WriteLine("Set AutoDestroy to {0}", tapi.AutoDestroyCalls);
  51. }
  52. // List existing calls
  53. else if (ki == ConsoleKey.L)
  54. {
  55. foreach (TCall _call in modemAddr.EnumerateCalls())
  56. {
  57. Console.WriteLine("Existing call found: {0}:{1}", _call, _call.GetHashCode());
  58. _call.Dispose(); // Go ahead and dump it
  59. }
  60. }
  61. // Create a new call
  62. else
  63. {
  64. call = modemAddr.CreateCall("5551213", LINEADDRESSTYPES.PhoneNumber, TAPIMEDIATYPES.DATAMODEM);
  65. Console.WriteLine("Created new call {0}:{1}", call, call.GetHashCode());
  66. try
  67. {
  68. // This will fail if existing call interface is still around (i.e. not disposed)
  69. call.Connect(false);
  70. }
  71. catch (TapiException ex)
  72. {
  73. Console.WriteLine(ex.Message);
  74. }
  75. }
  76. Console.WriteLine("Press a key to try another call.. Q to quit");
  77. ki = Console.ReadKey().Key;
  78. }
  79. }
  80.  
  81. // This will destroy any outstanding interfaces
  82. tapi.Shutdown();
  83.  
  84. // Call should be disposed here.. state will be CS_UNKNOWN
  85. if (call != null)
  86. Console.WriteLine("{0} {1}", call, call.CallState);
  87. }
  88. }
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: TAPI

 
0
  #7
Aug 20th, 2008
I thought you have C++ examples as well as .net examples.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: TAPI

 
0
  #8
Aug 20th, 2008
OOOOOOOPSSSSSSSSSSS, I'm StUPID. No i didn't. I don't know why I put that........
I'm an idiot.......................
Last edited by TheBeast32; Aug 20th, 2008 at 2:10 am.
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: TAPI

 
0
  #9
Aug 20th, 2008
After a brief search, some source code in C++
http://www.julmar.com/tapi/
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: TAPI

 
0
  #10
Aug 20th, 2008
Where can I get the SDK for the samples here http://www.tapi.info/default.aspx/TAPI/PSDKSamples.html
Last edited by TheBeast32; Aug 20th, 2008 at 4:33 pm.
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC