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.

719 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.2.0 $
  14. * $Date: 20 Jun 1997 14:11:14 $
  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 HOLDMESSAGETYPE 0x24
  270. #define HOLDACKMESSAGETYPE 0x28
  271. #define HOLDREJECTMESSAGETYPE 0x30
  272. #define RETRIEVEMESSAGETYPE 0x31
  273. #define RETRIEVEACKMESSAGETYPE 0x33
  274. #define RETRIEVEREJECTMESSAGETYPE 0x37
  275. #define FACILITYMESSAGETYPE 0x62
  276. #define REGISTERMESSAGETYPE 0x64
  277. #define IDENT_FACILITY 0x1C
  278. typedef struct S_VARSTRUCT FACILITYIE;
  279. typedef struct S_VARSTRUCT *PFACILITYIE;
  280. // Generic structure for a Q.931 message
  281. struct S_MESSAGE
  282. {
  283. PDTYPE ProtocolDiscriminator;
  284. CRTYPE CallReference;
  285. MESSAGEIDTYPE MessageType;
  286. SHIFTIE Shift;
  287. MOREDATAIE MoreData;
  288. SENDCOMPLIE SendingComplete;
  289. CONGESTIONIE CongestionLevel;
  290. REPEATIE RepeatIndicator;
  291. SEGMENTEDIE SegmentedMessage;
  292. BEARERCAPIE BearerCapability;
  293. CAUSEIE Cause;
  294. CALLIDENTIE CallIdentity;
  295. CALLSTATEIE CallState;
  296. CHANIDENTIE ChannelIdentification;
  297. PROGRESSIE ProgressIndicator;
  298. NETWORKIE NetworkFacilities;
  299. NOTIFICATIONINDIE NotificationIndicator;
  300. DISPLAYIE Display;
  301. DATEIE Date;
  302. KEYPADIE Keypad;
  303. SIGNALIE Signal;
  304. INFORATEIE InformationRate;
  305. ENDTOENDDELAYIE EndToEndTransitDelay;
  306. TRANSITDELAYIE TransitDelay;
  307. PLBINARYPARAMSIE PacketLayerBinaryParams;
  308. PLWINDOWSIZEIE PacketLayerWindowSize;
  309. PACKETSIZEIE PacketSize;
  310. CLOSEDUGIE ClosedUserGroup;
  311. REVERSECHARGEIE ReverseChargeIndication;
  312. CALLINGNUMBERIE CallingPartyNumber;
  313. CALLINGSUBADDRIE CallingPartySubaddress;
  314. CALLEDNUMBERIE CalledPartyNumber;
  315. CALLEDSUBADDRIE CalledPartySubaddress;
  316. REDIRECTINGIE RedirectingNumber;
  317. TRANSITNETIE TransitNetworkSelection;
  318. RESTARTIE RestartIndicator;
  319. LLCOMPATIBILITYIE LowLayerCompatibility;
  320. HLCOMPATIBILITYIE HighLayerCompatibility;
  321. FACILITYIE Facility;
  322. USERUSERIE UserToUser;
  323. };
  324. typedef struct S_MESSAGE Q931MESSAGE;
  325. typedef struct S_MESSAGE *PQ931MESSAGE;
  326. //-------------------------------------------------------------------
  327. // Single routine for parsing Q931 messages
  328. //-------------------------------------------------------------------
  329. HRESULT
  330. Q931ParseMessage(
  331. BYTE *CodedBufferPtr,
  332. DWORD CodedBufferLength,
  333. PQ931MESSAGE Message);
  334. //////////////////////////////////////////////////////////////////////
  335. //////////////////////////////////////////////////////////////////////
  336. //////////////////////////////////////////////////////////////////////
  337. //==========================================================
  338. // CAUSE FIELD DEFINITIONS
  339. //==========================================================
  340. #define CAUSE_EXT_BIT 0x80
  341. #define CAUSE_CODING_CCITT 0x00
  342. #define CAUSE_LOCATION_USER 0x00
  343. #define CAUSE_RECOMMENDATION_Q931 0x00
  344. #define CAUSE_VALUE_NORMAL_CLEAR 0x10
  345. #define CAUSE_VALUE_USER_BUSY 0x11
  346. #define CAUSE_VALUE_NO_ANSWER 0x13 // Callee does not answer
  347. #define CAUSE_VALUE_REJECTED 0x15
  348. #define CAUSE_VALUE_ENQUIRY_RESPONSE 0x1E
  349. #define CAUSE_VALUE_NOT_IMPLEMENTED 0x4F
  350. #define CAUSE_VALUE_INVALID_CRV 0x51
  351. #define CAUSE_VALUE_INVALID_MSG 0x5F
  352. #define CAUSE_VALUE_IE_MISSING 0x60
  353. #define CAUSE_VALUE_IE_CONTENTS 0x64
  354. #define CAUSE_VALUE_TIMER_EXPIRED 0x66
  355. typedef struct _ERROR_MAP
  356. {
  357. int nErrorCode;
  358. #ifdef UNICODE_TRACE
  359. LPWSTR pszErrorText;
  360. #else
  361. LPSTR pszErrorText;
  362. #endif
  363. } ERROR_MAP;
  364. typedef struct _BINARY_STRING
  365. {
  366. WORD length;
  367. BYTE *ptr;
  368. } BINARY_STRING;
  369. typedef struct _Q931_SETUP_ASN
  370. {
  371. BOOL NonStandardDataPresent;
  372. CC_NONSTANDARDDATA NonStandardData;
  373. PCC_ALIASNAMES pCallerAliasList;
  374. PCC_ALIASNAMES pCalleeAliasList;
  375. PCC_ALIASNAMES pExtraAliasList;
  376. PCC_ALIASITEM pExtensionAliasItem;
  377. BOOL SourceAddrPresent;
  378. BOOL CallerAddrPresent;
  379. BOOL CalleeAddrPresent;
  380. BOOL CalleeDestAddrPresent;
  381. CC_ADDR SourceAddr; // originating addr
  382. CC_ADDR CallerAddr; // gk addr
  383. CC_ADDR CalleeAddr; // local addr
  384. CC_ADDR CalleeDestAddr; // target destination addr
  385. WORD wGoal;
  386. WORD wCallType;
  387. BOOL bCallerIsMC;
  388. CC_CONFERENCEID ConferenceID;
  389. CC_ENDPOINTTYPE EndpointType;
  390. CC_VENDORINFO VendorInfo;
  391. BYTE bufProductValue[CC_MAX_PRODUCT_LENGTH];
  392. BYTE bufVersionValue[CC_MAX_VERSION_LENGTH];
  393. } Q931_SETUP_ASN;
  394. typedef struct _Q931_RELEASE_COMPLETE_ASN
  395. {
  396. BOOL NonStandardDataPresent;
  397. CC_NONSTANDARDDATA NonStandardData;
  398. BYTE bReason;
  399. } Q931_RELEASE_COMPLETE_ASN;
  400. typedef struct _Q931_CONNECT_ASN
  401. {
  402. BOOL NonStandardDataPresent;
  403. CC_NONSTANDARDDATA NonStandardData;
  404. BOOL h245AddrPresent;
  405. CC_ADDR h245Addr;
  406. CC_CONFERENCEID ConferenceID;
  407. CC_ENDPOINTTYPE EndpointType;
  408. CC_VENDORINFO VendorInfo;
  409. BYTE bufProductValue[CC_MAX_PRODUCT_LENGTH];
  410. BYTE bufVersionValue[CC_MAX_VERSION_LENGTH];
  411. } Q931_CONNECT_ASN;
  412. typedef struct _Q931_ALERTING_ASN
  413. {
  414. BOOL NonStandardDataPresent;
  415. CC_NONSTANDARDDATA NonStandardData;
  416. CC_ADDR h245Addr;
  417. } Q931_ALERTING_ASN;
  418. typedef struct _Q931_CALL_PROCEEDING_ASN
  419. {
  420. BOOL NonStandardDataPresent;
  421. CC_NONSTANDARDDATA NonStandardData;
  422. CC_ADDR h245Addr;
  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. } Q931_FACILITY_ASN;
  434. //-------------------------------------------------------------------
  435. // Initialization Routines
  436. //-------------------------------------------------------------------
  437. HRESULT Q931InitPER();
  438. HRESULT Q931DeInitPER();
  439. //-------------------------------------------------------------------
  440. // Parsing Routines
  441. //-------------------------------------------------------------------
  442. HRESULT
  443. Q931MakeEncodedMessage(
  444. PQ931MESSAGE Message,
  445. BYTE **CodedBufferPtr,
  446. DWORD *CodedBufferLength);
  447. HRESULT
  448. Q931SetupParseASN(
  449. ASN1_CODER_INFO *pWorld,
  450. BYTE *pEncodedBuf,
  451. DWORD dwEncodedLength,
  452. Q931_SETUP_ASN *pParsedData);
  453. HRESULT
  454. Q931ReleaseCompleteParseASN(
  455. ASN1_CODER_INFO *pWorld,
  456. BYTE *pEncodedBuf,
  457. DWORD dwEncodedLength,
  458. Q931_RELEASE_COMPLETE_ASN *pParsedData);
  459. HRESULT
  460. Q931ConnectParseASN(
  461. ASN1_CODER_INFO *pWorld,
  462. BYTE *pEncodedBuf,
  463. DWORD dwEncodedLength,
  464. Q931_CONNECT_ASN *pParsedData);
  465. HRESULT
  466. Q931AlertingParseASN(
  467. ASN1_CODER_INFO *pWorld,
  468. BYTE *pEncodedBuf,
  469. DWORD dwEncodedLength,
  470. Q931_ALERTING_ASN *pParsedData);
  471. HRESULT
  472. Q931ProceedingParseASN(
  473. ASN1_CODER_INFO *pWorld,
  474. BYTE *pEncodedBuf,
  475. DWORD dwEncodedLength,
  476. Q931_CALL_PROCEEDING_ASN *pParsedData);
  477. HRESULT
  478. Q931FacilityParseASN(
  479. ASN1_CODER_INFO *pWorld,
  480. BYTE *pEncodedBuf,
  481. DWORD dwEncodedLength,
  482. Q931_FACILITY_ASN *pParsedData);
  483. //-------------------------------------------------------------------
  484. // Encoding Routines
  485. //-------------------------------------------------------------------
  486. // routines for the Setup Message:
  487. HRESULT
  488. Q931SetupEncodePDU(
  489. WORD wCallReference,
  490. char *pszDisplay,
  491. char *pszCalledPartyNumber,
  492. DWORD dwBandwidth,
  493. BINARY_STRING *pUserUserData,
  494. BYTE **CodedBufferPtr,
  495. DWORD *CodedBufferLength);
  496. HRESULT
  497. Q931SetupEncodeASN(
  498. PCC_NONSTANDARDDATA pNonStandardData,
  499. CC_ADDR *pCallerAddr,
  500. CC_ADDR *pCalleeAddr,
  501. WORD wGoal,
  502. WORD wCallType,
  503. BOOL bCallerIsMC,
  504. CC_CONFERENCEID *pConferenceID,
  505. PCC_ALIASNAMES pCallerAliasList,
  506. PCC_ALIASNAMES pCalleeAliasList,
  507. PCC_ALIASNAMES pExtraAliasList,
  508. PCC_ALIASITEM pExtensionAliasItem,
  509. PCC_VENDORINFO pVendorInfo,
  510. BOOL bIsTerminal,
  511. BOOL bIsGateway,
  512. ASN1_CODER_INFO *pWorld,
  513. BYTE **ppEncodedBuf,
  514. DWORD *pdwEncodedLength);
  515. // routines for the Release Complete Message:
  516. HRESULT
  517. Q931ReleaseCompleteEncodePDU(
  518. WORD wCallReference,
  519. BYTE *pbCause,
  520. BINARY_STRING *pUserUserData,
  521. BYTE **CodedBufferPtr,
  522. DWORD *CodedBufferLength);
  523. HRESULT
  524. Q931ReleaseCompleteEncodeASN(
  525. PCC_NONSTANDARDDATA pNonStandardData,
  526. CC_CONFERENCEID *pConferenceID, // must be able to support 16 byte conf id's!
  527. BYTE *pbReason,
  528. ASN1_CODER_INFO *pWorld,
  529. BYTE **ppEncodedBuf,
  530. DWORD *pdwEncodedLength);
  531. // routines for the Connect Message:
  532. HRESULT
  533. Q931ConnectEncodePDU(
  534. WORD wCallReference,
  535. char *pszDisplay,
  536. DWORD dwBandwidth,
  537. BINARY_STRING *pUserUserData,
  538. BYTE **CodedBufferPtr,
  539. DWORD *CodedBufferLength);
  540. HRESULT
  541. Q931ConnectEncodeASN(
  542. PCC_NONSTANDARDDATA pNonStandardData,
  543. CC_CONFERENCEID *pConferenceID, // must be able to support 16 byte conf id's!
  544. CC_ADDR *h245Addr,
  545. PCC_ENDPOINTTYPE pEndpointType,
  546. ASN1_CODER_INFO *pWorld,
  547. BYTE **ppEncodedBuf,
  548. DWORD *pdwEncodedLength);
  549. // routines for the Alerting Message:
  550. HRESULT
  551. Q931AlertingEncodePDU(
  552. WORD wCallReference,
  553. BINARY_STRING *pUserUserData,
  554. BYTE **CodedBufferPtr,
  555. DWORD *CodedBufferLength);
  556. HRESULT
  557. Q931AlertingEncodeASN(
  558. PCC_NONSTANDARDDATA pNonStandardData,
  559. CC_ADDR *h245Addr,
  560. PCC_ENDPOINTTYPE pEndpointType,
  561. ASN1_CODER_INFO *pWorld,
  562. BYTE **ppEncodedBuf,
  563. DWORD *pdwEncodedLength);
  564. // routines for the Proceeding Message:
  565. HRESULT
  566. Q931ProceedingEncodePDU(
  567. WORD wCallReference,
  568. BINARY_STRING *pUserUserData,
  569. BYTE **CodedBufferPtr,
  570. DWORD *CodedBufferLength);
  571. HRESULT
  572. Q931ProceedingEncodeASN(
  573. PCC_NONSTANDARDDATA pNonStandardData,
  574. CC_ADDR *h245Addr,
  575. PCC_ENDPOINTTYPE pEndpointType,
  576. ASN1_CODER_INFO *pWorld,
  577. BYTE **ppEncodedBuf,
  578. DWORD *pdwEncodedLength);
  579. HRESULT
  580. Q931FacilityEncodePDU(
  581. WORD wCallReference,
  582. BINARY_STRING *pUserUserData,
  583. BYTE **CodedBufferPtr,
  584. DWORD *CodedBufferLength);
  585. HRESULT
  586. Q931FacilityEncodeASN(
  587. PCC_NONSTANDARDDATA pNonStandardData,
  588. CC_ADDR *AlternativeAddr,
  589. BYTE bReason,
  590. CC_CONFERENCEID *pConferenceID,
  591. PCC_ALIASNAMES pAlternativeAliasList,
  592. ASN1_CODER_INFO *pWorld,
  593. BYTE **ppEncodedBuf,
  594. DWORD *pdwEncodedLength);
  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