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.

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