Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

479 lines
20 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. tapidbg.c
  5. Abstract:
  6. This module provides tapi specific debug support
  7. Author:
  8. Wesley Witt (wesw) 22-Jan-1996
  9. Revision History:
  10. --*/
  11. #include "faxsvc.h"
  12. #pragma hdrstop
  13. typedef struct _LOOKUP {
  14. DWORD dwVal;
  15. LPTSTR lpszVal;
  16. } LOOKUP, *PLOOKUP;
  17. typedef struct _MSGTYPE {
  18. DWORD MsgId;
  19. BOOL LineMsg;
  20. LPTSTR Text;
  21. } MSGTYPE, *PMSGTYPE;
  22. MSGTYPE aMsgs[] =
  23. {
  24. { LINE_ADDRESSSTATE, TRUE, TEXT("LINE_ADDRESSSTATE") },
  25. { LINE_AGENTSPECIFIC, TRUE, TEXT("LINE_AGENTSPECIFIC") },
  26. { LINE_AGENTSTATUS, TRUE, TEXT("LINE_AGENTSTATUS") },
  27. { LINE_APPNEWCALL, TRUE, TEXT("LINE_APPNEWCALL") },
  28. { LINE_CALLINFO, TRUE, TEXT("LINE_CALLINFO") },
  29. { LINE_CALLSTATE, TRUE, TEXT("LINE_CALLSTATE") },
  30. { LINE_CLOSE, TRUE, TEXT("LINE_CLOSE") },
  31. { LINE_CREATE, TRUE, TEXT("LINE_CREATE") },
  32. { LINE_CREATE, TRUE, TEXT("LINE_CREATE") },
  33. { LINE_DEVSPECIFIC, TRUE, TEXT("LINE_DEVSPECIFIC") },
  34. { LINE_DEVSPECIFICFEATURE, TRUE, TEXT("LINE_DEVSPECIFICFEATURE") },
  35. { LINE_GATHERDIGITS, TRUE, TEXT("LINE_GATHERDIGITS") },
  36. { LINE_GENERATE, TRUE, TEXT("LINE_GENERATE") },
  37. { LINE_LINEDEVSTATE, TRUE, TEXT("LINE_LINEDEVSTATE") },
  38. { LINE_MONITORDIGITS, TRUE, TEXT("LINE_MONITORDIGITS") },
  39. { LINE_MONITORMEDIA, TRUE, TEXT("LINE_MONITORMEDIA") },
  40. { LINE_MONITORTONE, TRUE, TEXT("LINE_MONITORTONE") },
  41. { LINE_PROXYREQUEST, TRUE, TEXT("LINE_PROXYREQUEST") },
  42. { LINE_REMOVE, TRUE, TEXT("LINE_REMOVE") },
  43. { LINE_REPLY, TRUE, TEXT("LINE_REPLY") },
  44. { LINE_REQUEST, TRUE, TEXT("LINE_REQUEST") },
  45. { PHONE_BUTTON, FALSE, TEXT("PHONE_BUTTON") },
  46. { PHONE_CLOSE, FALSE, TEXT("PHONE_CLOSE") },
  47. { PHONE_CREATE, FALSE, TEXT("PHONE_CREATE") },
  48. { PHONE_DEVSPECIFIC, FALSE, TEXT("PHONE_DEVSPECIFIC") },
  49. { PHONE_REMOVE, FALSE, TEXT("PHONE_REMOVE") },
  50. { PHONE_REPLY, FALSE, TEXT("PHONE_REPLY") },
  51. { PHONE_STATE, FALSE, TEXT("PHONE_STATE") },
  52. { 0xffffffff, FALSE, NULL }
  53. };
  54. LOOKUP aAddressStates[] =
  55. {
  56. { LINEADDRESSSTATE_OTHER ,TEXT("OTHER") },
  57. { LINEADDRESSSTATE_DEVSPECIFIC ,TEXT("DEVSPECIFIC") },
  58. { LINEADDRESSSTATE_INUSEZERO ,TEXT("INUSEZERO") },
  59. { LINEADDRESSSTATE_INUSEONE ,TEXT("INUSEONE") },
  60. { LINEADDRESSSTATE_INUSEMANY ,TEXT("INUSEMANY") },
  61. { LINEADDRESSSTATE_NUMCALLS ,TEXT("NUMCALLS") },
  62. { LINEADDRESSSTATE_FORWARD ,TEXT("FORWARD") },
  63. { LINEADDRESSSTATE_TERMINALS ,TEXT("TERMINALS") },
  64. { LINEADDRESSSTATE_CAPSCHANGE ,TEXT("CAPSCHANGE") },
  65. { 0xffffffff ,TEXT("") }
  66. };
  67. LOOKUP aBearerModes[] =
  68. {
  69. { LINEBEARERMODE_VOICE ,TEXT("VOICE") },
  70. { LINEBEARERMODE_SPEECH ,TEXT("SPEECH") },
  71. { LINEBEARERMODE_MULTIUSE ,TEXT("MULTIUSE") },
  72. { LINEBEARERMODE_DATA ,TEXT("DATA") },
  73. { LINEBEARERMODE_ALTSPEECHDATA ,TEXT("ALTSPEECHDATA") },
  74. { LINEBEARERMODE_NONCALLSIGNALING ,TEXT("NONCALLSIGNALING") },
  75. { LINEBEARERMODE_PASSTHROUGH ,TEXT("PASSTHROUGH") },
  76. { 0xffffffff ,TEXT("") }
  77. };
  78. LOOKUP aButtonModes[] =
  79. {
  80. { PHONEBUTTONMODE_DUMMY ,TEXT("DUMMY") },
  81. { PHONEBUTTONMODE_CALL ,TEXT("CALL") },
  82. { PHONEBUTTONMODE_FEATURE ,TEXT("FEATURE") },
  83. { PHONEBUTTONMODE_KEYPAD ,TEXT("KEYPAD") },
  84. { PHONEBUTTONMODE_LOCAL ,TEXT("LOCAL") },
  85. { PHONEBUTTONMODE_DISPLAY ,TEXT("DISPLAY") },
  86. { 0xffffffff ,TEXT("") }
  87. };
  88. LOOKUP aButtonStates[] =
  89. {
  90. { PHONEBUTTONSTATE_UP ,TEXT("UP") },
  91. { PHONEBUTTONSTATE_DOWN ,TEXT("DOWN") },
  92. { PHONEBUTTONSTATE_UNKNOWN ,TEXT("UNKNOWN") },
  93. { PHONEBUTTONSTATE_UNAVAIL ,TEXT("UNAVAIL") },
  94. { 0xffffffff ,TEXT("") }
  95. };
  96. LOOKUP aCallInfoStates[] =
  97. {
  98. { LINECALLINFOSTATE_OTHER ,TEXT("OTHER") },
  99. { LINECALLINFOSTATE_DEVSPECIFIC ,TEXT("DEVSPECIFIC") },
  100. { LINECALLINFOSTATE_BEARERMODE ,TEXT("BEARERMODE") },
  101. { LINECALLINFOSTATE_RATE ,TEXT("RATE") },
  102. { LINECALLINFOSTATE_MEDIAMODE ,TEXT("MEDIAMODE") },
  103. { LINECALLINFOSTATE_APPSPECIFIC ,TEXT("APPSPECIFIC") },
  104. { LINECALLINFOSTATE_CALLID ,TEXT("CALLID") },
  105. { LINECALLINFOSTATE_RELATEDCALLID ,TEXT("RELATEDCALLID") },
  106. { LINECALLINFOSTATE_ORIGIN ,TEXT("ORIGIN") },
  107. { LINECALLINFOSTATE_REASON ,TEXT("REASON") },
  108. { LINECALLINFOSTATE_COMPLETIONID ,TEXT("COMPLETIONID") },
  109. { LINECALLINFOSTATE_NUMOWNERINCR ,TEXT("NUMOWNERINCR") },
  110. { LINECALLINFOSTATE_NUMOWNERDECR ,TEXT("NUMOWNERDECR") },
  111. { LINECALLINFOSTATE_NUMMONITORS ,TEXT("NUMMONITORS") },
  112. { LINECALLINFOSTATE_TRUNK ,TEXT("TRUNK") },
  113. { LINECALLINFOSTATE_CALLERID ,TEXT("CALLERID") },
  114. { LINECALLINFOSTATE_CALLEDID ,TEXT("CALLEDID") },
  115. { LINECALLINFOSTATE_CONNECTEDID ,TEXT("CONNECTEDID") },
  116. { LINECALLINFOSTATE_REDIRECTIONID ,TEXT("REDIRECTIONID") },
  117. { LINECALLINFOSTATE_REDIRECTINGID ,TEXT("REDIRECTINGID") },
  118. { LINECALLINFOSTATE_DISPLAY ,TEXT("DISPLAY") },
  119. { LINECALLINFOSTATE_USERUSERINFO ,TEXT("USERUSERINFO") },
  120. { LINECALLINFOSTATE_HIGHLEVELCOMP ,TEXT("HIGHLEVELCOMP") },
  121. { LINECALLINFOSTATE_LOWLEVELCOMP ,TEXT("LOWLEVELCOMP") },
  122. { LINECALLINFOSTATE_CHARGINGINFO ,TEXT("CHARGINGINFO") },
  123. { LINECALLINFOSTATE_TERMINAL ,TEXT("TERMINAL") },
  124. { LINECALLINFOSTATE_DIALPARAMS ,TEXT("DIALPARAMS") },
  125. { LINECALLINFOSTATE_MONITORMODES ,TEXT("MONITORMODES") },
  126. { 0xffffffff ,TEXT("") }
  127. };
  128. LOOKUP aCallSelects[] =
  129. {
  130. { LINECALLSELECT_LINE ,TEXT("LINE") },
  131. { LINECALLSELECT_ADDRESS ,TEXT("ADDRESS") },
  132. { LINECALLSELECT_CALL ,TEXT("CALL") },
  133. { 0xffffffff ,TEXT("") }
  134. };
  135. LOOKUP aCallStates[] =
  136. {
  137. { LINECALLSTATE_IDLE ,TEXT("IDLE") },
  138. { LINECALLSTATE_OFFERING ,TEXT("OFFERING") },
  139. { LINECALLSTATE_ACCEPTED ,TEXT("ACCEPTED") },
  140. { LINECALLSTATE_DIALTONE ,TEXT("DIALTONE") },
  141. { LINECALLSTATE_DIALING ,TEXT("DIALING") },
  142. { LINECALLSTATE_RINGBACK ,TEXT("RINGBACK") },
  143. { LINECALLSTATE_BUSY ,TEXT("BUSY") },
  144. { LINECALLSTATE_SPECIALINFO ,TEXT("SPECIALINFO") },
  145. { LINECALLSTATE_CONNECTED ,TEXT("CONNECTED") },
  146. { LINECALLSTATE_PROCEEDING ,TEXT("PROCEEDING") },
  147. { LINECALLSTATE_ONHOLD ,TEXT("ONHOLD") },
  148. { LINECALLSTATE_CONFERENCED ,TEXT("CONFERENCED") },
  149. { LINECALLSTATE_ONHOLDPENDCONF ,TEXT("ONHOLDPENDCONF") },
  150. { LINECALLSTATE_ONHOLDPENDTRANSFER ,TEXT("ONHOLDPENDTRANSFER") },
  151. { LINECALLSTATE_DISCONNECTED ,TEXT("DISCONNECTED") },
  152. { LINECALLSTATE_UNKNOWN ,TEXT("UNKNOWN") },
  153. { 0xffffffff ,TEXT("") }
  154. };
  155. LOOKUP aDigitModes[] =
  156. {
  157. { LINEDIGITMODE_PULSE ,TEXT("PULSE") },
  158. { LINEDIGITMODE_DTMF ,TEXT("DTMF") },
  159. { LINEDIGITMODE_DTMFEND ,TEXT("DTMFEND") },
  160. { 0xffffffff ,TEXT("") }
  161. };
  162. LOOKUP aHookSwitchDevs[] =
  163. {
  164. { PHONEHOOKSWITCHDEV_HANDSET ,TEXT("HANDSET") },
  165. { PHONEHOOKSWITCHDEV_SPEAKER ,TEXT("SPEAKER") },
  166. { PHONEHOOKSWITCHDEV_HEADSET ,TEXT("HEADSET") },
  167. { 0xffffffff ,TEXT("") }
  168. };
  169. LOOKUP aHookSwitchModes[] =
  170. {
  171. { PHONEHOOKSWITCHMODE_ONHOOK ,TEXT("ONHOOK") },
  172. { PHONEHOOKSWITCHMODE_MIC ,TEXT("MIC") },
  173. { PHONEHOOKSWITCHMODE_SPEAKER ,TEXT("SPEAKER") },
  174. { PHONEHOOKSWITCHMODE_MICSPEAKER ,TEXT("MICSPEAKER") },
  175. { PHONEHOOKSWITCHMODE_UNKNOWN ,TEXT("UNKNOWN") },
  176. { 0xffffffff ,TEXT("") }
  177. };
  178. LOOKUP aLampModes[] =
  179. {
  180. { PHONELAMPMODE_DUMMY ,TEXT("DUMMY") },
  181. { PHONELAMPMODE_OFF ,TEXT("OFF") },
  182. { PHONELAMPMODE_STEADY ,TEXT("STEADY") },
  183. { PHONELAMPMODE_WINK ,TEXT("WINK") },
  184. { PHONELAMPMODE_FLASH ,TEXT("FLASH") },
  185. { PHONELAMPMODE_FLUTTER ,TEXT("FLUTTER") },
  186. { PHONELAMPMODE_BROKENFLUTTER ,TEXT("BROKENFLUTTER") },
  187. { PHONELAMPMODE_UNKNOWN ,TEXT("UNKNOWN") },
  188. { 0xffffffff ,TEXT("") }
  189. };
  190. LOOKUP aLineStates[] =
  191. {
  192. { LINEDEVSTATE_OTHER ,TEXT("OTHER") },
  193. { LINEDEVSTATE_RINGING ,TEXT("RINGING") },
  194. { LINEDEVSTATE_CONNECTED ,TEXT("CONNECTED") },
  195. { LINEDEVSTATE_DISCONNECTED ,TEXT("DISCONNECTED") },
  196. { LINEDEVSTATE_MSGWAITON ,TEXT("MSGWAITON") },
  197. { LINEDEVSTATE_MSGWAITOFF ,TEXT("MSGWAITOFF") },
  198. { LINEDEVSTATE_INSERVICE ,TEXT("INSERVICE") },
  199. { LINEDEVSTATE_OUTOFSERVICE ,TEXT("OUTOFSERVICE") },
  200. { LINEDEVSTATE_MAINTENANCE ,TEXT("MAINTENANCE") },
  201. { LINEDEVSTATE_OPEN ,TEXT("OPEN") },
  202. { LINEDEVSTATE_CLOSE ,TEXT("CLOSE") },
  203. { LINEDEVSTATE_NUMCALLS ,TEXT("NUMCALLS") },
  204. { LINEDEVSTATE_NUMCOMPLETIONS ,TEXT("NUMCOMPLETIONS") },
  205. { LINEDEVSTATE_TERMINALS ,TEXT("TERMINALS") },
  206. { LINEDEVSTATE_ROAMMODE ,TEXT("ROAMMODE") },
  207. { LINEDEVSTATE_BATTERY ,TEXT("BATTERY") },
  208. { LINEDEVSTATE_SIGNAL ,TEXT("SIGNAL") },
  209. { LINEDEVSTATE_DEVSPECIFIC ,TEXT("DEVSPECIFIC") },
  210. { LINEDEVSTATE_REINIT ,TEXT("REINIT") },
  211. { LINEDEVSTATE_LOCK ,TEXT("LOCK") },
  212. { LINEDEVSTATE_CAPSCHANGE ,TEXT("CAPSCHANGE") },
  213. { LINEDEVSTATE_CONFIGCHANGE ,TEXT("CONFIGCHANGE") },
  214. { LINEDEVSTATE_TRANSLATECHANGE ,TEXT("TRANSLATECHANGE") },
  215. { LINEDEVSTATE_COMPLCANCEL ,TEXT("COMPLCANCEL") },
  216. { LINEDEVSTATE_REMOVED ,TEXT("REMOVED") },
  217. { 0xffffffff ,TEXT("") }
  218. };
  219. LOOKUP aMediaModes[] =
  220. {
  221. { LINEMEDIAMODE_UNKNOWN ,TEXT("UNKNOWN") },
  222. { LINEMEDIAMODE_INTERACTIVEVOICE ,TEXT("INTERACTIVEVOICE") },
  223. { LINEMEDIAMODE_AUTOMATEDVOICE ,TEXT("AUTOMATEDVOICE") },
  224. { LINEMEDIAMODE_DATAMODEM ,TEXT("DATAMODEM") },
  225. { LINEMEDIAMODE_G3FAX ,TEXT("G3FAX") },
  226. { LINEMEDIAMODE_TDD ,TEXT("TDD") },
  227. { LINEMEDIAMODE_G4FAX ,TEXT("G4FAX") },
  228. { LINEMEDIAMODE_DIGITALDATA ,TEXT("DIGITALDATA") },
  229. { LINEMEDIAMODE_TELETEX ,TEXT("TELETEX") },
  230. { LINEMEDIAMODE_VIDEOTEX ,TEXT("VIDEOTEX") },
  231. { LINEMEDIAMODE_TELEX ,TEXT("TELEX") },
  232. { LINEMEDIAMODE_MIXED ,TEXT("MIXED") },
  233. { LINEMEDIAMODE_ADSI ,TEXT("ADSI") },
  234. { LINEMEDIAMODE_VOICEVIEW ,TEXT("VOICEVIEW") },
  235. { 0xffffffff ,TEXT("") }
  236. };
  237. LOOKUP aPhoneStates[] =
  238. {
  239. { PHONESTATE_OTHER ,TEXT("OTHER") },
  240. { PHONESTATE_CONNECTED ,TEXT("CONNECTED") },
  241. { PHONESTATE_DISCONNECTED ,TEXT("DISCONNECTED") },
  242. { PHONESTATE_OWNER ,TEXT("OWNER") },
  243. { PHONESTATE_MONITORS ,TEXT("MONITORS") },
  244. { PHONESTATE_DISPLAY ,TEXT("DISPLAY") },
  245. { PHONESTATE_LAMP ,TEXT("LAMP") },
  246. { PHONESTATE_RINGMODE ,TEXT("RINGMODE") },
  247. { PHONESTATE_RINGVOLUME ,TEXT("RINGVOLUME") },
  248. { PHONESTATE_HANDSETHOOKSWITCH ,TEXT("HANDSETHOOKSWITCH") },
  249. { PHONESTATE_HANDSETVOLUME ,TEXT("HANDSETVOLUME") },
  250. { PHONESTATE_HANDSETGAIN ,TEXT("HANDSETGAIN") },
  251. { PHONESTATE_SPEAKERHOOKSWITCH ,TEXT("SPEAKERHOOKSWITCH") },
  252. { PHONESTATE_SPEAKERVOLUME ,TEXT("SPEAKERVOLUME") },
  253. { PHONESTATE_SPEAKERGAIN ,TEXT("SPEAKERGAIN") },
  254. { PHONESTATE_HEADSETHOOKSWITCH ,TEXT("HEADSETHOOKSWITCH") },
  255. { PHONESTATE_HEADSETVOLUME ,TEXT("HEADSETVOLUME") },
  256. { PHONESTATE_HEADSETGAIN ,TEXT("HEADSETGAIN") },
  257. { PHONESTATE_SUSPEND ,TEXT("SUSPEND") },
  258. { PHONESTATE_RESUME ,TEXT("RESUME") },
  259. { PHONESTATE_DEVSPECIFIC ,TEXT("DEVSPECIFIC") },
  260. { PHONESTATE_REINIT ,TEXT("REINIT") },
  261. { PHONESTATE_CAPSCHANGE ,TEXT("CAPSCHANGE") },
  262. { PHONESTATE_REMOVED ,TEXT("REMOVED") },
  263. { 0xffffffff ,TEXT("") }
  264. };
  265. LOOKUP aTerminalModes[] =
  266. {
  267. { LINETERMMODE_BUTTONS ,TEXT("BUTTONS") },
  268. { LINETERMMODE_LAMPS ,TEXT("LAMPS") },
  269. { LINETERMMODE_DISPLAY ,TEXT("DISPLAY") },
  270. { LINETERMMODE_RINGER ,TEXT("RINGER") },
  271. { LINETERMMODE_HOOKSWITCH ,TEXT("HOOKSWITCH") },
  272. { LINETERMMODE_MEDIATOLINE ,TEXT("MEDIATOLINE") },
  273. { LINETERMMODE_MEDIAFROMLINE ,TEXT("MEDIAFROMLINE") },
  274. { LINETERMMODE_MEDIABIDIRECT ,TEXT("MEDIABIDIRECT") },
  275. { 0xffffffff ,TEXT("") }
  276. };
  277. LOOKUP aToneModes[] =
  278. {
  279. { LINETONEMODE_CUSTOM ,TEXT("CUSTOM") },
  280. { LINETONEMODE_RINGBACK ,TEXT("RINGBACK") },
  281. { LINETONEMODE_BUSY ,TEXT("BUSY") },
  282. { LINETONEMODE_BEEP ,TEXT("BEEP") },
  283. { LINETONEMODE_BILLING ,TEXT("BILLING") },
  284. { 0xffffffff ,TEXT("") }
  285. };
  286. LOOKUP aTransferModes[] =
  287. {
  288. { LINETRANSFERMODE_TRANSFER ,TEXT("TRANSFER") },
  289. { LINETRANSFERMODE_CONFERENCE ,TEXT("CONFERENCE") },
  290. { 0xffffffff ,TEXT("") }
  291. };
  292. LPTSTR
  293. GetFlags(
  294. DWORD_PTR dwFlags,
  295. PLOOKUP pLookup
  296. )
  297. {
  298. int i;
  299. TCHAR buf[256];
  300. LPTSTR p = NULL;
  301. buf[0] = 0;
  302. for (i = 0; (dwFlags && (pLookup[i].dwVal != 0xffffffff)); i++) {
  303. if (dwFlags & pLookup[i].dwVal) {
  304. _tcscat( buf, pLookup[i].lpszVal );
  305. dwFlags = dwFlags & (~(DWORD_PTR)pLookup[i].dwVal);
  306. }
  307. }
  308. if (buf[0]) {
  309. p = (LPTSTR) MemAlloc( (_tcslen(buf) + 1) * sizeof(buf[1]) );
  310. if (p) {
  311. _tcscpy( p, buf );
  312. }
  313. }
  314. return p;
  315. }
  316. void
  317. ShowLineEvent(
  318. HLINE htLine,
  319. HCALL htCall,
  320. LPTSTR MsgStr,
  321. DWORD_PTR dwCallbackInstance,
  322. DWORD dwMsg,
  323. DWORD_PTR dwParam1,
  324. DWORD_PTR dwParam2,
  325. DWORD_PTR dwParam3
  326. )
  327. {
  328. int i;
  329. LPTSTR lpszParam1 = NULL;
  330. LPTSTR lpszParam2 = NULL;
  331. LPTSTR lpszParam3 = NULL;
  332. TCHAR MsgBuf[1024];
  333. DEBUG_FUNCTION_NAME(TEXT("ShowLineEvent"));
  334. MsgBuf[0] = 0;
  335. if (MsgStr) {
  336. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("%s "), MsgStr );
  337. }
  338. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("dwCallbackInstance=0x%08x "), dwCallbackInstance );
  339. for (i = 0; aMsgs[i].MsgId != 0xffffffff; i++) {
  340. if (dwMsg == aMsgs[i].MsgId) {
  341. break;
  342. }
  343. }
  344. if (aMsgs[i].MsgId == 0xffffffff) {
  345. _stprintf(
  346. &MsgBuf[_tcslen(MsgBuf)],
  347. TEXT("<unknown msg id = %d> : hLine=0x%08x, hCall=0x%08x "),
  348. dwMsg,
  349. htLine,
  350. htCall
  351. );
  352. } else {
  353. _stprintf(
  354. &MsgBuf[_tcslen(MsgBuf)],
  355. TEXT("%s : hLine=0x%08x, hCall=0x%08x "),
  356. aMsgs[i].Text,
  357. htLine,
  358. htCall
  359. );
  360. }
  361. if (aMsgs[i].LineMsg) {
  362. switch (dwMsg) {
  363. case LINE_ADDRESSSTATE:
  364. lpszParam2 = GetFlags( dwParam2, aAddressStates );
  365. break;
  366. case LINE_CALLINFO:
  367. lpszParam1 = GetFlags( dwParam1, aCallInfoStates );
  368. break;
  369. case LINE_CALLSTATE:
  370. lpszParam1 = GetFlags( dwParam1, aCallStates );
  371. break;
  372. case LINE_LINEDEVSTATE:
  373. lpszParam1 = GetFlags( dwParam1, aLineStates );
  374. break;
  375. }
  376. } else {
  377. switch (dwMsg) {
  378. case PHONE_BUTTON:
  379. lpszParam2 = GetFlags( dwParam2, aButtonModes );
  380. lpszParam3 = GetFlags( dwParam3, aButtonStates );
  381. break;
  382. case PHONE_STATE:
  383. lpszParam1 = GetFlags( dwParam1, aPhoneStates);
  384. break;
  385. }
  386. }
  387. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("dwParam1=0x%08x"), dwParam1 );
  388. if (lpszParam1) {
  389. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("(%s) "), lpszParam1 );
  390. } else {
  391. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT(" ") );
  392. }
  393. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("dwParam2=0x%08x"), dwParam2 );
  394. if (lpszParam2) {
  395. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("(%s) "), lpszParam2 );
  396. } else {
  397. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT(" ") );
  398. }
  399. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("dwParam3=0x%08x"), dwParam3 );
  400. if (lpszParam3) {
  401. _stprintf( &MsgBuf[_tcslen(MsgBuf)], TEXT("(%s)"), lpszParam3 );
  402. }
  403. DebugPrintEx(DEBUG_TAPI, TEXT("**%s"), MsgBuf);
  404. if (lpszParam1) {
  405. MemFree( lpszParam1 );
  406. }
  407. if (lpszParam2) {
  408. MemFree( lpszParam2 );
  409. }
  410. if (lpszParam3) {
  411. MemFree( lpszParam3 );
  412. }
  413. }