extensions.ael 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. context dialextens
  2. {
  3. /*
  4. 101 thru 123, 149 thru 152
  5. */
  6. _10X => Dial(Zap/${EXTEN:2},30,tw);
  7. _1ZX => Dial(Zap/${EXTEN:1},30,tw);
  8. }
  9. /*
  10. Due to extenal wiring:
  11. dialing 125 will ring 101
  12. dialing 126 will ring 102
  13. and so on until
  14. dialing 147 will ring 123
  15. We can dial out on zap 69 thru 72; and 25-47
  16. */
  17. context dialthrus
  18. {
  19. /* 369-372; 325-347 */
  20. _3XX => Dial(Zap/${EXTEN:1},30,tw);
  21. }
  22. context t1incoming
  23. {
  24. includes
  25. {
  26. dialextens;
  27. parkedcalls;
  28. }
  29. s => {
  30. Answer();
  31. Background(welcome-to-test-machine);
  32. }
  33. }
  34. context t1extension
  35. {
  36. includes
  37. {
  38. dialextens;
  39. dialthrus;
  40. }
  41. }
  42. context incoming
  43. {
  44. includes
  45. {
  46. dialextens;
  47. parkedcalls;
  48. }
  49. s => {
  50. Answer();
  51. Background(welcome-to-test-machine);
  52. }
  53. }
  54. context extension
  55. {
  56. includes
  57. {
  58. dialextens;
  59. dialthrus;
  60. }
  61. 5 => {
  62. Record(recording:gsm);
  63. Background(recording);
  64. }
  65. 81 => {
  66. iterations=1000000;
  67. Set(time1=${EPOCH});
  68. for(i=1; ${i}<${iterations}; i=${i}+1)
  69. {
  70. NoOp(Hello);
  71. }
  72. Set(time2=${EPOCH});
  73. Verbose(The time diff is $[${time2} - ${time1} ] seconds);
  74. Verbose(Which means that the priorities/sec = $[4* ${iterations} / (${time2} - ${time1}) ]);
  75. SayNumber($[4 * ${iterations} / (${time2} - ${time1}) ]);
  76. }
  77. 82 => {
  78. &ndeep(100000);
  79. Verbose(Finished 100000 levels deep call!);
  80. }
  81. 83 => {
  82. switch (${EXTEN})
  83. {
  84. pattern 8X:
  85. Verbose(do something to prepare it);
  86. pattern 9X:
  87. Verbose(handle both 8x and 9x calls);
  88. pattern [4-7]X:
  89. Verbose(and this too!);
  90. }
  91. }
  92. }
  93. macro ndeep(level)
  94. {
  95. if( ${level} == 0)
  96. {
  97. Verbose(2|Got to Level 0);
  98. return;
  99. }
  100. &ndeep($[${level}-1]);
  101. return;
  102. }