extractSuppSvcs.h
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:7k
源码类别:

IP电话/视频会议

开发平台:

WINDOWS

  1. /*
  2.  * $Revision: 1.2 $
  3.  * $Date: 1998/12/21 16:50:13 $
  4.  */
  5. #ifndef INCLUDED_EXTRACTSUPPSVCS_H
  6. #define INCLUDED_EXTRACTSUPPSVCS_H
  7. #define MAX_ROS 4
  8. #define MAXOUTSTR 40
  9. #define MAXSTRLEN(len) ((len < (MAXOUTSTR-1)) ? len : (MAXOUTSTR-1))
  10. #define MAXBUF 512
  11. // Prototypes
  12. char *sprint_sockaddr(sockaddr *addr, char *str);
  13. char *sprint_string(unsigned char *ustr, int len, char *retstr);
  14. struct extractedFacilityExt {
  15. int isSet;
  16. int SrcEntity;
  17. int DstEntity;
  18. H450AliasAddress *SrcAliasAddr; // delete SrcAliasAddr
  19. H450AliasAddress *DstAliasAddr; // delete DstAliasAddr
  20. };
  21. struct extractedError {
  22. int type; // See H450ErrorType
  23. int error; // See H450ErrorList
  24. int code; // local only
  25. };
  26. struct extractedArg {
  27. int type; // See H450ArgumentType
  28. // Extension Sequence
  29. int NumExtension;
  30. H4501Extension *Extension; // delete [] Extension
  31. // Non Standard Parameter
  32. H450NonStdParam *NonStdParam; // delete NonStdParam
  33. // Endpoint Address
  34. H4501EndpointAddr *EndpointAddr; // delete EndpointAddr
  35. // Call Identifier
  36. char CallID[5];
  37. // redirectionInfo/connectedInfo
  38. int lenInfo;
  39. unsigned short *pInfo;
  40. // Basic Call Info Elements
  41. H4501H225IE *H225IE; // delete H225IE
  42. // Subaddress Transfer
  43. H4501PartySubaddress *PartySubaddress; // delete PartySubaddress
  44. // End Designation
  45. int EndType; // See H4502EndType
  46. // Call Status
  47. int CallStatus; // See H4502CallStatusType
  48. };
  49. struct extractedRes {
  50. int type; // See H450ResultType
  51. // Extension Sequence
  52. int NumExtension;
  53. H4501Extension *Extension; // delete [] Extension
  54. // Non Standard Parameter
  55. H450NonStdParam *NonStdParam; // delete NonStdParam
  56. // Endpoint Address
  57. H4501EndpointAddr *EndpointAddr; // delete EndpointAddr
  58. // Call Identifier
  59. char CallID[5];
  60. };
  61. struct extractedProblem {
  62. int type; // See H4501ProblemType
  63. // See H4501GeneralProblem
  64. //     H4501InvokeProblem
  65. //     H4501ReturnResultProblem
  66. //     H4501ReturnErrorProblem
  67. //     H4501RejectProblem
  68. int Problem;
  69. };
  70. struct extractedROS {
  71. int type;
  72. int InvokeId;
  73. int code; // local only
  74. struct extractedError error;
  75. struct extractedArg Arg;
  76. struct extractedRes Res;
  77. struct extractedProblem Problem;
  78. int LinkedId;
  79. };
  80. class extractedSS
  81. {
  82. public:
  83. struct extractedFacilityExt ssFacilityExt;
  84. int ssInterpAPDU;
  85. int ssNumROSs;
  86. int *ssROSTypes;
  87. struct extractedROS ssROS[MAX_ROS];
  88. extractedSS() {
  89. initExtractedSS();
  90. };
  91. ~extractedSS() {
  92. for(int i = 0; i < ssNumROSs; i++) {
  93. delete [] ssROS[i].Arg.Extension;
  94. delete ssROS[i].Arg.NonStdParam;
  95. delete ssROS[i].Arg.EndpointAddr;
  96. delete ssROS[i].Arg.H225IE;
  97. delete ssROS[i].Arg.PartySubaddress;
  98. delete [] ssROS[i].Res.Extension;
  99. delete ssROS[i].Res.NonStdParam;
  100. delete ssROS[i].Res.EndpointAddr;
  101. }
  102. delete ssFacilityExt.SrcAliasAddr;
  103. delete ssFacilityExt.DstAliasAddr;
  104. delete [] ssROSTypes;
  105. };
  106. void initExtractedSS() {
  107. ssFacilityExt.isSet = FALSE;
  108. ssFacilityExt.SrcEntity = ENTT_INVALID;
  109. ssFacilityExt.DstEntity = ENTT_INVALID;
  110. ssFacilityExt.SrcAliasAddr = NULL;
  111. ssFacilityExt.DstAliasAddr = NULL;
  112. ssInterpAPDU = IAPDU_INVALID;
  113. ssNumROSs = 0;
  114. ssROSTypes = NULL;
  115. for(int i = 0; i < MAX_ROS; i++) {
  116. ssROS[i].type = ROS_INVALID;
  117. ssROS[i].InvokeId = -1;
  118. ssROS[i].code = CTOT_INVALID;
  119. ssROS[i].error.type = ERRT_INVALID;
  120. ssROS[i].error.error = -1;
  121. ssROS[i].error.code = -1;
  122. ssROS[i].Arg.type = ARGT_INVALID;
  123. ssROS[i].Arg.NumExtension = 0;
  124. ssROS[i].Arg.Extension = NULL;
  125. ssROS[i].Arg.NonStdParam = NULL;
  126. ssROS[i].Arg.EndpointAddr = NULL;
  127. ssROS[i].Arg.CallID[0] = '';
  128. ssROS[i].Arg.lenInfo = 0;
  129. ssROS[i].Arg.pInfo = NULL;
  130. ssROS[i].Arg.H225IE = NULL;
  131. ssROS[i].Arg.PartySubaddress = NULL;
  132. ssROS[i].Arg.EndType = ETP_INVALID;
  133. ssROS[i].Arg.CallStatus = CST_INVALID;
  134. ssROS[i].Res.type = REST_INVALID;
  135. ssROS[i].Res.NumExtension = 0;
  136. ssROS[i].Res.Extension = NULL;
  137. ssROS[i].Res.NonStdParam = NULL;
  138. ssROS[i].Res.EndpointAddr = NULL;
  139. ssROS[i].Res.CallID[0] = '';
  140. ssROS[i].Problem.type = PROB_INVALID;
  141. ssROS[i].Problem.Problem = GPROB_INVALID;
  142. ssROS[i].LinkedId = 0;
  143. }
  144. };
  145. // Methods
  146. boolean tH4501SuppService(H4501SuppService *pSuppService);
  147. private:
  148. int *pssCode;
  149. struct extractedROS *pssROS;
  150. struct extractedError *pssError;
  151. struct extractedArg *pssArg;
  152. struct extractedRes *pssRes;
  153. struct extractedProblem *pssProblem;
  154. struct extractedFacilityExt *pssFac;
  155. boolean tItemExt(void *pItemExt, int derivedclass, int indent);
  156. boolean tItemCallId(void *pItemCallId, int derivedclass, int indent);
  157. boolean tItemNumber(void *pItemNumber, int derivedclass, int indent);
  158. boolean tItemInfo(void *pItemInfo, int derivedclass, int indent);
  159. boolean tItemElements(void *pItemElements, int derivedclass, int indent);
  160. boolean tH4501FacilityExt(H4501FacilityExt *pFacilityExt, int indent);
  161. boolean tH4501Invoke(H4501Invoke *pInvoke, int indent);
  162. boolean tH4501ReturnResult(H4501ReturnResult *pReturnResult, int indent);
  163. boolean tH4501ReturnError(H4501ReturnError *pReturnError, int indent);
  164. boolean tH4501Reject(H4501Reject *pReject, int indent);
  165. boolean tH450Arg(void *pArg, int argtype, int indent);
  166. boolean tH450Res(void *pRes, int restype, int indent);
  167. boolean tH4502DummyRes(H4502DummyRes *pDummyRes, int indent);
  168. boolean tH4502CTIdentifyRes(H4502CTIdentifyRes *pCTIdentifyRes, int indent);
  169. boolean tH4502DummyArg(H4502DummyArg *pDummyArg, int indent);
  170. boolean tH4502CTInitiateArg(H4502CTInitiateArg *pCTInitiateArg, int indent);
  171. boolean tH4502CTSetupArg(H4502CTSetupArg *pCTSetupArg, int indent);
  172. boolean tH4502CTUpdateArg(H4502CTUpdateArg *pCTUpdateArg, int indent);
  173. boolean tH4502CTSubaddressArg(H4502CTSubaddressArg *pCTSubaddressArg, int indent);
  174. boolean tH4502CTCompleteArg(H4502CTCompleteArg *pCTCompleteArg, int indent);
  175. boolean tH4502CTActiveArg(H4502CTActiveArg *pCTActiveArg, int indent);
  176. boolean tH4501Extension(H4501Extension *pExtension, int indent);
  177. boolean tH4501Code(H4501Code *pCode, int indent);
  178. boolean tH450ErrorParameter(void *pErrorParameter, int paramtype, int indent);
  179. boolean tH4502UnspecifiedParam(H4502UnspecifiedParam *pUnspecifiedParam, int indent);
  180. boolean tH450Error(H450Error *pError, int indent);
  181. boolean tH4501Problem(H4501Problem *pProblem, int indent);
  182. boolean tH4501H225IE(H4501H225IE *pH225IE, int indent);
  183. boolean tH4501UserSubaddress(H4501UserSubaddress *pUserSubaddress, int indent);
  184. boolean tH4501PartySubaddress(H4501PartySubaddress *pPartySubaddress, int indent);
  185. boolean tH4501EndpointAddr(H4501EndpointAddr *pEndpointAddr, int indent);
  186. boolean tH450NonStdParam(H450NonStdParam *pNonStdParam, int indent);
  187. boolean tH450AliasAddress(H450AliasAddress *pAliasAddress, int indent);
  188. };
  189. void test_extractedSS(extractedSS *extSS, int count);
  190. #endif // INCLUDED_EXTRACTSUPPSVCS_H