/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/pkg/ToneDetPkg/ToneParamTl.java

http://mobicents.googlecode.com/ · Java · 102 lines · 31 code · 13 blank · 58 comment · 0 complexity · 6977780edbd7ae7863f667a439204111 MD5 · raw file

  1. package javax.megaco.pkg.ToneDetPkg;
  2. import javax.megaco.message.DescriptorType;
  3. import javax.megaco.pkg.ParamValueType;
  4. import javax.megaco.pkg.PkgConsts;
  5. import javax.megaco.pkg.PkgItemParam;
  6. /**
  7. * The MEGACO parameter class for the Tonelist Parameter is associated with
  8. * Start Tone Detect, Long Tone Detect and End Tone Detect event of Network
  9. * Package. This class defines all the static information for this parameter.
  10. */
  11. public class ToneParamTl extends PkgItemParam {
  12. /**
  13. * Identifies Duration parameter of the MEGACO Tone Detect Package. Its
  14. * value shall be set equal to 0x0001.
  15. */
  16. public static final int TONE_DET_PARAM_TL = 0x0001;
  17. protected int[] paramsItemIds = null;
  18. /**
  19. * Constructs a Tone package parameter class that specifies the parameter as
  20. * tone list.
  21. */
  22. public ToneParamTl() {
  23. super();
  24. super.paramId = TONE_DET_PARAM_TL;
  25. super.itemValueType = ParamValueType.M_STRING;
  26. super.paramsDescriptorIds = new int[] { DescriptorType.M_EVENT_DESC };
  27. this.paramsItemIds = new int[] { ToneStdEvent.TONE_DET_STD_EVENT, ToneEtdEvent.TONE_DET_ETD_EVENT, ToneLtdEvent.TONE_DET_LTD_EVENT };
  28. }
  29. /**
  30. * The method can be used to get the parameter identifier as defined in the
  31. * MEGACO packages. The implementation of this method in this class returns
  32. * Id of Tone List parameter.
  33. *
  34. * @return paramId - Returns param id as {@link TONE_DET_PARAM_TL}.
  35. */
  36. public int getParamId() {
  37. return super.paramId;
  38. }
  39. /**
  40. * The method can be used to get the type of the parameter as defined in the
  41. * MEGACO packages. These could be one of string or enumerated value or
  42. * integer or double value or boolean.
  43. *
  44. * @return It returns {@link ParamValueType.M_STRING}
  45. * indicating that the parameter is a string.
  46. */
  47. public int getParamValueType() {
  48. return super.itemValueType;
  49. }
  50. /**
  51. * The method can be used to get the item ids corresponding to the
  52. * parameters to which the parameter can be set. This method specifies the
  53. * valid item (event/signal) ids to which the parameter can belong to.
  54. *
  55. * @return The integer values corresponding to start tone detected, end tone
  56. * detected and long tone detected. Thus this shall return a vector
  57. * containing the elements {@link ToneStdEvent.TONE_DET_STD_EVENT},
  58. * {@link AnalogLineSOnEvt.TONE_DET_ETD_EVENT} and
  59. * {@link ToneLtdEvent.TONE_DET_LTD_EVENT}.
  60. */
  61. public int[] getParamsItemIds() {
  62. return this.paramsItemIds;
  63. }
  64. /**
  65. * The method can be used to get the package id corresponding to the to
  66. * which the parameter can be set. This method specifies the package for
  67. * which the parameter is valid. Even though the parameter may be set for an
  68. * item, but the parameter may not be valid for package to which the item
  69. * belongs, but may be valid for a package which has extended this package.
  70. *
  71. * @return This shall return {@link PkgConsts.TONE_DET_PACKAGE} as the
  72. * integer value. The integer values are defined in
  73. * {@link PkgConsts}.
  74. */
  75. public int getParamsPkgId() {
  76. return PkgConsts.TONE_GEN_PACKAGE;
  77. }
  78. /**
  79. * The method can be used to get the descriptor ids corresponding to the
  80. * parameters to which the parameter can be set.
  81. *
  82. * @return This parameter can be present in Signal descriptor. It shall thus
  83. * return a value {@link DescriptorType.M_EVENT_DESC} as a part of
  84. * integer vector.
  85. */
  86. public int[] getParamsDescriptorIds() {
  87. return super.paramsDescriptorIds;
  88. }
  89. }