Source code of Windows XP (NT5)
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.

1009 lines
26 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. debug.c
  5. Abstract:
  6. Routines for displaying debug messages.
  7. Environment:
  8. User Mode - Win32
  9. --*/
  10. #if DBG
  11. ///////////////////////////////////////////////////////////////////////////////
  12. // //
  13. // Include files //
  14. // //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #include "globals.h"
  17. #include "provider.h"
  18. #include "registry.h"
  19. #include <stdio.h>
  20. #include <stdarg.h>
  21. #include <crtdbg.h>
  22. ///////////////////////////////////////////////////////////////////////////////
  23. // //
  24. // Private definitions //
  25. // //
  26. ///////////////////////////////////////////////////////////////////////////////
  27. #define DEBUG_FORMAT_HEADER "H323 "
  28. #define DEBUG_FORMAT_TIMESTAMP "[%02u:%02u:%02u.%03u"
  29. #define DEBUG_FORMAT_THREADID ",tid=%x] "
  30. #define MAX_DEBUG_STRLEN 512
  31. #define STATUS_MASK_ERROR 0x0000FFFF
  32. #define STATUS_MASK_FACILITY 0x0FFF0000
  33. ///////////////////////////////////////////////////////////////////////////////
  34. // //
  35. // Private procedures //
  36. // //
  37. ///////////////////////////////////////////////////////////////////////////////
  38. VOID
  39. OutputDebugMessage(
  40. LPSTR pszDebugMessage
  41. )
  42. /*++
  43. Routine Description:
  44. Writes debug message to specified log(s).
  45. Args:
  46. pszDebugMessage - zero-terminated string containing debug message.
  47. Return Values:
  48. None.
  49. --*/
  50. {
  51. // initialize descriptor
  52. static FILE * fd = NULL;
  53. // check if logfile output specified
  54. if (g_RegistrySettings.dwLogType & DEBUG_OUTPUT_FILE) {
  55. // validate
  56. if (fd == NULL) {
  57. // attempt to open log file
  58. fd = fopen(g_RegistrySettings.szLogFile, "w");
  59. }
  60. // validate
  61. if (fd != NULL) {
  62. // output entry to stream
  63. fprintf(fd, "%s", pszDebugMessage);
  64. // flush stream
  65. fflush(fd);
  66. }
  67. }
  68. // check if debugger output specified
  69. if (g_RegistrySettings.dwLogType & DEBUG_OUTPUT_DEBUGGER) {
  70. // output entry to debugger
  71. OutputDebugStringA(pszDebugMessage);
  72. }
  73. }
  74. ///////////////////////////////////////////////////////////////////////////////
  75. // //
  76. // Public procedures //
  77. // //
  78. ///////////////////////////////////////////////////////////////////////////////
  79. VOID
  80. H323DbgPrint(
  81. DWORD dwLevel,
  82. LPSTR szFormat,
  83. ...
  84. )
  85. /*++
  86. Routine Description:
  87. Debug output routine for service provider.
  88. Arguments:
  89. Same as printf.
  90. Return Values:
  91. None.
  92. --*/
  93. {
  94. va_list Args;
  95. SYSTEMTIME SystemTime;
  96. char szDebugMessage[MAX_DEBUG_STRLEN+1];
  97. int nLengthRemaining;
  98. int nLength = 0;
  99. // see if level enabled
  100. if (dwLevel <= g_RegistrySettings.dwLogLevel) {
  101. // retrieve local time
  102. GetLocalTime(&SystemTime);
  103. // add component header to the debug message
  104. nLength += sprintf(&szDebugMessage[nLength],
  105. DEBUG_FORMAT_HEADER
  106. );
  107. // add timestamp to the debug message
  108. nLength += sprintf(&szDebugMessage[nLength],
  109. DEBUG_FORMAT_TIMESTAMP,
  110. SystemTime.wHour,
  111. SystemTime.wMinute,
  112. SystemTime.wSecond,
  113. SystemTime.wMilliseconds
  114. );
  115. // add thread id to the debug message
  116. nLength += sprintf(&szDebugMessage[nLength],
  117. DEBUG_FORMAT_THREADID,
  118. GetCurrentThreadId()
  119. );
  120. // point at first argument
  121. va_start(Args, szFormat);
  122. // determine number of bytes left in buffer
  123. nLengthRemaining = sizeof(szDebugMessage) - nLength;
  124. // add user specified debug message
  125. _vsnprintf(&szDebugMessage[nLength],
  126. nLengthRemaining,
  127. szFormat,
  128. Args
  129. );
  130. // release pointer
  131. va_end(Args);
  132. // output message to specified sink
  133. OutputDebugMessage(szDebugMessage);
  134. }
  135. }
  136. PSTR
  137. H323IndicationToString(
  138. BYTE bIndication
  139. )
  140. /*++
  141. Routine Description:
  142. Converts indication from call control module to string.
  143. Arguments:
  144. bIndication - Specifies value to convert.
  145. Return Values:
  146. Returns string describing value.
  147. --*/
  148. {
  149. static PSTR apszIndicationStrings[] = {
  150. NULL,
  151. "CC_RINGING_INDICATION",
  152. "CC_CONNECT_INDICATION",
  153. "CC_TX_CHANNEL_OPEN_INDICATION",
  154. "CC_RX_CHANNEL_REQUEST_INDICATION",
  155. "CC_RX_CHANNEL_CLOSE_INDICATION",
  156. "CC_MUTE_INDICATION",
  157. "CC_UNMUTE_INDICATION",
  158. "CC_PEER_ADD_INDICATION",
  159. "CC_PEER_DROP_INDICATION",
  160. "CC_PEER_CHANGE_CAP_INDICATION",
  161. "CC_CONFERENCE_TERMINATION_INDICATION",
  162. "CC_HANGUP_INDICATION",
  163. "CC_RX_NONSTANDARD_MESSAGE_INDICATION",
  164. "CC_MULTIPOINT_INDICATION",
  165. "CC_PEER_UPDATE_INDICATION",
  166. "CC_H245_MISCELLANEOUS_COMMAND_INDICATION",
  167. "CC_H245_MISCELLANEOUS_INDICATION_INDICATION",
  168. "CC_H245_CONFERENCE_REQUEST_INDICATION",
  169. "CC_H245_CONFERENCE_RESPONSE_INDICATION",
  170. "CC_H245_CONFERENCE_COMMAND_INDICATION",
  171. "CC_H245_CONFERENCE_INDICATION_INDICATION",
  172. "CC_FLOW_CONTROL_INDICATION",
  173. "CC_TX_CHANNEL_CLOSE_REQUEST_INDICATION",
  174. "CC_REQUEST_MODE_INDICATION",
  175. "CC_REQUEST_MODE_RESPONSE_INDICATION",
  176. "CC_VENDOR_ID_INDICATION",
  177. "CC_MAXIMUM_AUDIO_VIDEO_SKEW_INDICATION",
  178. "CC_T120_CHANNEL_REQUEST_INDICATION",
  179. "CC_T120_CHANNEL_OPEN_INDICATION",
  180. "CC_BANDWIDTH_CHANGED_INDICATION",
  181. "CC_ACCEPT_CHANNEL_INDICATION",
  182. "CC_TERMINAL_ID_REQUEST_INDICATION"
  183. };
  184. // make sure index value within bounds
  185. return (bIndication < H323GetNumStrings(apszIndicationStrings))
  186. ? apszIndicationStrings[bIndication]
  187. : NULL
  188. ;
  189. }
  190. PSTR
  191. CCStatusToString(
  192. DWORD dwStatus
  193. )
  194. /*++
  195. Routine Description:
  196. Converts call control status to string.
  197. Arguments:
  198. dwStatus - Specifies value to convert.
  199. Return Values:
  200. Returns string describing value.
  201. --*/
  202. {
  203. static PSTR apszCCStatusStrings[] = {
  204. NULL,
  205. "CC_PEER_REJECT",
  206. "CC_BAD_PARAM",
  207. "CC_BAD_SIZE",
  208. "CC_ACTIVE_CONNECTIONS",
  209. "CC_INTERNAL_ERROR",
  210. "CC_NOT_IMPLEMENTED",
  211. "CC_DUPLICATE_CONFERENCE_ID",
  212. "CC_ILLEGAL_IN_MULTIPOINT",
  213. "CC_NOT_MULTIPOINT_CAPABLE",
  214. "CC_PEER_CANCEL",
  215. NULL,
  216. NULL,
  217. NULL,
  218. "CC_NO_MEMORY",
  219. NULL,
  220. NULL,
  221. NULL,
  222. NULL,
  223. NULL,
  224. NULL,
  225. "CC_GKI_STATE",
  226. "CC_GKI_CALL_STATE",
  227. "CC_GKI_LISTEN_NOT_FOUND",
  228. "CC_GATEKEEPER_REFUSED",
  229. "CC_INVALID_WITHOUT_GATEKEEPER",
  230. "CC_GKI_IP_ADDRESS",
  231. "CC_GKI_LOAD"
  232. };
  233. // adjust code within bounds
  234. dwStatus -= ERROR_LOCAL_BASE_ID;
  235. // make sure index value within bounds
  236. return (dwStatus < H323GetNumStrings(apszCCStatusStrings))
  237. ? apszCCStatusStrings[dwStatus]
  238. : NULL
  239. ;
  240. }
  241. PSTR
  242. CCRejectReasonToString(
  243. DWORD dwReason
  244. )
  245. {
  246. static PSTR apszCCRejectReasonStrings[] = {
  247. NULL,
  248. "CC_REJECT_NO_BANDWIDTH",
  249. "CC_REJECT_GATEKEEPER_RESOURCES",
  250. "CC_REJECT_UNREACHABLE_DESTINATION",
  251. "CC_REJECT_DESTINATION_REJECTION",
  252. "CC_REJECT_INVALID_REVISION",
  253. "CC_REJECT_NO_PERMISSION",
  254. "CC_REJECT_UNREACHABLE_GATEKEEPER",
  255. "CC_REJECT_GATEWAY_RESOURCES",
  256. "CC_REJECT_BAD_FORMAT_ADDRESS",
  257. "CC_REJECT_ADAPTIVE_BUSY",
  258. "CC_REJECT_IN_CONF",
  259. "CC_REJECT_ROUTE_TO_GATEKEEPER",
  260. "CC_REJECT_CALL_FORWARDED",
  261. "CC_REJECT_ROUTE_TO_MC",
  262. "CC_REJECT_UNDEFINED_REASON",
  263. "CC_REJECT_INTERNAL_ERROR",
  264. "CC_REJECT_NORMAL_CALL_CLEARING",
  265. "CC_REJECT_USER_BUSY",
  266. "CC_REJECT_NO_ANSWER",
  267. "CC_REJECT_NOT_IMPLEMENTED",
  268. "CC_REJECT_MANDATORY_IE_MISSING",
  269. "CC_REJECT_INVALID_IE_CONTENTS",
  270. "CC_REJECT_TIMER_EXPIRED",
  271. "CC_REJECT_CALL_DEFLECTION",
  272. "CC_REJECT_GATEKEEPER_TERMINATED"
  273. };
  274. // make sure index value within bounds
  275. return (dwReason < H323GetNumStrings(apszCCRejectReasonStrings))
  276. ? apszCCRejectReasonStrings[dwReason]
  277. : NULL
  278. ;
  279. }
  280. PSTR
  281. Q931StatusToString(
  282. DWORD dwStatus
  283. )
  284. /*++
  285. Routine Description:
  286. Converts Q.931 status to string.
  287. Arguments:
  288. dwStatus - Specifies value to convert.
  289. Return Values:
  290. Returns string describing value.
  291. --*/
  292. {
  293. static PSTR apszQ931StatusStrings[] = {
  294. NULL,
  295. "Q931_BAD_PARAM",
  296. "Q931_DUPLICATE_LISTEN",
  297. "Q931_INTERNAL_ERROR",
  298. "Q931_BAD_SIZE",
  299. "Q931_NO_MEMORY",
  300. "Q931_NOT_IMPLEMENTED",
  301. "Q931_NOT_INITIALIZED",
  302. "Q931_DUPLICATE_INITIALIZE",
  303. "Q931_SUBSYSTEM_FAILURE",
  304. "Q931_OUT_OF_SEQUENCE",
  305. "Q931_PEER_UNREACHABLE",
  306. "Q931_SETUP_TIMER_EXPIRED",
  307. "Q931_RINGING_TIMER_EXPIRED",
  308. "Q931_INCOMPATIBLE_VERSION",
  309. "Q931_OPTION_NOT_IMPLEMENTED",
  310. "Q931_ENDOFINPUT",
  311. "Q931_INVALID_FIELD",
  312. "Q931_NO_FIELD_DATA",
  313. "Q931_INVALID_PROTOCOL",
  314. "Q931_INVALID_MESSAGE_TYPE",
  315. "Q931_MANDATORY_IE_MISSING",
  316. "Q931_BAD_IE_CONTENT"
  317. };
  318. // adjust code within bounds
  319. dwStatus -= ERROR_LOCAL_BASE_ID;
  320. // make sure index value within bounds
  321. return (dwStatus < H323GetNumStrings(apszQ931StatusStrings))
  322. ? apszQ931StatusStrings[dwStatus]
  323. : NULL
  324. ;
  325. }
  326. PSTR
  327. H245StatusToString(
  328. DWORD dwStatus
  329. )
  330. /*++
  331. Routine Description:
  332. Converts H.245 status to string.
  333. Arguments:
  334. dwStatus - Specifies value to convert.
  335. Return Values:
  336. Returns string describing value.
  337. --*/
  338. {
  339. static PSTR apszH245StatusStrings[] = {
  340. NULL,
  341. "H245_ERROR_INVALID_DATA_FORMAT",
  342. "H245_ERROR_NOMEM",
  343. "H245_ERROR_NOSUP",
  344. "H245_ERROR_PARAM",
  345. "H245_ERROR_ALREADY_INIT",
  346. "H245_ERROR_NOT_CONNECTED",
  347. NULL,
  348. NULL,
  349. NULL,
  350. NULL,
  351. NULL,
  352. NULL,
  353. NULL,
  354. NULL,
  355. NULL,
  356. "H245_ERROR_NORESOURCE",
  357. "H245_ERROR_NOTIMP",
  358. "H245_ERROR_SUBSYS",
  359. "H245_ERROR_FATAL",
  360. "H245_ERROR_MAXTBL",
  361. "H245_ERROR_CHANNEL_INUSE",
  362. "H245_ERROR_INVALID_CAPID",
  363. "H245_ERROR_INVALID_OP",
  364. "H245_ERROR_UNKNOWN",
  365. "H245_ERROR_NOBANDWIDTH",
  366. "H245_ERROR_LOSTCON",
  367. "H245_ERROR_INVALID_MUXTBLENTRY",
  368. "H245_ERROR_INVALID_INST",
  369. "H245_ERROR_INPROCESS",
  370. "H245_ERROR_INVALID_STATE",
  371. "H245_ERROR_TIMEOUT",
  372. "H245_ERROR_INVALID_CHANNEL",
  373. "H245_ERROR_INVALID_CAPDESCID",
  374. "H245_ERROR_CANCELED",
  375. "H245_ERROR_MUXELEMENT_DEPTH",
  376. "H245_ERROR_MUXELEMENT_WIDTH",
  377. "H245_ERROR_ASN1",
  378. "H245_ERROR_NO_MUX_CAPS",
  379. "H245_ERROR_NO_CAPDESC"
  380. };
  381. // remove error base id
  382. dwStatus -= ERROR_BASE_ID;
  383. // make sure index value within bounds
  384. return (dwStatus < H323GetNumStrings(apszH245StatusStrings))
  385. ? apszH245StatusStrings[dwStatus]
  386. : NULL
  387. ;
  388. }
  389. PSTR
  390. WinsockStatusToString(
  391. DWORD dwStatus
  392. )
  393. /*++
  394. Routine Description:
  395. Converts winsock status to string.
  396. Arguments:
  397. dwStatus - Specifies value to convert.
  398. Return Values:
  399. Returns string describing value.
  400. --*/
  401. {
  402. static PSTR apszWinsockStatusStrings[] = {
  403. NULL,
  404. NULL,
  405. NULL,
  406. NULL,
  407. "WSAEINTR",
  408. NULL,
  409. NULL,
  410. NULL,
  411. NULL,
  412. "WSAEBADF",
  413. NULL,
  414. NULL,
  415. NULL,
  416. "WSAEACCES",
  417. "WSAEFAULT",
  418. NULL,
  419. NULL,
  420. NULL,
  421. NULL,
  422. NULL,
  423. NULL,
  424. NULL,
  425. "WSAEINVAL",
  426. NULL,
  427. "WSAEMFILE",
  428. NULL,
  429. NULL,
  430. NULL,
  431. NULL,
  432. NULL,
  433. NULL,
  434. NULL,
  435. NULL,
  436. NULL,
  437. NULL,
  438. "WSAEWOULDBLOCK",
  439. "WSAEINPROGRESS",
  440. "WSAEALREADY",
  441. "WSAENOTSOCK",
  442. "WSAEDESTADDRREQ",
  443. "WSAEMSGSIZE",
  444. "WSAEPROTOTYPE",
  445. "WSAENOPROTOOPT",
  446. "WSAEPROTONOSUPPORT",
  447. "WSAESOCKTNOSUPPORT",
  448. "WSAEOPNOTSUPP",
  449. "WSAEPFNOSUPPORT",
  450. "WSAEAFNOSUPPORT",
  451. "WSAEADDRINUSE",
  452. "WSAEADDRNOTAVAIL",
  453. "WSAENETDOWN",
  454. "WSAENETUNREACH",
  455. "WSAENETRESET",
  456. "WSAECONNABORTED",
  457. "WSAECONNRESET",
  458. "WSAENOBUFS",
  459. "WSAEISCONN",
  460. "WSAENOTCONN",
  461. "WSAESHUTDOWN",
  462. "WSAETOOMANYREFS",
  463. "WSAETIMEDOUT",
  464. "WSAECONNREFUSED",
  465. "WSAELOOP",
  466. "WSAENAMETOOLONG",
  467. "WSAEHOSTDOWN",
  468. "WSAEHOSTUNREACH",
  469. "WSAENOTEMPTY",
  470. "WSAEPROCLIM",
  471. "WSAEUSERS",
  472. "WSAEDQUOT",
  473. "WSAESTALE",
  474. "WSAEREMOTE"
  475. };
  476. // validate status
  477. if (dwStatus < WSABASEERR) {
  478. return NULL;
  479. }
  480. // adjust error code
  481. dwStatus -= WSABASEERR;
  482. // make sure index value within bounds
  483. return (dwStatus < H323GetNumStrings(apszWinsockStatusStrings))
  484. ? apszWinsockStatusStrings[dwStatus]
  485. : NULL
  486. ;
  487. }
  488. PSTR
  489. H323StatusToString(
  490. DWORD dwStatus
  491. )
  492. /*++
  493. Routine Description:
  494. Converts status to string.
  495. Arguments:
  496. dwStatus - Specifies value to convert.
  497. Return Values:
  498. Returns string describing value.
  499. --*/
  500. {
  501. DWORD dwFacility;
  502. static PSTR pszDefaultString = "ERROR";
  503. static PSTR pszNoErrorString = "NOERROR";
  504. // retrieve facility code from statuse code
  505. dwFacility = ((dwStatus & STATUS_MASK_FACILITY) >> 16);
  506. // check for success
  507. if (dwStatus == NOERROR) {
  508. // return success string
  509. return pszNoErrorString;
  510. } else if (dwFacility == FACILITY_CALLCONTROL) {
  511. // return call control status string
  512. return CCStatusToString(dwStatus & STATUS_MASK_ERROR);
  513. } else if (dwFacility == FACILITY_Q931) {
  514. // return Q931 status string
  515. return Q931StatusToString(dwStatus & STATUS_MASK_ERROR);
  516. } else if (dwFacility == FACILITY_H245) {
  517. // return H245 status string
  518. return H245StatusToString(dwStatus & STATUS_MASK_ERROR);
  519. } else if (dwFacility == FACILITY_WINSOCK) {
  520. // return H245 status string
  521. return WinsockStatusToString(dwStatus & STATUS_MASK_ERROR);
  522. } else {
  523. // return default string
  524. return pszDefaultString;
  525. }
  526. }
  527. PSTR
  528. H323CallStateToString(
  529. DWORD dwCallState
  530. )
  531. /*++
  532. Routine Description:
  533. Converts tapi call state to string.
  534. Arguments:
  535. dwCallState - Specifies value to convert.
  536. Return Values:
  537. Returns string describing value.
  538. --*/
  539. {
  540. DWORD i;
  541. DWORD dwBitMask;
  542. static PSTR apszCallStateStrings[] = {
  543. "IDLE",
  544. "OFFERING",
  545. "ACCEPTED",
  546. "DIALTONE",
  547. "DIALING",
  548. "RINGBACK",
  549. "BUSY",
  550. "SPECIALINFO",
  551. "CONNECTED",
  552. "PROCEEDING",
  553. "ONHOLD",
  554. "CONFERENCED",
  555. "ONHOLDPENDCONF",
  556. "ONHOLDPENDTRANSFER",
  557. "DISCONNECTED",
  558. "UNKNOWN"
  559. };
  560. // keep shifting bit until the call state matchs the one specified
  561. for(i = 0, dwBitMask = 1; dwCallState != dwBitMask; i++, dwBitMask <<= 1)
  562. ;
  563. // return corresponding string
  564. return apszCallStateStrings[i];
  565. }
  566. PSTR
  567. H323DirToString(
  568. DWORD dwDir
  569. )
  570. /*++
  571. Routine Description:
  572. Converts H.245 direction to string.
  573. Arguments:
  574. dwDir - Specifies value to convert.
  575. Return Values:
  576. Returns string describing value.
  577. --*/
  578. {
  579. static PSTR apszH245DirStrings[] = {
  580. "H245_CAPDIR_DONTCARE",
  581. "H245_CAPDIR_RMTRX",
  582. "H245_CAPDIR_RMTTX",
  583. "H245_CAPDIR_RMTRXTX",
  584. "H245_CAPDIR_LCLRX",
  585. "H245_CAPDIR_LCLTX",
  586. "H245_CAPDIR_LCLRXTX"
  587. };
  588. // make sure index value within bounds
  589. return (dwDir < H323GetNumStrings(apszH245DirStrings))
  590. ? apszH245DirStrings[dwDir]
  591. : NULL
  592. ;
  593. }
  594. PSTR
  595. H323DataTypeToString(
  596. DWORD dwDataType
  597. )
  598. /*++
  599. Routine Description:
  600. Converts H.245 data type to string.
  601. Arguments:
  602. dwDataType - Specifies value to convert.
  603. Return Values:
  604. Returns string describing value.
  605. --*/
  606. {
  607. static PSTR apszH245DataTypeStrings[] = {
  608. "H245_DATA_DONTCARE",
  609. "H245_DATA_NONSTD",
  610. "H245_DATA_NULL",
  611. "H245_DATA_VIDEO",
  612. "H245_DATA_AUDIO",
  613. "H245_DATA_DATA",
  614. "H245_DATA_ENCRYPT_D",
  615. "H245_DATA_CONFERENCE",
  616. "H245_DATA_MUX"
  617. };
  618. // make sure index value within bounds
  619. return (dwDataType < H323GetNumStrings(apszH245DataTypeStrings))
  620. ? apszH245DataTypeStrings[dwDataType]
  621. : NULL
  622. ;
  623. }
  624. PSTR
  625. H323ClientTypeToString(
  626. DWORD dwClientType
  627. )
  628. /*++
  629. Routine Description:
  630. Converts H.245 client type to string.
  631. Arguments:
  632. dwClientType - Specifies value to convert.
  633. Return Values:
  634. Returns string describing value.
  635. --*/
  636. {
  637. static PSTR apszH245ClientTypeStrings[] = {
  638. "H245_CLIENT_DONTCARE",
  639. "H245_CLIENT_NONSTD",
  640. "H245_CLIENT_VID_NONSTD",
  641. "H245_CLIENT_VID_H261",
  642. "H245_CLIENT_VID_H262",
  643. "H245_CLIENT_VID_H263",
  644. "H245_CLIENT_VID_IS11172",
  645. "H245_CLIENT_AUD_NONSTD",
  646. "H245_CLIENT_AUD_G711_ALAW64",
  647. "H245_CLIENT_AUD_G711_ALAW56",
  648. "H245_CLIENT_AUD_G711_ULAW64",
  649. "H245_CLIENT_AUD_G711_ULAW56",
  650. "H245_CLIENT_AUD_G722_64",
  651. "H245_CLIENT_AUD_G722_56",
  652. "H245_CLIENT_AUD_G722_48",
  653. "H245_CLIENT_AUD_G723",
  654. "H245_CLIENT_AUD_G728",
  655. "H245_CLIENT_AUD_G729",
  656. "H245_CLIENT_AUD_GDSVD",
  657. "H245_CLIENT_AUD_IS11172",
  658. "H245_CLIENT_AUD_IS13818",
  659. "H245_CLIENT_DAT_NONSTD",
  660. "H245_CLIENT_DAT_T120",
  661. "H245_CLIENT_DAT_DSMCC",
  662. "H245_CLIENT_DAT_USERDATA",
  663. "H245_CLIENT_DAT_T84",
  664. "H245_CLIENT_DAT_T434",
  665. "H245_CLIENT_DAT_H224",
  666. "H245_CLIENT_DAT_NLPID",
  667. "H245_CLIENT_DAT_DSVD",
  668. "H245_CLIENT_DAT_H222",
  669. "H245_CLIENT_ENCRYPTION_TX",
  670. "H245_CLIENT_ENCRYPTION_RX",
  671. "H245_CLIENT_CONFERENCE",
  672. "H245_CLIENT_MUX_NONSTD",
  673. "H245_CLIENT_MUX_H222",
  674. "H245_CLIENT_MUX_H223",
  675. "H245_CLIENT_MUX_VGMUX",
  676. "H245_CLIENT_MUX_H2250",
  677. "H245_CLIENT_MUX_H223_ANNEX_A"
  678. };
  679. // make sure index value within bounds
  680. return (dwClientType < H323GetNumStrings(apszH245ClientTypeStrings))
  681. ? apszH245ClientTypeStrings[dwClientType]
  682. : NULL
  683. ;
  684. }
  685. PSTR
  686. H323MiscCommandToString(
  687. DWORD dwMiscCommand
  688. )
  689. /*++
  690. Routine Description:
  691. Converts H.245 command to string.
  692. Arguments:
  693. dwMiscCommand - Miscellaneous H.245 command.
  694. Return Values:
  695. Returns string describing value.
  696. --*/
  697. {
  698. static PSTR apszH245MiscCommandStrings[] = {
  699. "equaliseDelay",
  700. "zeroDelay",
  701. "multipointModeCommand",
  702. "cnclMltpntMdCmmnd",
  703. "videoFreezePicture",
  704. "videoFastUpdatePicture",
  705. "videoFastUpdateGOB",
  706. "MCd_tp_vdTmprlSptlTrdOff",
  707. "videoSendSyncEveryGOB",
  708. "vdSndSyncEvryGOBCncl",
  709. "videoFastUpdateMB"
  710. };
  711. // make sure index value within bounds
  712. return (dwMiscCommand < H323GetNumStrings(apszH245MiscCommandStrings))
  713. ? apszH245MiscCommandStrings[dwMiscCommand]
  714. : "Unknown"
  715. ;
  716. }
  717. PSTR
  718. H323MSPCommandToString(
  719. DWORD dwCommand
  720. )
  721. /*++
  722. Routine Description:
  723. Converts MSP command to string.
  724. Arguments:
  725. Command - Type of MSP command.
  726. Return Values:
  727. Returns string describing value.
  728. --*/
  729. {
  730. static PSTR apszMSPCommandStrings[] = {
  731. "CMD_CHANNEL_OPEN",
  732. "CMD_CHANNEL_OPEN_REPLY",
  733. "CMD_CHANNEL_CLOSE",
  734. "CMD_CALL_CONNECT",
  735. "CMD_CALL_DISCONNECT",
  736. "CMD_KEYFRAME"
  737. };
  738. // make sure index value within bounds
  739. return (dwCommand < H323GetNumStrings(apszMSPCommandStrings))
  740. ? apszMSPCommandStrings[dwCommand]
  741. : NULL
  742. ;
  743. }
  744. PSTR
  745. H323AddressTypeToString(
  746. DWORD dwAddressType
  747. )
  748. /*++
  749. Routine Description:
  750. Converts TAPI address type to string.
  751. Arguments:
  752. dwAddressType - TAPI address type.
  753. Return Values:
  754. Returns string describing value.
  755. --*/
  756. {
  757. switch (dwAddressType) {
  758. case LINEADDRESSTYPE_PHONENUMBER:
  759. return "PHONENUMBER";
  760. case LINEADDRESSTYPE_SDP:
  761. return "SDP";
  762. case LINEADDRESSTYPE_EMAILNAME:
  763. return "EMAILNAME";
  764. case LINEADDRESSTYPE_DOMAINNAME:
  765. return "DOMAINNAME";
  766. case LINEADDRESSTYPE_IPADDRESS:
  767. return "IPADDRESS";
  768. default:
  769. return "unknown";
  770. }
  771. }
  772. #endif // DBG