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.

722 lines
20 KiB

  1. /****************************************************************************
  2. *
  3. * $Archive: S:/STURGEON/SRC/INCLUDE/VCS/q931pdu.h_v $
  4. *
  5. * INTEL Corporation Prorietary Information
  6. *
  7. * This listing is supplied under the terms of a license agreement
  8. * with INTEL Corporation and may not be copied nor disclosed except
  9. * in accordance with the terms of that agreement.
  10. *
  11. * Copyright (c) 1996 Intel Corporation.
  12. *
  13. * $Revision: 1.11 $
  14. * $Date: 22 Jan 1997 17:21:04 $
  15. * $Author: MANDREWS $
  16. *
  17. * Abstract: Parser routines for Q931 PDUs
  18. *
  19. ***************************************************************************/
  20. #ifndef Q931PAR_H
  21. #define Q931PAR_H
  22. #include <winerror.h>
  23. #include "av_asn1.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. struct S_BUFFERDESCR
  28. {
  29. DWORD Length;
  30. BYTE *BufferPtr;
  31. };
  32. typedef struct S_BUFFERDESCR BUFFERDESCR;
  33. typedef struct S_BUFFERDESCR *PBUFFERDESCR;
  34. // Mask to extract a message type from a byte
  35. #define MESSAGETYPEMASK 0x7f
  36. typedef BYTE MESSAGEIDTYPE;
  37. // Q931 defined message types
  38. #define ALERTINGMESSAGETYPE 0x01
  39. #define PROCEEDINGMESSAGETYPE 0x02
  40. #define CONNECTMESSAGETYPE 0x07
  41. #define CONNECTACKMESSAGETYPE 0x0F
  42. #define PROGRESSMESSAGETYPE 0x03
  43. #define SETUPMESSAGETYPE 0x05
  44. #define SETUPACKMESSAGETYPE 0x0D
  45. #define RESUMEMESSAGETYPE 0x26
  46. #define RESUMEACKMESSAGETYPE 0x2E
  47. #define RESUMEREJMESSAGETYPE 0x22
  48. #define SUSPENDMESSAGETYPE 0x25
  49. #define SUSPENDACKMESSAGETYPE 0x2D
  50. #define SUSPENDREJMESSAGETYPE 0x21
  51. #define USERINFOMESSAGETYPE 0x20
  52. #define DISCONNECTMESSAGETYPE 0x45
  53. #define RELEASEMESSAGETYPE 0x4D
  54. #define RELEASECOMPLMESSAGETYPE 0x5A
  55. #define RESTARTMESSAGETYPE 0x46
  56. #define RESTARTACKMESSAGETYPE 0x4E
  57. #define SEGMENTMESSAGETYPE 0x60
  58. #define CONGCTRLMESSAGETYPE 0x79
  59. #define INFORMATIONMESSAGETYPE 0x7B
  60. #define NOTIFYMESSAGETYPE 0x6E
  61. #define STATUSMESSAGETYPE 0x7D
  62. #define STATUSENQUIRYMESSAGETYPE 0x75
  63. // Mask to remove only the field identifier from a type 1 single octet field
  64. #define TYPE1IDENTMASK 0xf0
  65. // Mask to remove only the value from a type 1 single octet field
  66. #define TYPE1VALUEMASK 0x0f
  67. // Type of the field identitifiers
  68. typedef BYTE FIELDIDENTTYPE;
  69. // Field identifiers
  70. // Single octet values
  71. #define IDENT_RESERVED 0x80
  72. #define IDENT_SHIFT 0x90
  73. #define IDENT_MORE 0xA0
  74. #define IDENT_SENDINGCOMPLETE 0xA1
  75. #define IDENT_CONGESTION 0xB0
  76. #define IDENT_REPEAT 0xD0
  77. // Variable length octet values
  78. #define IDENT_SEGMENTED 0x00
  79. #define IDENT_BEARERCAP 0x04
  80. #define IDENT_CAUSE 0x08
  81. #define IDENT_CALLIDENT 0x10
  82. #define IDENT_CALLSTATE 0x14
  83. #define IDENT_CHANNELIDENT 0x18
  84. #define IDENT_PROGRESS 0x1E
  85. #define IDENT_PROGRESS2 0x1F
  86. #define IDENT_NETWORKSPEC 0x20
  87. #define IDENT_NOTIFICATION 0x27
  88. #define IDENT_DISPLAY 0x28
  89. #define IDENT_DATE 0x29
  90. #define IDENT_KEYPAD 0x2C
  91. #define IDENT_SIGNAL 0x34
  92. #define IDENT_INFORMATIONRATE 0x40
  93. #define IDENT_ENDTOENDDELAY 0x42
  94. #define IDENT_TRANSITDELAY 0x43
  95. #define IDENT_PLBINARYPARAMS 0x44
  96. #define IDENT_PLWINDOWSIZE 0x45
  97. #define IDENT_PACKETSIZE 0x46
  98. #define IDENT_CLOSEDUG 0x47
  99. #define IDENT_REVCHARGE 0x4A
  100. #define IDENT_CALLINGNUMBER 0x6C
  101. #define IDENT_CALLINGSUBADDR 0x6D
  102. #define IDENT_CALLEDNUMBER 0x70
  103. #define IDENT_CALLEDSUBADDR 0x71
  104. #define IDENT_REDIRECTING 0x74
  105. #define IDENT_TRANSITNET 0x78
  106. #define IDENT_RESTART 0x79
  107. #define IDENT_LLCOMPATIBILITY 0x7C
  108. #define IDENT_HLCOMPATIBILITY 0x7D
  109. #define IDENT_USERUSER 0x7E
  110. //-------------------------------------------------------------------
  111. // Structures for messages and information elements
  112. //-------------------------------------------------------------------
  113. typedef BYTE PDTYPE;
  114. #define Q931PDVALUE ((PDTYPE)0x08)
  115. typedef WORD CRTYPE;
  116. // Since right now we don't need to separate out the individual
  117. // parts of the fields of the structures these are the base
  118. // types from which the fields are made.
  119. // Single octet element type 1 (contains a value)
  120. struct S_SINGLESTRUCT1
  121. {
  122. BOOLEAN Present;
  123. BYTE Value;
  124. };
  125. // Single octet element type 2 (does not contain a value)
  126. struct S_SINGLESTRUCT2
  127. {
  128. BOOLEAN Present;
  129. };
  130. // Variable length element
  131. // Maximum element size
  132. #define MAXVARFIELDLEN 131
  133. struct S_VARSTRUCT
  134. {
  135. BOOLEAN Present;
  136. BYTE Length;
  137. BYTE Contents[MAXVARFIELDLEN];
  138. };
  139. // Right now all of the fields are bound to the simplest
  140. // structures above. No parsing other than just
  141. // single octet/variable octet is done. When the values
  142. // in some of the subfields are important, change the
  143. // structures here and change the appropriate parsing
  144. // routine to generate the right structure
  145. // The shift element is a single type 1
  146. typedef struct S_SINGLESTRUCT1 SHIFTIE;
  147. typedef struct S_SINGLESTRUCT1 *PSHIFTIE;
  148. // The more data element is a single type 2
  149. typedef struct S_SINGLESTRUCT2 MOREDATAIE;
  150. typedef struct S_SINGLESTRUCT2 *PMOREDATAIE;
  151. // The sending complete element is a single type 2
  152. typedef struct S_SINGLESTRUCT2 SENDCOMPLIE;
  153. typedef struct S_SINGLESTRUCT2 *PSENDCOMPLIE;
  154. // The congestion level element is a single type 1
  155. typedef struct S_SINGLESTRUCT1 CONGESTIONIE;
  156. typedef struct S_SINGLESTRUCT1 *PCONGESTIONIE;
  157. // The repeat indicator element is a single type 1
  158. typedef struct S_SINGLESTRUCT1 REPEATIE;
  159. typedef struct S_SINGLESTRUCT1 *PREPEATIE;
  160. // The segmented element is a variable
  161. typedef struct S_VARSTRUCT SEGMENTEDIE;
  162. typedef struct S_VARSTRUCT *PSEGMENTEDIE;
  163. // The bearer capability element is a variable
  164. typedef struct S_VARSTRUCT BEARERCAPIE;
  165. typedef struct S_VARSTRUCT *PBEARERCAPIE;
  166. // The cause element is a variable
  167. typedef struct S_VARSTRUCT CAUSEIE;
  168. typedef struct S_VARSTRUCT *PCAUSEIE;
  169. // The call identity element is a variable
  170. typedef struct S_VARSTRUCT CALLIDENTIE;
  171. typedef struct S_VARSTRUCT *PCALLIDENTIE;
  172. // The call state element is a variable
  173. typedef struct S_VARSTRUCT CALLSTATEIE;
  174. typedef struct S_VARSTRUCT *PCALLSTATEIE;
  175. // The channel identifier element is a variable
  176. typedef struct S_VARSTRUCT CHANIDENTIE;
  177. typedef struct S_VARSTRUCT *PCHANIDENTIE;
  178. // The progress indicator element is a variable
  179. typedef struct S_VARSTRUCT PROGRESSIE;
  180. typedef struct S_VARSTRUCT *PPROGRESSIE;
  181. // The network specific element is a variable
  182. typedef struct S_VARSTRUCT NETWORKIE;
  183. typedef struct S_VARSTRUCT *PNETWORKIE;
  184. // The notification indicator element is a variable
  185. typedef struct S_VARSTRUCT NOTIFICATIONINDIE;
  186. typedef struct S_VARSTRUCT *PNOTIFICATIONINDIE;
  187. // The display element is a variable
  188. typedef struct S_VARSTRUCT DISPLAYIE;
  189. typedef struct S_VARSTRUCT *PDISPLAYIE;
  190. // The date element is a variable
  191. typedef struct S_VARSTRUCT DATEIE;
  192. typedef struct S_VARSTRUCT *PDATEIE;
  193. // The keypad element is a variable
  194. typedef struct S_VARSTRUCT KEYPADIE;
  195. typedef struct S_VARSTRUCT *PKEYPADIE;
  196. // The signal element is a variable
  197. typedef struct S_VARSTRUCT SIGNALIE;
  198. typedef struct S_VARSTRUCT *PSIGNALIE;
  199. // The information rate element is a variable
  200. typedef struct S_VARSTRUCT INFORATEIE;
  201. typedef struct S_VARSTRUCT *PINFORATEIE;
  202. // The end to end transit delay element is a variable
  203. typedef struct S_VARSTRUCT ENDTOENDDELAYIE;
  204. typedef struct S_VARSTRUCT *PENDTOENDDELAYIE;
  205. // The transit delay element is a variable
  206. typedef struct S_VARSTRUCT TRANSITDELAYIE;
  207. typedef struct S_VARSTRUCT *PTRANSITDELAYIE;
  208. // The packet layer binary parameters element is a variable
  209. typedef struct S_VARSTRUCT PLBINARYPARAMSIE;
  210. typedef struct S_VARSTRUCT *PPLBINARYPARAMSIE;
  211. // The packet layer window size element is a variable
  212. typedef struct S_VARSTRUCT PLWINDOWSIZEIE;
  213. typedef struct S_VARSTRUCT *PPLWINDOWSIZEIE;
  214. // The packet size element is a variable
  215. typedef struct S_VARSTRUCT PACKETSIZEIE;
  216. typedef struct S_VARSTRUCT *PPACKETSIZEIE;
  217. // The closed user group element is a variable
  218. typedef struct S_VARSTRUCT CLOSEDUGIE;
  219. typedef struct S_VARSTRUCT *PCLOSEDUGIE;
  220. // The reverse charge indication element is a variable
  221. typedef struct S_VARSTRUCT REVERSECHARGEIE;
  222. typedef struct S_VARSTRUCT *PREVERSECHARGEIE;
  223. // The calling party number element is a variable
  224. typedef struct S_VARSTRUCT CALLINGNUMBERIE;
  225. typedef struct S_VARSTRUCT *PCALLINGNUMBERIE;
  226. // The calling party subaddress element is a variable
  227. typedef struct S_VARSTRUCT CALLINGSUBADDRIE;
  228. typedef struct S_VARSTRUCT *PCALLINGSUBADDRIE;
  229. // The called party subaddress element is a variable
  230. typedef struct S_VARSTRUCT CALLEDSUBADDRIE;
  231. typedef struct S_VARSTRUCT *PCALLEDSUBADDRIE;
  232. // The redirecting number element is a variable
  233. typedef struct S_VARSTRUCT REDIRECTINGIE;
  234. typedef struct S_VARSTRUCT *PREDIRECTINGIE;
  235. // The transit network selection element is a variable
  236. typedef struct S_VARSTRUCT TRANSITNETIE;
  237. typedef struct S_VARSTRUCT *PTRANSITNETIE;
  238. // The restart indicator element is a variable
  239. typedef struct S_VARSTRUCT RESTARTIE;
  240. typedef struct S_VARSTRUCT *PRESTARTIE;
  241. // The low layer compatibility element is a variable
  242. typedef struct S_VARSTRUCT LLCOMPATIBILITYIE;
  243. typedef struct S_VARSTRUCT *PLLCOMPATIBILITYIE;
  244. // The higher layer compatibility element is a variable
  245. typedef struct S_VARSTRUCT HLCOMPATIBILITYIE;
  246. typedef struct S_VARSTRUCT *PHLCOMPATIBILITYIE;
  247. #define Q931_PROTOCOL_X209 ((PDTYPE)0x05)
  248. struct S_VARSTRUCT_UU
  249. {
  250. BOOLEAN Present;
  251. BYTE ProtocolDiscriminator;
  252. WORD UserInformationLength;
  253. BYTE UserInformation[0x1000]; // 4k bytes should be good for now...
  254. };
  255. // The user to user element is a variable
  256. typedef struct S_VARSTRUCT_UU USERUSERIE;
  257. typedef struct S_VARSTRUCT_UU *PUSERUSERIE;
  258. struct S_PARTY_NUMBER
  259. {
  260. BOOLEAN Present;
  261. BYTE NumberType;
  262. BYTE NumberingPlan;
  263. BYTE PartyNumberLength;
  264. BYTE PartyNumbers[MAXVARFIELDLEN];
  265. };
  266. // The called party number element is a variable
  267. typedef struct S_PARTY_NUMBER CALLEDNUMBERIE;
  268. typedef struct S_PARTY_NUMBER *PCALLEDNUMBERIE;
  269. // Q932 defined message types
  270. #define FACILITYMESSAGETYPE 0x62
  271. #define IDENT_FACILITY 0x1C
  272. typedef struct S_VARSTRUCT FACILITYIE;
  273. typedef struct S_VARSTRUCT *PFACILITYIE;
  274. // Generic structure for a Q.931 message
  275. struct S_MESSAGE
  276. {
  277. PDTYPE ProtocolDiscriminator;
  278. CRTYPE CallReference;
  279. MESSAGEIDTYPE MessageType;
  280. SHIFTIE Shift;
  281. MOREDATAIE MoreData;
  282. SENDCOMPLIE SendingComplete;
  283. CONGESTIONIE CongestionLevel;
  284. REPEATIE RepeatIndicator;
  285. SEGMENTEDIE SegmentedMessage;
  286. BEARERCAPIE BearerCapability;
  287. CAUSEIE Cause;
  288. CALLIDENTIE CallIdentity;
  289. CALLSTATEIE CallState;
  290. CHANIDENTIE ChannelIdentification;
  291. PROGRESSIE ProgressIndicator;
  292. NETWORKIE NetworkFacilities;
  293. NOTIFICATIONINDIE NotificationIndicator;
  294. DISPLAYIE Display;
  295. DATEIE Date;
  296. KEYPADIE Keypad;
  297. SIGNALIE Signal;
  298. INFORATEIE InformationRate;
  299. ENDTOENDDELAYIE EndToEndTransitDelay;
  300. TRANSITDELAYIE TransitDelay;
  301. PLBINARYPARAMSIE PacketLayerBinaryParams;
  302. PLWINDOWSIZEIE PacketLayerWindowSize;
  303. PACKETSIZEIE PacketSize;
  304. CLOSEDUGIE ClosedUserGroup;
  305. REVERSECHARGEIE ReverseChargeIndication;
  306. CALLINGNUMBERIE CallingPartyNumber;
  307. CALLINGSUBADDRIE CallingPartySubaddress;
  308. CALLEDNUMBERIE CalledPartyNumber;
  309. CALLEDSUBADDRIE CalledPartySubaddress;
  310. REDIRECTINGIE RedirectingNumber;
  311. TRANSITNETIE TransitNetworkSelection;
  312. RESTARTIE RestartIndicator;
  313. LLCOMPATIBILITYIE LowLayerCompatibility;
  314. HLCOMPATIBILITYIE HighLayerCompatibility;
  315. FACILITYIE Facility;
  316. USERUSERIE UserToUser;
  317. };
  318. typedef struct S_MESSAGE Q931MESSAGE;
  319. typedef struct S_MESSAGE *PQ931MESSAGE;
  320. //-------------------------------------------------------------------
  321. // Single routine for parsing Q931 messages
  322. //-------------------------------------------------------------------
  323. HRESULT
  324. Q931ParseMessage(
  325. BYTE *CodedBufferPtr,
  326. DWORD CodedBufferLength,
  327. PQ931MESSAGE Message);
  328. //////////////////////////////////////////////////////////////////////
  329. //////////////////////////////////////////////////////////////////////
  330. //////////////////////////////////////////////////////////////////////
  331. //==========================================================
  332. // CAUSE FIELD DEFINITIONS
  333. //==========================================================
  334. #define CAUSE_EXT_BIT 0x80
  335. #define CAUSE_CODING_CCITT 0x00
  336. #define CAUSE_LOCATION_USER 0x00
  337. #define CAUSE_RECOMMENDATION_Q931 0x00
  338. #define CAUSE_VALUE_NORMAL_CLEAR 0x10
  339. #define CAUSE_VALUE_USER_BUSY 0x11
  340. #define CAUSE_VALUE_SECURITY_DENIED 0x12
  341. #define CAUSE_VALUE_NO_ANSWER 0x13 // Callee does not answer
  342. #define CAUSE_VALUE_REJECTED 0x15
  343. #define CAUSE_VALUE_ENQUIRY_RESPONSE 0x1E
  344. #define CAUSE_VALUE_NOT_IMPLEMENTED 0x4F
  345. #define CAUSE_VALUE_INVALID_CRV 0x51
  346. #define CAUSE_VALUE_INVALID_MSG 0x5F
  347. #define CAUSE_VALUE_IE_MISSING 0x60
  348. #define CAUSE_VALUE_IE_CONTENTS 0x64
  349. #define CAUSE_VALUE_TIMER_EXPIRED 0x66
  350. typedef struct _ERROR_MAP
  351. {
  352. int nErrorCode;
  353. #ifdef UNICODE_TRACE
  354. LPWSTR pszErrorText;
  355. #else
  356. LPSTR pszErrorText;
  357. #endif
  358. } ERROR_MAP;
  359. typedef struct _BINARY_STRING
  360. {
  361. WORD length;
  362. BYTE *ptr;
  363. } BINARY_STRING;
  364. typedef struct _Q931_SETUP_ASN
  365. {
  366. BOOL NonStandardDataPresent;
  367. CC_NONSTANDARDDATA NonStandardData;
  368. PCC_ALIASNAMES pCallerAliasList;
  369. PCC_ALIASNAMES pCalleeAliasList;
  370. PCC_ALIASNAMES pExtraAliasList;
  371. PCC_ALIASITEM pExtensionAliasItem;
  372. BOOL SourceAddrPresent;
  373. BOOL CallerAddrPresent;
  374. BOOL CalleeAddrPresent;
  375. BOOL CalleeDestAddrPresent;
  376. CC_ADDR SourceAddr; // originating addr
  377. CC_ADDR CallerAddr; // gk addr
  378. CC_ADDR CalleeAddr; // local addr
  379. CC_ADDR CalleeDestAddr; // target destination addr
  380. WORD wGoal;
  381. WORD wCallType;
  382. BOOL bCallerIsMC;
  383. CC_CONFERENCEID ConferenceID;
  384. CC_ENDPOINTTYPE EndpointType;
  385. CC_VENDORINFO VendorInfo;
  386. GUID CallIdentifier; // H.225 CallIdentifier
  387. BYTE bufProductValue[CC_MAX_PRODUCT_LENGTH];
  388. BYTE bufVersionValue[CC_MAX_VERSION_LENGTH];
  389. } Q931_SETUP_ASN;
  390. typedef struct _Q931_RELEASE_COMPLETE_ASN
  391. {
  392. BOOL NonStandardDataPresent;
  393. CC_NONSTANDARDDATA NonStandardData;
  394. BYTE bReason;
  395. GUID CallIdentifier; // H.225 CallIdentifier
  396. } Q931_RELEASE_COMPLETE_ASN;
  397. typedef struct _Q931_CONNECT_ASN
  398. {
  399. BOOL NonStandardDataPresent;
  400. CC_NONSTANDARDDATA NonStandardData;
  401. BOOL h245AddrPresent;
  402. CC_ADDR h245Addr;
  403. CC_CONFERENCEID ConferenceID;
  404. CC_ENDPOINTTYPE EndpointType;
  405. CC_VENDORINFO VendorInfo;
  406. GUID CallIdentifier; // H.225 CallIdentifier
  407. BYTE bufProductValue[CC_MAX_PRODUCT_LENGTH];
  408. BYTE bufVersionValue[CC_MAX_VERSION_LENGTH];
  409. } Q931_CONNECT_ASN;
  410. typedef struct _Q931_ALERTING_ASN
  411. {
  412. BOOL NonStandardDataPresent;
  413. CC_NONSTANDARDDATA NonStandardData;
  414. CC_ADDR h245Addr;
  415. GUID CallIdentifier; // H.225 CallIdentifier
  416. } Q931_ALERTING_ASN;
  417. typedef struct _Q931_CALL_PROCEEDING_ASN
  418. {
  419. BOOL NonStandardDataPresent;
  420. CC_NONSTANDARDDATA NonStandardData;
  421. CC_ADDR h245Addr;
  422. GUID CallIdentifier; // H.225 CallIdentifier
  423. } Q931_CALL_PROCEEDING_ASN;
  424. typedef struct _Q931_FACILITY_ASN
  425. {
  426. BOOL NonStandardDataPresent;
  427. CC_NONSTANDARDDATA NonStandardData;
  428. CC_ADDR AlternativeAddr;
  429. PCC_ALIASNAMES pAlternativeAliasList;
  430. CC_CONFERENCEID ConferenceID;
  431. BOOL ConferenceIDPresent;
  432. BYTE bReason;
  433. GUID CallIdentifier; // H.225 CallIdentifier
  434. } Q931_FACILITY_ASN;
  435. //-------------------------------------------------------------------
  436. // Parsing Routines
  437. //-------------------------------------------------------------------
  438. HRESULT
  439. Q931MakeEncodedMessage(
  440. PQ931MESSAGE Message,
  441. BYTE **CodedBufferPtr,
  442. DWORD *CodedBufferLength);
  443. HRESULT
  444. Q931SetupParseASN(
  445. ASN1_CODER_INFO *pWorld,
  446. BYTE *pEncodedBuf,
  447. DWORD dwEncodedLength,
  448. Q931_SETUP_ASN *pParsedData);
  449. HRESULT
  450. Q931ReleaseCompleteParseASN(
  451. ASN1_CODER_INFO *pWorld,
  452. BYTE *pEncodedBuf,
  453. DWORD dwEncodedLength,
  454. Q931_RELEASE_COMPLETE_ASN *pParsedData);
  455. HRESULT
  456. Q931ConnectParseASN(
  457. ASN1_CODER_INFO *pWorld,
  458. BYTE *pEncodedBuf,
  459. DWORD dwEncodedLength,
  460. Q931_CONNECT_ASN *pParsedData);
  461. HRESULT
  462. Q931AlertingParseASN(
  463. ASN1_CODER_INFO *pWorld,
  464. BYTE *pEncodedBuf,
  465. DWORD dwEncodedLength,
  466. Q931_ALERTING_ASN *pParsedData);
  467. HRESULT
  468. Q931ProceedingParseASN(
  469. ASN1_CODER_INFO *pWorld,
  470. BYTE *pEncodedBuf,
  471. DWORD dwEncodedLength,
  472. Q931_CALL_PROCEEDING_ASN *pParsedData);
  473. HRESULT
  474. Q931FacilityParseASN(
  475. ASN1_CODER_INFO *pWorld,
  476. BYTE *pEncodedBuf,
  477. DWORD dwEncodedLength,
  478. Q931_FACILITY_ASN *pParsedData);
  479. //-------------------------------------------------------------------
  480. // Encoding Routines
  481. //-------------------------------------------------------------------
  482. // routines for the Setup Message:
  483. HRESULT
  484. Q931SetupEncodePDU(
  485. WORD wCallReference,
  486. char *pszDisplay,
  487. char *pszCalledPartyNumber,
  488. BINARY_STRING *pUserUserData,
  489. BYTE **CodedBufferPtr,
  490. DWORD *CodedBufferLength);
  491. HRESULT
  492. Q931SetupEncodeASN(
  493. PCC_NONSTANDARDDATA pNonStandardData,
  494. CC_ADDR *pCallerAddr,
  495. CC_ADDR *pCalleeAddr,
  496. WORD wGoal,
  497. WORD wCallType,
  498. BOOL bCallerIsMC,
  499. CC_CONFERENCEID *pConferenceID,
  500. PCC_ALIASNAMES pCallerAliasList,
  501. PCC_ALIASNAMES pCalleeAliasList,
  502. PCC_ALIASNAMES pExtraAliasList,
  503. PCC_ALIASITEM pExtensionAliasItem,
  504. PCC_VENDORINFO pVendorInfo,
  505. BOOL bIsTerminal,
  506. BOOL bIsGateway,
  507. ASN1_CODER_INFO *pWorld,
  508. BYTE **ppEncodedBuf,
  509. DWORD *pdwEncodedLength,
  510. LPGUID pCallIdentifier);
  511. // routines for the Release Complete Message:
  512. HRESULT
  513. Q931ReleaseCompleteEncodePDU(
  514. WORD wCallReference,
  515. BYTE *pbCause,
  516. BINARY_STRING *pUserUserData,
  517. BYTE **CodedBufferPtr,
  518. DWORD *CodedBufferLength);
  519. HRESULT
  520. Q931ReleaseCompleteEncodeASN(
  521. PCC_NONSTANDARDDATA pNonStandardData,
  522. CC_CONFERENCEID *pConferenceID, // must be able to support 16 byte conf id's!
  523. BYTE *pbReason,
  524. ASN1_CODER_INFO *pWorld,
  525. BYTE **ppEncodedBuf,
  526. DWORD *pdwEncodedLength,
  527. LPGUID pCallIdentifier);
  528. // routines for the Connect Message:
  529. HRESULT
  530. Q931ConnectEncodePDU(
  531. WORD wCallReference,
  532. char *pszDisplay,
  533. BINARY_STRING *pUserUserData,
  534. BYTE **CodedBufferPtr,
  535. DWORD *CodedBufferLength);
  536. HRESULT
  537. Q931ConnectEncodeASN(
  538. PCC_NONSTANDARDDATA pNonStandardData,
  539. CC_CONFERENCEID *pConferenceID, // must be able to support 16 byte conf id's!
  540. CC_ADDR *h245Addr,
  541. PCC_ENDPOINTTYPE pEndpointType,
  542. ASN1_CODER_INFO *pWorld,
  543. BYTE **ppEncodedBuf,
  544. DWORD *pdwEncodedLength,
  545. LPGUID pCallIdentifier);
  546. // routines for the Alerting Message:
  547. HRESULT
  548. Q931AlertingEncodePDU(
  549. WORD wCallReference,
  550. BINARY_STRING *pUserUserData,
  551. BYTE **CodedBufferPtr,
  552. DWORD *CodedBufferLength);
  553. HRESULT
  554. Q931AlertingEncodeASN(
  555. PCC_NONSTANDARDDATA pNonStandardData,
  556. CC_ADDR *h245Addr,
  557. PCC_ENDPOINTTYPE pEndpointType,
  558. ASN1_CODER_INFO *pWorld,
  559. BYTE **ppEncodedBuf,
  560. DWORD *pdwEncodedLength,
  561. LPGUID pCallIdentifier);
  562. // routines for the Proceeding Message:
  563. HRESULT
  564. Q931ProceedingEncodePDU(
  565. WORD wCallReference,
  566. BINARY_STRING *pUserUserData,
  567. BYTE **CodedBufferPtr,
  568. DWORD *CodedBufferLength);
  569. HRESULT
  570. Q931ProceedingEncodeASN(
  571. PCC_NONSTANDARDDATA pNonStandardData,
  572. CC_ADDR *h245Addr,
  573. PCC_ENDPOINTTYPE pEndpointType,
  574. ASN1_CODER_INFO *pWorld,
  575. BYTE **ppEncodedBuf,
  576. DWORD *pdwEncodedLength,
  577. LPGUID pCallIdentifier);
  578. HRESULT
  579. Q931FacilityEncodePDU(
  580. WORD wCallReference,
  581. BINARY_STRING *pUserUserData,
  582. BYTE **CodedBufferPtr,
  583. DWORD *CodedBufferLength);
  584. HRESULT
  585. Q931FacilityEncodeASN(
  586. PCC_NONSTANDARDDATA pNonStandardData,
  587. CC_ADDR *AlternativeAddr,
  588. BYTE bReason,
  589. CC_CONFERENCEID *pConferenceID,
  590. PCC_ALIASNAMES pAlternativeAliasList,
  591. ASN1_CODER_INFO *pWorld,
  592. BYTE **ppEncodedBuf,
  593. DWORD *pdwEncodedLength,
  594. LPGUID pCallIdentifier);
  595. HRESULT
  596. Q931StatusEncodePDU(
  597. WORD wCallReference,
  598. char *pszDisplay,
  599. BYTE bCause,
  600. BYTE bCallState,
  601. BYTE **CodedBufferPtr,
  602. DWORD *CodedBufferLength);
  603. void
  604. Q931FreeEncodedBuffer(ASN1_CODER_INFO *pWorld, BYTE *pEncodedBuf);
  605. #ifdef __cplusplus
  606. }
  607. #endif
  608. #endif Q931PAR_H