Tuesday, March 07, 2006

So, a question was asked "How do I determine what's happening in the TAPI3 wrapper"?  The answer is you turn on the internal trace source -- ITapi3 was built with a build in tracing facility to tell you when it had any underlying interface or COM failures and it's easy to activate.  First, add an Application Configuration File to your project.  Open that file and add the following lines:

<?xml version="1.0" encoding="utf-8" ?>
<
configuration>
   <
system.diagnostics>
      <
sources>
         <
source name="ITapiTrace" switchName="tapiSwitch" switchType="System.Diagnostics.SourceSwitch">
            <
listeners>
               
<add name="MyTraceLog" type="System.Diagnostics.TextWriterTraceListener" initializeData="MyTrace.txt" />
            </
listeners>
         </
source>
      </
sources>
      <
switches>
         <
add name="tapiSwitch" value="All" />
      </
switches>
   </
system.diagnostics>
</
configuration>

This will create a file called "MyTrace.txt" in your working directory.  The important line is the source tag which identifies the internal TraceSource object used by the ITapi3 library.  Inside this file will be the internal TAPI3 calls being made for your application.  As an example, the following trace shows me that several underlying COM errors occurred in the running of a simple TAPI3 application -- it was unable to retrieve the ITTerminal interface from the ITAddressEvent interface (which actually isn't really an error), failed to open the line (because Unimodem won't allow the media type VOICE to be passed for my modem), and failed to set the play list for this MSP -- [0x80040216] is actually a DirectShow error [VFW_E_NOT_FOUND].

ITapiTrace Verbose: 0 : Creating ITTAPI instance
ITapiTrace Verbose: 0 : Hooking up connection sink to ITTAPI interface
ITapiTrace Information: 0 : ITTapi::put_EventFilter(0x8001F) hr=0x0
ITapiTrace Error: 0 : COM Hresult 0x80040004 "The MEDIATYPE passed in to this method was invalid." generated 
   at JulMar.Tapi3.TapiException.ThrowExceptionForHR(Int32 hr)
   at JulMar.Tapi3.TTapi.RegisterCallNotifications(ITAddress* pitf, Int16 vbMonitor, Int16 vbOwner, Int32 supportedMediaTypes)
   at JulMar.Tapi3.TAddress.Open(TAPIMEDIATYPES supportedMediaTypes)
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 5, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 4, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 3, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 2, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 1, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 0, Terminal=
ITapiTrace Verbose: 0 : Processing TapiCallNotificationEventArgs: Event=CNE_OWNER, Call=TCall: 171360625 CS_OFFERING
ITapiTrace Verbose: 0 : Processing TapiCallStateEventArgs: Call=TCall: 171360625 CS_OFFERING, State=CS_OFFERING, Cause=CEC_NONE
ITapiTrace Error: 0 : COM Hresult 0x80040216 "" generated 
   at JulMar.Tapi3.TapiException.ThrowExceptionForHR(Int32 hr)
   at JulMar.Tapi3.TTerminal.set_MediaPlayList(String[] fileList)
   at AnsMachine.AutoAttendantForm.AnswerCall()
   at AnsMachine.AutoAttendantForm.OnCallState(Object sender, TapiCallStateEventArgs e)
ITapiTrace Verbose: 0 : Processing TapiCallStateEventArgs: Call=TCall: 171360625 CS_DISCONNECTED, State=CS_DISCONNECTED, Cause=CEC_DISCONNECT_NORMAL
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 5, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 4, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 3, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 2, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 1, Terminal=
ITapiTrace Error: 0 : ITAddressEvent::get_Terminal failed hr=0x80040055
ITapiTrace Verbose: 0 : Processing TapiAddressChangedEventArgs: Evt=AE_RINGING, Address=DSSP Line #1 - Address 0, Terminal=
ITapiTrace Error: 0 : ITTapi::Shutdown hr=0x0

 

posted on 3/7/2006 5:18:50 PM (Central Standard Time, UTC-06:00)  #   

Related Posts:
Implementing Drag/Drop with TabControl
ATAPI assembly updated!
Creating Extensible Applications with MAF (System.AddIn)
Guerrilla .NET Tampa samples
TSP++ 3.0 is now free!
Adding Pause/Resume into SynchronizationContext based components

Tracked by:
"Pic_6" (Pic_6) [Trackback]
"Najdena jama" (Najdena jama) [Trackback]
"Caving map of Laze" (Caving map of Laze) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"halifest" (halifest) [Trackback]
"Galaxy Portfolio Services" (Galaxy Portfolio Services) [Trackback]
"Running The Guard... NYHC" (Running The Guard... NYHC) [Trackback]
"Socialist Appeal" (Socialist Appeal) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
http://www.setfirestudios.com/work.php [Trackback]
"New Page 9" (New Page 9) [Trackback]
"fuck that, fuck them, fuck everyone else." (fuck that, fuck them, fuck everyone... [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"backsoon" (backsoon) [Trackback]
"4839_architectonic - Departurebanish.com" (4839_architectonic - Departurebanish... [Trackback]
"Vranja jama" (Vranja jama) [Trackback]
http://www.setfirestudios.com/main.php [Trackback]
"CHARA. reppin' pei" (CHARA. reppin' pei) [Trackback]
"Over N Out. :: Index" (Over N Out. :: Index) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"Baylor - Departurebanish.com" (Baylor - Departurebanish.com) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"AlloyMail" (AlloyMail) [Trackback]
"Departurebanish.com" (Departurebanish.com) [Trackback]
"She Kills dot com bitches." (She Kills dot com bitches.) [Trackback]
"4 < 9" (4 < 9) [Trackback]
"Non-party - Departurebanish.com" (Non-party - Departurebanish.com) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"Camera Whores!!!" (Camera Whores!!!) [Trackback]
"Circumstances_8558 - Departurebanish.com" (Circumstances_8558 - Departurebanish... [Trackback]
"8533 - Departurebanish.com" (8533 - Departurebanish.com) [Trackback]
"Planinska jama" (Planinska jama) [Trackback]
"Bus Pass" (Bus Pass) [Trackback]
"Erica Funghi Snc" (Erica Funghi Snc) [Trackback]
http://www.setfirestudios.com/contacts.php [Trackback]
"Law-unto-itself - Departurebanish.com" (Law-unto-itself - Departurebanish.com) [Trackback]
"Athenian_622 - Departurebanish.com" (Athenian_622 - Departurebanish.com) [Trackback]
"Untitled Document" (Untitled Document) [Trackback]
"1471 - Departurebanish.com" (1471 - Departurebanish.com) [Trackback]
"Visual Elements: The Alkaline Earth Metals" (Visual Elements: The Alkaline Eart... [Trackback]
"2029_guiftes - Departurebanish.com" (2029_guiftes - Departurebanish.com) [Trackback]
"Suggestion_2469 - Departurebanish.com" (Suggestion_2469 - Departurebanish.com) [Trackback]
"Deutsche Lebens Rettungs Gesellschaft eV (DLRG)" (Deutsche Lebens Rettungs Gese... [Trackback]
"atlanta braves" (atlanta braves) [Trackback]
"sterling silver and cufflinks" (sterling silver and cufflinks) [Trackback]
"Bear Men" (Bear Men) [Trackback]
"nike scarpa" (nike scarpa) [Trackback]
"bar mitzvah kippot" (bar mitzvah kippot) [Trackback]
"used tractor parts" (used tractor parts) [Trackback]
"citizenship of the world" (citizenship of the world) [Trackback]
"passover menu" (passover menu) [Trackback]
"md entertainment guide" (md entertainment guide) [Trackback]
"cantante q s" (cantante q s) [Trackback]
"polar axn wrist strap" (polar axn wrist strap) [Trackback]
"ldap ssl binaries hp-ux" (ldap ssl binaries hp-ux) [Trackback]
"banquet table" (banquet table) [Trackback]
"internet scavenger hunt" (internet scavenger hunt) [Trackback]
"fax ribbon" (fax ribbon) [Trackback]