ref.ael-vtest17 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [dialextens]
  2. exten => _10X,1,Dial(Zap/${EXTEN:2},30,tw)
  3. exten => _1ZX,1,Dial(Zap/${EXTEN:1},30,tw)
  4. [dialthrus]
  5. exten => _3XX,1,Dial(Zap/${EXTEN:1},30,tw)
  6. [t1incoming]
  7. include => dialextens
  8. include => parkedcalls
  9. exten => s,1,Answer()
  10. exten => s,2,Background(welcome-to-test-machine)
  11. [incoming]
  12. include => dialextens
  13. include => parkedcalls
  14. exten => s,1,Answer()
  15. exten => s,2,Background(welcome-to-test-machine)
  16. [extension]
  17. include => dialextens
  18. include => dialthrus
  19. exten => 5,1,Record(recording:gsm)
  20. exten => 5,2,Background(recording)
  21. exten => 81,1,Set(iterations=$[1000000])
  22. exten => 81,2,Set(time1=${EPOCH})
  23. exten => 81,3,Set(i=$[1])
  24. exten => 81,4,GotoIf($[${i}<${iterations}]?5:8)
  25. exten => 81,5,NoOp(Hello)
  26. exten => 81,6,Set(i=$[${i}+1])
  27. exten => 81,7,Goto(4)
  28. exten => 81,8,NoOp(Finish for_extension_1)
  29. exten => 81,9,Set(time2=${EPOCH})
  30. exten => 81,10,Verbose(The time diff is $[${time2} - ${time1} ] seconds)
  31. exten => 81,11,Verbose(Which means that the priorities/sec = $[4* ${iterations} / (${time2} - ${time1}) ])
  32. exten => 81,12,SayNumber($[4 * ${iterations} / (${time2} - ${time1}) ])
  33. exten => 82,1,Gosub(ndeep,~~s~~,1(100000))
  34. exten => 82,2,Verbose(Finished 100000 levels deep call!)
  35. exten => 83,1,Set(~~EXTEN~~=${EXTEN})
  36. exten => 83,2,Goto(sw_2_${~~EXTEN~~},10)
  37. exten => 83,3,NoOp(Finish switch_extension_2)
  38. exten => _sw_2_.,10,Goto(83,3)
  39. exten => sw_2_,10,Goto(sw_2_.,10)
  40. exten => _sw_2_[4-7]X,10,Verbose(and this too!)
  41. exten => _sw_2_[4-7]X,11,Goto(sw_2_.,10)
  42. exten => _sw_2_9X,10,Verbose(handle both 8x and 9x calls)
  43. exten => _sw_2_9X,11,Goto(sw_2_49,10)
  44. exten => _sw_2_8X,10,Verbose(do something to prepare it)
  45. exten => _sw_2_8X,11,Goto(sw_2_99,10)
  46. [ndeep]
  47. exten => ~~s~~,1,Set(LOCAL(level)=${ARG1})
  48. exten => ~~s~~,2,GotoIf($[${level} == 0]?3:5)
  49. exten => ~~s~~,3,Verbose(2|Got to Level 0)
  50. exten => ~~s~~,4,Return()
  51. exten => ~~s~~,5,NoOp(Finish if_ndeep_3)
  52. exten => ~~s~~,6,Gosub(ndeep,~~s~~,1($[${level}-1]))
  53. exten => ~~s~~,7,Return()
  54. [t1extension]
  55. include => dialextens
  56. include => dialthrus