adhearsion 1.2.6 → 2.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/.gitignore +17 -10
  2. data/CHANGELOG.md +273 -0
  3. data/Gemfile +1 -1
  4. data/Guardfile +17 -0
  5. data/README.markdown +61 -9
  6. data/Rakefile +16 -48
  7. data/adhearsion.gemspec +21 -7
  8. data/bin/ahn +3 -1
  9. data/cucumber.yml +4 -0
  10. data/features/app_generator.feature +42 -0
  11. data/features/cli.feature +108 -0
  12. data/features/step_definitions/app_generator_steps.rb +6 -0
  13. data/features/step_definitions/cli_steps.rb +74 -0
  14. data/features/support/aruba_helper.rb +22 -0
  15. data/features/support/env.rb +37 -0
  16. data/features/support/utils.rb +8 -0
  17. data/lib/adhearsion.rb +85 -41
  18. data/lib/adhearsion/call.rb +176 -0
  19. data/lib/adhearsion/call_controller.rb +134 -0
  20. data/lib/adhearsion/call_controller/dial.rb +70 -0
  21. data/lib/adhearsion/call_controller/input.rb +173 -0
  22. data/lib/adhearsion/call_controller/menu.rb +124 -0
  23. data/lib/adhearsion/call_controller/output.rb +267 -0
  24. data/lib/adhearsion/call_controller/record.rb +42 -0
  25. data/lib/adhearsion/call_controller/utility.rb +60 -0
  26. data/lib/adhearsion/calls.rb +81 -0
  27. data/lib/adhearsion/cli.rb +1 -3
  28. data/lib/adhearsion/cli_commands.rb +142 -0
  29. data/lib/adhearsion/configuration.rb +149 -0
  30. data/lib/adhearsion/console.rb +19 -8
  31. data/lib/adhearsion/dialplan_controller.rb +9 -0
  32. data/lib/adhearsion/events.rb +84 -0
  33. data/lib/adhearsion/foundation/all.rb +0 -7
  34. data/lib/adhearsion/foundation/custom_daemonizer.rb +4 -6
  35. data/lib/adhearsion/foundation/exception_handler.rb +9 -0
  36. data/lib/adhearsion/foundation/object.rb +26 -8
  37. data/lib/adhearsion/foundation/synchronized_hash.rb +3 -6
  38. data/lib/adhearsion/foundation/thread_safety.rb +17 -1
  39. data/lib/adhearsion/generators/app/app_generator.rb +4 -13
  40. data/lib/adhearsion/generators/app/templates/Gemfile +10 -5
  41. data/lib/adhearsion/generators/app/templates/Procfile +1 -0
  42. data/lib/adhearsion/generators/app/templates/README.md +28 -0
  43. data/lib/adhearsion/generators/app/templates/config/adhearsion.rb +41 -0
  44. data/lib/adhearsion/generators/app/templates/{components/simon_game → lib}/simon_game.rb +6 -18
  45. data/lib/adhearsion/generators/app/templates/script/ahn +2 -2
  46. data/lib/adhearsion/initializer.rb +151 -293
  47. data/lib/adhearsion/initializer/logging.rb +33 -0
  48. data/lib/adhearsion/logging.rb +65 -69
  49. data/lib/adhearsion/menu_dsl.rb +15 -0
  50. data/lib/adhearsion/menu_dsl/calculated_match.rb +39 -0
  51. data/lib/adhearsion/menu_dsl/calculated_match_collection.rb +41 -0
  52. data/lib/adhearsion/menu_dsl/fixnum_match_calculator.rb +18 -0
  53. data/lib/adhearsion/menu_dsl/match_calculator.rb +36 -0
  54. data/lib/adhearsion/{voip/menu_state_machine/menu_class.rb → menu_dsl/menu.rb} +38 -40
  55. data/lib/adhearsion/menu_dsl/menu_builder.rb +69 -0
  56. data/lib/adhearsion/menu_dsl/range_match_calculator.rb +55 -0
  57. data/lib/adhearsion/menu_dsl/string_match_calculator.rb +21 -0
  58. data/lib/adhearsion/outbound_call.rb +64 -0
  59. data/lib/adhearsion/plugin.rb +319 -0
  60. data/lib/adhearsion/plugin/collection.rb +19 -0
  61. data/lib/adhearsion/plugin/initializer.rb +37 -0
  62. data/lib/adhearsion/plugin/methods_container.rb +6 -0
  63. data/lib/adhearsion/process.rb +94 -0
  64. data/lib/adhearsion/punchblock_plugin.rb +29 -0
  65. data/lib/adhearsion/punchblock_plugin/initializer.rb +137 -0
  66. data/lib/adhearsion/router.rb +30 -0
  67. data/lib/adhearsion/router/route.rb +42 -0
  68. data/lib/adhearsion/script_ahn_loader.rb +2 -2
  69. data/lib/adhearsion/tasks.rb +14 -9
  70. data/lib/adhearsion/tasks/configuration.rb +26 -0
  71. data/lib/adhearsion/tasks/plugins.rb +17 -0
  72. data/lib/adhearsion/version.rb +8 -14
  73. data/spec/adhearsion/call_controller/dial_spec.rb +138 -0
  74. data/spec/adhearsion/call_controller/input_spec.rb +278 -0
  75. data/spec/adhearsion/call_controller/menu_spec.rb +120 -0
  76. data/spec/adhearsion/call_controller/output_spec.rb +466 -0
  77. data/spec/adhearsion/call_controller/record_spec.rb +125 -0
  78. data/spec/adhearsion/call_controller_spec.rb +395 -0
  79. data/spec/adhearsion/call_spec.rb +438 -0
  80. data/spec/adhearsion/calls_spec.rb +47 -0
  81. data/spec/adhearsion/configuration_spec.rb +308 -0
  82. data/spec/adhearsion/dialplan_controller_spec.rb +26 -0
  83. data/spec/adhearsion/events_spec.rb +112 -0
  84. data/spec/adhearsion/initializer/logging_spec.rb +58 -0
  85. data/spec/adhearsion/initializer_spec.rb +209 -122
  86. data/spec/adhearsion/logging_spec.rb +58 -47
  87. data/spec/adhearsion/menu_dsl/calculated_match_collection_spec.rb +56 -0
  88. data/spec/adhearsion/menu_dsl/calculated_match_spec.rb +57 -0
  89. data/spec/adhearsion/menu_dsl/fixnum_match_calculator_spec.rb +33 -0
  90. data/spec/adhearsion/menu_dsl/match_calculator_spec.rb +13 -0
  91. data/spec/adhearsion/menu_dsl/menu_builder_spec.rb +118 -0
  92. data/spec/adhearsion/menu_dsl/menu_spec.rb +210 -0
  93. data/spec/adhearsion/menu_dsl/range_match_calculator_spec.rb +28 -0
  94. data/spec/adhearsion/menu_dsl/string_match_calculator_spec.rb +36 -0
  95. data/spec/adhearsion/menu_dsl_spec.rb +12 -0
  96. data/spec/adhearsion/outbound_call_spec.rb +174 -0
  97. data/spec/adhearsion/plugin_spec.rb +489 -0
  98. data/spec/adhearsion/process_spec.rb +34 -0
  99. data/spec/adhearsion/punchblock_plugin/initializer_spec.rb +294 -0
  100. data/spec/adhearsion/router/route_spec.rb +99 -0
  101. data/spec/adhearsion/router_spec.rb +106 -0
  102. data/spec/adhearsion_spec.rb +46 -0
  103. data/spec/spec_helper.rb +14 -14
  104. data/spec/support/call_controller_test_helpers.rb +48 -0
  105. data/spec/support/initializer_stubs.rb +8 -13
  106. data/spec/support/punchblock_mocks.rb +6 -0
  107. metadata +255 -253
  108. data/CHANGELOG +0 -174
  109. data/bin/ahnctl +0 -68
  110. data/bin/jahn +0 -43
  111. data/examples/asterisk_manager_interface/standalone.rb +0 -51
  112. data/lib/adhearsion/commands.rb +0 -302
  113. data/lib/adhearsion/component_manager.rb +0 -278
  114. data/lib/adhearsion/component_manager/component_tester.rb +0 -54
  115. data/lib/adhearsion/component_manager/spec_framework.rb +0 -18
  116. data/lib/adhearsion/events_support.rb +0 -65
  117. data/lib/adhearsion/foundation/blank_slate.rb +0 -3
  118. data/lib/adhearsion/foundation/event_socket.rb +0 -205
  119. data/lib/adhearsion/foundation/future_resource.rb +0 -36
  120. data/lib/adhearsion/foundation/metaprogramming.rb +0 -17
  121. data/lib/adhearsion/foundation/numeric.rb +0 -13
  122. data/lib/adhearsion/foundation/pseudo_guid.rb +0 -10
  123. data/lib/adhearsion/foundation/relationship_properties.rb +0 -42
  124. data/lib/adhearsion/foundation/string.rb +0 -26
  125. data/lib/adhearsion/generators/app/templates/.ahnrc +0 -34
  126. data/lib/adhearsion/generators/app/templates/README +0 -8
  127. data/lib/adhearsion/generators/app/templates/components/ami_remote/ami_remote.rb +0 -15
  128. data/lib/adhearsion/generators/app/templates/components/disabled/HOW_TO_ENABLE +0 -7
  129. data/lib/adhearsion/generators/app/templates/components/disabled/stomp_gateway/README.markdown +0 -47
  130. data/lib/adhearsion/generators/app/templates/components/disabled/stomp_gateway/stomp_gateway.rb +0 -34
  131. data/lib/adhearsion/generators/app/templates/components/disabled/stomp_gateway/stomp_gateway.yml +0 -12
  132. data/lib/adhearsion/generators/app/templates/components/disabled/xmpp_gateway/README.markdown +0 -3
  133. data/lib/adhearsion/generators/app/templates/components/disabled/xmpp_gateway/xmpp_gateway.rb +0 -11
  134. data/lib/adhearsion/generators/app/templates/components/disabled/xmpp_gateway/xmpp_gateway.yml +0 -0
  135. data/lib/adhearsion/generators/app/templates/config/startup.rb +0 -81
  136. data/lib/adhearsion/generators/app/templates/dialplan.rb +0 -3
  137. data/lib/adhearsion/generators/app/templates/events.rb +0 -33
  138. data/lib/adhearsion/host_definitions.rb +0 -67
  139. data/lib/adhearsion/initializer/asterisk.rb +0 -86
  140. data/lib/adhearsion/initializer/configuration.rb +0 -324
  141. data/lib/adhearsion/initializer/database.rb +0 -60
  142. data/lib/adhearsion/initializer/drb.rb +0 -31
  143. data/lib/adhearsion/initializer/freeswitch.rb +0 -22
  144. data/lib/adhearsion/initializer/ldap.rb +0 -57
  145. data/lib/adhearsion/initializer/rails.rb +0 -41
  146. data/lib/adhearsion/initializer/xmpp.rb +0 -42
  147. data/lib/adhearsion/tasks/components.rb +0 -32
  148. data/lib/adhearsion/tasks/database.rb +0 -5
  149. data/lib/adhearsion/tasks/deprecations.rb +0 -59
  150. data/lib/adhearsion/tasks/generating.rb +0 -20
  151. data/lib/adhearsion/tasks/lint.rb +0 -4
  152. data/lib/adhearsion/voip/asterisk.rb +0 -4
  153. data/lib/adhearsion/voip/asterisk/agi_server.rb +0 -121
  154. data/lib/adhearsion/voip/asterisk/commands.rb +0 -1966
  155. data/lib/adhearsion/voip/asterisk/config_generators/agents.conf.rb +0 -140
  156. data/lib/adhearsion/voip/asterisk/config_generators/config_generator.rb +0 -102
  157. data/lib/adhearsion/voip/asterisk/config_generators/queues.conf.rb +0 -250
  158. data/lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb +0 -240
  159. data/lib/adhearsion/voip/asterisk/config_manager.rb +0 -64
  160. data/lib/adhearsion/voip/asterisk/manager_interface.rb +0 -697
  161. data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb +0 -1681
  162. data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb +0 -341
  163. data/lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb +0 -78
  164. data/lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl +0 -87
  165. data/lib/adhearsion/voip/asterisk/special_dial_plan_managers.rb +0 -80
  166. data/lib/adhearsion/voip/call.rb +0 -521
  167. data/lib/adhearsion/voip/call_routing.rb +0 -64
  168. data/lib/adhearsion/voip/commands.rb +0 -17
  169. data/lib/adhearsion/voip/constants.rb +0 -39
  170. data/lib/adhearsion/voip/conveniences.rb +0 -18
  171. data/lib/adhearsion/voip/dial_plan.rb +0 -252
  172. data/lib/adhearsion/voip/dsl/dialing_dsl.rb +0 -151
  173. data/lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb +0 -37
  174. data/lib/adhearsion/voip/dsl/dialplan/control_passing_exception.rb +0 -27
  175. data/lib/adhearsion/voip/dsl/dialplan/dispatcher.rb +0 -124
  176. data/lib/adhearsion/voip/dsl/dialplan/parser.rb +0 -69
  177. data/lib/adhearsion/voip/dsl/dialplan/thread_mixin.rb +0 -16
  178. data/lib/adhearsion/voip/dsl/numerical_string.rb +0 -128
  179. data/lib/adhearsion/voip/freeswitch/basic_connection_manager.rb +0 -48
  180. data/lib/adhearsion/voip/freeswitch/event_handler.rb +0 -58
  181. data/lib/adhearsion/voip/freeswitch/freeswitch_dialplan_command_factory.rb +0 -129
  182. data/lib/adhearsion/voip/freeswitch/inbound_connection_manager.rb +0 -38
  183. data/lib/adhearsion/voip/freeswitch/oes_server.rb +0 -195
  184. data/lib/adhearsion/voip/menu_state_machine/calculated_match.rb +0 -80
  185. data/lib/adhearsion/voip/menu_state_machine/matchers.rb +0 -123
  186. data/lib/adhearsion/voip/menu_state_machine/menu_builder.rb +0 -57
  187. data/lib/adhearsion/xmpp/connection.rb +0 -61
  188. data/lib/theatre.rb +0 -147
  189. data/lib/theatre/README.markdown +0 -64
  190. data/lib/theatre/callback_definition_loader.rb +0 -86
  191. data/lib/theatre/guid.rb +0 -23
  192. data/lib/theatre/invocation.rb +0 -131
  193. data/lib/theatre/namespace_manager.rb +0 -153
  194. data/lib/theatre/version.rb +0 -2
  195. data/spec/adhearsion/cli_spec.rb +0 -306
  196. data/spec/adhearsion/component_manager_spec.rb +0 -292
  197. data/spec/adhearsion/constants_spec.rb +0 -8
  198. data/spec/adhearsion/drb_spec.rb +0 -65
  199. data/spec/adhearsion/fixtures/dialplan.rb +0 -3
  200. data/spec/adhearsion/foundation/event_socket_spec.rb +0 -168
  201. data/spec/adhearsion/host_definitions_spec.rb +0 -79
  202. data/spec/adhearsion/initializer/configuration_spec.rb +0 -291
  203. data/spec/adhearsion/initializer/loading_spec.rb +0 -154
  204. data/spec/adhearsion/initializer/paths_spec.rb +0 -74
  205. data/spec/adhearsion/relationship_properties_spec.rb +0 -54
  206. data/spec/adhearsion/voip/asterisk/agi_server_spec.rb +0 -473
  207. data/spec/adhearsion/voip/asterisk/ami/ami_spec.rb +0 -550
  208. data/spec/adhearsion/voip/asterisk/ami/lexer/ami_fixtures.yml +0 -30
  209. data/spec/adhearsion/voip/asterisk/ami/lexer/lexer_story +0 -291
  210. data/spec/adhearsion/voip/asterisk/ami/lexer/lexer_story.rb +0 -241
  211. data/spec/adhearsion/voip/asterisk/ami/lexer/story_helper.rb +0 -124
  212. data/spec/adhearsion/voip/asterisk/commands_spec.rb +0 -3241
  213. data/spec/adhearsion/voip/asterisk/config_file_generators/agents_spec.rb +0 -251
  214. data/spec/adhearsion/voip/asterisk/config_file_generators/queues_spec.rb +0 -323
  215. data/spec/adhearsion/voip/asterisk/config_file_generators/voicemail_spec.rb +0 -306
  216. data/spec/adhearsion/voip/asterisk/config_manager_spec.rb +0 -127
  217. data/spec/adhearsion/voip/asterisk/menu_command/calculated_match_spec.rb +0 -109
  218. data/spec/adhearsion/voip/asterisk/menu_command/matchers_spec.rb +0 -97
  219. data/spec/adhearsion/voip/call_routing_spec.rb +0 -125
  220. data/spec/adhearsion/voip/dialplan_manager_spec.rb +0 -468
  221. data/spec/adhearsion/voip/dsl/dialing_dsl_spec.rb +0 -270
  222. data/spec/adhearsion/voip/dsl/dispatcher_spec.rb +0 -82
  223. data/spec/adhearsion/voip/dsl/dispatcher_spec_helper.rb +0 -45
  224. data/spec/adhearsion/voip/dsl/parser_spec.rb +0 -69
  225. data/spec/adhearsion/voip/freeswitch/basic_connection_manager_spec.rb +0 -39
  226. data/spec/adhearsion/voip/freeswitch/inbound_connection_manager_spec.rb +0 -39
  227. data/spec/adhearsion/voip/freeswitch/oes_server_spec.rb +0 -9
  228. data/spec/adhearsion/voip/numerical_string_spec.rb +0 -61
  229. data/spec/adhearsion/voip/phone_number_spec.rb +0 -45
  230. data/spec/support/the_following_code.rb +0 -3
  231. data/spec/theatre/dsl_examples/simple_before_call.rb +0 -7
  232. data/spec/theatre/dsl_spec.rb +0 -69
  233. data/spec/theatre/invocation_spec.rb +0 -182
  234. data/spec/theatre/namespace_spec.rb +0 -125
  235. data/spec/theatre/spec_helper_spec.rb +0 -28
  236. data/spec/theatre/theatre_class_spec.rb +0 -148
@@ -1,1681 +0,0 @@
1
-
2
- # line 1 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
3
- require File.join(File.dirname(__FILE__), 'ami_messages.rb')
4
-
5
- module Adhearsion
6
- module VoIP
7
- module Asterisk
8
- module Manager
9
- class AbstractAsteriskManagerInterfaceStreamLexer
10
-
11
- BUFFER_SIZE = 128.kilobytes unless defined? BUFFER_SIZE
12
-
13
- ##
14
- # IMPORTANT! See method documentation for adjust_pointers!
15
- #
16
- # @see adjust_pointers
17
- #
18
- POINTERS = [
19
- :@current_pointer,
20
- :@token_start,
21
- :@token_end,
22
- :@version_start,
23
- :@event_name_start,
24
- :@current_key_position,
25
- :@current_value_position,
26
- :@last_seen_value_end,
27
- :@error_reason_start,
28
- :@follows_text_start,
29
- :@current_syntax_error_start,
30
- :@immediate_response_start
31
- ]
32
-
33
-
34
- # line 72 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
35
- ##
36
-
37
- attr_accessor(:ami_version)
38
- def initialize
39
-
40
- @data = ""
41
- @current_pointer = 0
42
- @ragel_stack = []
43
- @ami_version = 0.0
44
-
45
-
46
- # line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
47
- class << self
48
- attr_accessor :_ami_protocol_parser_actions
49
- private :_ami_protocol_parser_actions, :_ami_protocol_parser_actions=
50
- end
51
- self._ami_protocol_parser_actions = [
52
- 0, 1, 0, 1, 2, 1, 5, 1,
53
- 6, 1, 7, 1, 8, 1, 9, 1,
54
- 10, 1, 13, 1, 17, 1, 18, 1,
55
- 19, 1, 20, 1, 28, 1, 30, 1,
56
- 31, 1, 35, 1, 36, 1, 37, 1,
57
- 38, 1, 39, 1, 40, 1, 41, 1,
58
- 46, 1, 47, 1, 48, 1, 49, 1,
59
- 50, 1, 53, 1, 54, 1, 55, 1,
60
- 56, 1, 57, 2, 1, 24, 2, 3,
61
- 26, 2, 4, 45, 2, 7, 17, 2,
62
- 9, 10, 2, 11, 9, 2, 12, 10,
63
- 2, 14, 34, 2, 15, 13, 2, 19,
64
- 20, 2, 21, 42, 2, 22, 43, 2,
65
- 23, 44, 2, 28, 29, 2, 31, 51,
66
- 3, 16, 25, 33, 3, 31, 27, 52,
67
- 4, 11, 12, 9, 10, 4, 16, 25,
68
- 33, 14, 4, 31, 16, 25, 32
69
- ]
70
-
71
- class << self
72
- attr_accessor :_ami_protocol_parser_key_offsets
73
- private :_ami_protocol_parser_key_offsets, :_ami_protocol_parser_key_offsets=
74
- end
75
- self._ami_protocol_parser_key_offsets = [
76
- 0, 0, 1, 2, 3, 4, 5, 6,
77
- 7, 8, 9, 10, 11, 12, 13, 14,
78
- 15, 16, 17, 18, 19, 20, 22, 25,
79
- 27, 30, 31, 34, 37, 40, 43, 44,
80
- 46, 49, 50, 53, 54, 55, 56, 57,
81
- 58, 59, 60, 61, 62, 63, 64, 65,
82
- 66, 67, 68, 69, 70, 71, 72, 73,
83
- 75, 78, 80, 83, 84, 87, 90, 92,
84
- 94, 96, 97, 99, 100, 102, 104, 106,
85
- 108, 110, 112, 114, 116, 117, 126, 135,
86
- 137, 139, 141, 143, 144, 145, 161, 176,
87
- 191, 206, 208, 209, 211, 228, 229, 244,
88
- 259, 274, 276, 277, 279, 296, 311, 328,
89
- 345, 362, 379, 396, 413, 428, 430, 431,
90
- 433, 450, 452, 454, 456, 471, 488, 505,
91
- 522, 539, 556, 573, 588, 590, 591, 593,
92
- 610, 612, 614, 616, 618, 620, 622, 624,
93
- 625, 626, 627, 628, 630, 632, 634, 635,
94
- 636, 638, 640, 642, 644, 646, 648, 649,
95
- 650, 665, 666, 681, 696, 711, 713, 714,
96
- 716, 731, 746, 748, 750, 753, 755, 758,
97
- 761, 764, 767, 770, 773, 776, 779, 782,
98
- 785, 788, 791, 794, 797, 798, 799, 801,
99
- 818, 835, 852, 855, 857, 860, 862, 879,
100
- 896, 913, 916, 918, 921, 923, 941, 959,
101
- 977, 995, 1013, 1031, 1049, 1067, 1085, 1103,
102
- 1121, 1139, 1157, 1175, 1191, 1206, 1221, 1223,
103
- 1224, 1226, 1241, 1256, 1258, 1275, 1278, 1281,
104
- 1284, 1287, 1290, 1293, 1296, 1299, 1302, 1305,
105
- 1308, 1311, 1314, 1317, 1318, 1320, 1323, 1326,
106
- 1329, 1332, 1335, 1338, 1341, 1344, 1347, 1350,
107
- 1353, 1356, 1359, 1362, 1365, 1366, 1367, 1369,
108
- 1371, 1374, 1391, 1392, 1393, 1396, 1397, 1403,
109
- 1404, 1405, 1407, 1409, 1409, 1425, 1428, 1445,
110
- 1462, 1476, 1490, 1504
111
- ]
112
-
113
- class << self
114
- attr_accessor :_ami_protocol_parser_trans_keys
115
- private :_ami_protocol_parser_trans_keys, :_ami_protocol_parser_trans_keys=
116
- end
117
- self._ami_protocol_parser_trans_keys = [
118
- 116, 101, 114, 105, 115, 107, 32, 67,
119
- 97, 108, 108, 32, 77, 97, 110, 97,
120
- 103, 101, 114, 47, 48, 57, 46, 48,
121
- 57, 48, 57, 13, 48, 57, 10, 13,
122
- 48, 57, 46, 48, 57, 10, 13, 58,
123
- 10, 13, 58, 13, 10, 13, 10, 13,
124
- 58, 13, 10, 13, 58, 116, 101, 114,
125
- 105, 115, 107, 32, 67, 97, 108, 108,
126
- 32, 77, 97, 110, 97, 103, 101, 114,
127
- 47, 48, 57, 46, 48, 57, 48, 57,
128
- 13, 48, 57, 10, 13, 48, 57, 46,
129
- 48, 57, 69, 101, 78, 110, 84, 116,
130
- 58, 13, 32, 13, 10, 13, 13, 32,
131
- 83, 115, 80, 112, 79, 111, 78, 110,
132
- 83, 115, 69, 101, 58, 32, 69, 70,
133
- 80, 83, 101, 102, 112, 115, 32, 69,
134
- 70, 80, 83, 101, 102, 112, 115, 82,
135
- 114, 82, 114, 79, 111, 82, 114, 13,
136
- 10, 77, 109, 32, 47, 48, 57, 59,
137
- 64, 65, 90, 91, 96, 97, 122, 123,
138
- 126, 58, 32, 47, 48, 57, 59, 64,
139
- 65, 90, 91, 96, 97, 122, 123, 126,
140
- 58, 32, 47, 48, 57, 59, 64, 65,
141
- 90, 91, 96, 97, 122, 123, 126, 58,
142
- 32, 47, 48, 57, 59, 64, 65, 90,
143
- 91, 96, 97, 122, 123, 126, 13, 32,
144
- 13, 10, 13, 13, 77, 109, 32, 47,
145
- 48, 57, 59, 64, 65, 90, 91, 96,
146
- 97, 122, 123, 126, 10, 58, 32, 47,
147
- 48, 57, 59, 64, 65, 90, 91, 96,
148
- 97, 122, 123, 126, 58, 32, 47, 48,
149
- 57, 59, 64, 65, 90, 91, 96, 97,
150
- 122, 123, 126, 58, 32, 47, 48, 57,
151
- 59, 64, 65, 90, 91, 96, 97, 122,
152
- 123, 126, 13, 32, 13, 10, 13, 13,
153
- 77, 109, 32, 47, 48, 57, 59, 64,
154
- 65, 90, 91, 96, 97, 122, 123, 126,
155
- 58, 32, 47, 48, 57, 59, 64, 65,
156
- 90, 91, 96, 97, 122, 123, 126, 58,
157
- 69, 101, 32, 47, 48, 57, 59, 64,
158
- 65, 90, 91, 96, 97, 122, 123, 126,
159
- 58, 83, 115, 32, 47, 48, 57, 59,
160
- 64, 65, 90, 91, 96, 97, 122, 123,
161
- 126, 58, 83, 115, 32, 47, 48, 57,
162
- 59, 64, 65, 90, 91, 96, 97, 122,
163
- 123, 126, 58, 65, 97, 32, 47, 48,
164
- 57, 59, 64, 66, 90, 91, 96, 98,
165
- 122, 123, 126, 58, 71, 103, 32, 47,
166
- 48, 57, 59, 64, 65, 90, 91, 96,
167
- 97, 122, 123, 126, 58, 69, 101, 32,
168
- 47, 48, 57, 59, 64, 65, 90, 91,
169
- 96, 97, 122, 123, 126, 58, 32, 47,
170
- 48, 57, 59, 64, 65, 90, 91, 96,
171
- 97, 122, 123, 126, 13, 32, 13, 10,
172
- 13, 13, 77, 109, 32, 47, 48, 57,
173
- 59, 64, 65, 90, 91, 96, 97, 122,
174
- 123, 126, 13, 32, 13, 32, 13, 32,
175
- 58, 32, 47, 48, 57, 59, 64, 65,
176
- 90, 91, 96, 97, 122, 123, 126, 58,
177
- 69, 101, 32, 47, 48, 57, 59, 64,
178
- 65, 90, 91, 96, 97, 122, 123, 126,
179
- 58, 83, 115, 32, 47, 48, 57, 59,
180
- 64, 65, 90, 91, 96, 97, 122, 123,
181
- 126, 58, 83, 115, 32, 47, 48, 57,
182
- 59, 64, 65, 90, 91, 96, 97, 122,
183
- 123, 126, 58, 65, 97, 32, 47, 48,
184
- 57, 59, 64, 66, 90, 91, 96, 98,
185
- 122, 123, 126, 58, 71, 103, 32, 47,
186
- 48, 57, 59, 64, 65, 90, 91, 96,
187
- 97, 122, 123, 126, 58, 69, 101, 32,
188
- 47, 48, 57, 59, 64, 65, 90, 91,
189
- 96, 97, 122, 123, 126, 58, 32, 47,
190
- 48, 57, 59, 64, 65, 90, 91, 96,
191
- 97, 122, 123, 126, 13, 32, 13, 10,
192
- 13, 13, 77, 109, 32, 47, 48, 57,
193
- 59, 64, 65, 90, 91, 96, 97, 122,
194
- 123, 126, 13, 32, 79, 111, 76, 108,
195
- 76, 108, 79, 111, 87, 119, 83, 115,
196
- 13, 10, 13, 10, 79, 111, 78, 110,
197
- 71, 103, 13, 10, 85, 117, 67, 99,
198
- 67, 99, 69, 101, 83, 115, 83, 115,
199
- 13, 10, 13, 32, 47, 48, 57, 59,
200
- 64, 65, 90, 91, 96, 97, 122, 123,
201
- 126, 10, 58, 32, 47, 48, 57, 59,
202
- 64, 65, 90, 91, 96, 97, 122, 123,
203
- 126, 58, 32, 47, 48, 57, 59, 64,
204
- 65, 90, 91, 96, 97, 122, 123, 126,
205
- 58, 32, 47, 48, 57, 59, 64, 65,
206
- 90, 91, 96, 97, 122, 123, 126, 13,
207
- 32, 13, 10, 13, 13, 32, 47, 48,
208
- 57, 59, 64, 65, 90, 91, 96, 97,
209
- 122, 123, 126, 58, 32, 47, 48, 57,
210
- 59, 64, 65, 90, 91, 96, 97, 122,
211
- 123, 126, 13, 32, 10, 13, 10, 13,
212
- 45, 10, 13, 10, 13, 45, 10, 13,
213
- 69, 10, 13, 78, 10, 13, 68, 10,
214
- 13, 32, 10, 13, 67, 10, 13, 79,
215
- 10, 13, 77, 10, 13, 77, 10, 13,
216
- 65, 10, 13, 78, 10, 13, 68, 10,
217
- 13, 45, 10, 13, 45, 13, 10, 10,
218
- 13, 10, 13, 58, 32, 47, 48, 57,
219
- 59, 64, 65, 90, 91, 96, 97, 122,
220
- 123, 126, 10, 13, 58, 32, 47, 48,
221
- 57, 59, 64, 65, 90, 91, 96, 97,
222
- 122, 123, 126, 10, 13, 58, 32, 47,
223
- 48, 57, 59, 64, 65, 90, 91, 96,
224
- 97, 122, 123, 126, 10, 13, 32, 10,
225
- 13, 10, 13, 45, 10, 13, 10, 13,
226
- 58, 32, 47, 48, 57, 59, 64, 65,
227
- 90, 91, 96, 97, 122, 123, 126, 10,
228
- 13, 58, 32, 47, 48, 57, 59, 64,
229
- 65, 90, 91, 96, 97, 122, 123, 126,
230
- 10, 13, 58, 32, 47, 48, 57, 59,
231
- 64, 65, 90, 91, 96, 97, 122, 123,
232
- 126, 10, 13, 32, 10, 13, 10, 13,
233
- 45, 10, 13, 10, 13, 45, 58, 32,
234
- 47, 48, 57, 59, 64, 65, 90, 91,
235
- 96, 97, 122, 123, 126, 10, 13, 58,
236
- 69, 32, 47, 48, 57, 59, 64, 65,
237
- 90, 91, 96, 97, 122, 123, 126, 10,
238
- 13, 58, 78, 32, 47, 48, 57, 59,
239
- 64, 65, 90, 91, 96, 97, 122, 123,
240
- 126, 10, 13, 58, 68, 32, 47, 48,
241
- 57, 59, 64, 65, 90, 91, 96, 97,
242
- 122, 123, 126, 10, 13, 32, 58, 33,
243
- 47, 48, 57, 59, 64, 65, 90, 91,
244
- 96, 97, 122, 123, 126, 10, 13, 58,
245
- 67, 32, 47, 48, 57, 59, 64, 65,
246
- 90, 91, 96, 97, 122, 123, 126, 10,
247
- 13, 58, 79, 32, 47, 48, 57, 59,
248
- 64, 65, 90, 91, 96, 97, 122, 123,
249
- 126, 10, 13, 58, 77, 32, 47, 48,
250
- 57, 59, 64, 65, 90, 91, 96, 97,
251
- 122, 123, 126, 10, 13, 58, 77, 32,
252
- 47, 48, 57, 59, 64, 65, 90, 91,
253
- 96, 97, 122, 123, 126, 10, 13, 58,
254
- 65, 32, 47, 48, 57, 59, 64, 66,
255
- 90, 91, 96, 97, 122, 123, 126, 10,
256
- 13, 58, 78, 32, 47, 48, 57, 59,
257
- 64, 65, 90, 91, 96, 97, 122, 123,
258
- 126, 10, 13, 58, 68, 32, 47, 48,
259
- 57, 59, 64, 65, 90, 91, 96, 97,
260
- 122, 123, 126, 10, 13, 45, 58, 32,
261
- 47, 48, 57, 59, 64, 65, 90, 91,
262
- 96, 97, 122, 123, 126, 10, 13, 45,
263
- 58, 32, 47, 48, 57, 59, 64, 65,
264
- 90, 91, 96, 97, 122, 123, 126, 13,
265
- 58, 32, 47, 48, 57, 59, 64, 65,
266
- 90, 91, 96, 97, 122, 123, 126, 58,
267
- 32, 47, 48, 57, 59, 64, 65, 90,
268
- 91, 96, 97, 122, 123, 126, 58, 32,
269
- 47, 48, 57, 59, 64, 65, 90, 91,
270
- 96, 97, 122, 123, 126, 13, 32, 13,
271
- 10, 13, 58, 32, 47, 48, 57, 59,
272
- 64, 65, 90, 91, 96, 97, 122, 123,
273
- 126, 58, 32, 47, 48, 57, 59, 64,
274
- 65, 90, 91, 96, 97, 122, 123, 126,
275
- 13, 32, 10, 13, 58, 32, 47, 48,
276
- 57, 59, 64, 65, 90, 91, 96, 97,
277
- 122, 123, 126, 10, 13, 45, 10, 13,
278
- 69, 10, 13, 78, 10, 13, 68, 10,
279
- 13, 32, 10, 13, 67, 10, 13, 79,
280
- 10, 13, 77, 10, 13, 77, 10, 13,
281
- 65, 10, 13, 78, 10, 13, 68, 10,
282
- 13, 45, 10, 13, 45, 13, 10, 13,
283
- 10, 13, 32, 10, 13, 45, 10, 13,
284
- 69, 10, 13, 78, 10, 13, 68, 10,
285
- 13, 32, 10, 13, 67, 10, 13, 79,
286
- 10, 13, 77, 10, 13, 77, 10, 13,
287
- 65, 10, 13, 78, 10, 13, 68, 10,
288
- 13, 45, 10, 13, 45, 13, 13, 10,
289
- 13, 10, 13, 10, 13, 32, 10, 13,
290
- 58, 32, 47, 48, 57, 59, 64, 65,
291
- 90, 91, 96, 97, 122, 123, 126, 65,
292
- 115, 10, 13, 58, 13, 13, 65, 69,
293
- 82, 101, 114, 10, 115, 86, 118, 69,
294
- 101, 10, 13, 32, 47, 48, 57, 59,
295
- 64, 65, 90, 91, 96, 97, 122, 123,
296
- 126, 10, 13, 45, 10, 13, 45, 32,
297
- 47, 48, 57, 59, 64, 65, 90, 91,
298
- 96, 97, 122, 123, 126, 10, 13, 45,
299
- 32, 47, 48, 57, 59, 64, 65, 90,
300
- 91, 96, 97, 122, 123, 126, 32, 47,
301
- 48, 57, 59, 64, 65, 90, 91, 96,
302
- 97, 122, 123, 126, 32, 47, 48, 57,
303
- 59, 64, 65, 90, 91, 96, 97, 122,
304
- 123, 126, 32, 47, 48, 57, 59, 64,
305
- 65, 90, 91, 96, 97, 122, 123, 126,
306
- 32, 47, 48, 57, 59, 64, 65, 90,
307
- 91, 96, 97, 122, 123, 126, 0
308
- ]
309
-
310
- class << self
311
- attr_accessor :_ami_protocol_parser_single_lengths
312
- private :_ami_protocol_parser_single_lengths, :_ami_protocol_parser_single_lengths=
313
- end
314
- self._ami_protocol_parser_single_lengths = [
315
- 0, 1, 1, 1, 1, 1, 1, 1,
316
- 1, 1, 1, 1, 1, 1, 1, 1,
317
- 1, 1, 1, 1, 1, 0, 1, 0,
318
- 1, 1, 1, 1, 3, 3, 1, 2,
319
- 3, 1, 3, 1, 1, 1, 1, 1,
320
- 1, 1, 1, 1, 1, 1, 1, 1,
321
- 1, 1, 1, 1, 1, 1, 1, 0,
322
- 1, 0, 1, 1, 1, 1, 2, 2,
323
- 2, 1, 2, 1, 2, 2, 2, 2,
324
- 2, 2, 2, 2, 1, 9, 9, 2,
325
- 2, 2, 2, 1, 1, 2, 1, 1,
326
- 1, 2, 1, 2, 3, 1, 1, 1,
327
- 1, 2, 1, 2, 3, 1, 3, 3,
328
- 3, 3, 3, 3, 1, 2, 1, 2,
329
- 3, 2, 2, 2, 1, 3, 3, 3,
330
- 3, 3, 3, 1, 2, 1, 2, 3,
331
- 2, 2, 2, 2, 2, 2, 2, 1,
332
- 1, 1, 1, 2, 2, 2, 1, 1,
333
- 2, 2, 2, 2, 2, 2, 1, 1,
334
- 1, 1, 1, 1, 1, 2, 1, 2,
335
- 1, 1, 2, 2, 3, 2, 3, 3,
336
- 3, 3, 3, 3, 3, 3, 3, 3,
337
- 3, 3, 3, 3, 1, 1, 2, 3,
338
- 3, 3, 3, 2, 3, 2, 3, 3,
339
- 3, 3, 2, 3, 2, 4, 4, 4,
340
- 4, 4, 4, 4, 4, 4, 4, 4,
341
- 4, 4, 4, 2, 1, 1, 2, 1,
342
- 2, 1, 1, 2, 3, 3, 3, 3,
343
- 3, 3, 3, 3, 3, 3, 3, 3,
344
- 3, 3, 3, 1, 2, 3, 3, 3,
345
- 3, 3, 3, 3, 3, 3, 3, 3,
346
- 3, 3, 3, 3, 1, 1, 2, 2,
347
- 3, 3, 1, 1, 3, 1, 6, 1,
348
- 1, 2, 2, 0, 2, 3, 3, 3,
349
- 0, 0, 0, 0
350
- ]
351
-
352
- class << self
353
- attr_accessor :_ami_protocol_parser_range_lengths
354
- private :_ami_protocol_parser_range_lengths, :_ami_protocol_parser_range_lengths=
355
- end
356
- self._ami_protocol_parser_range_lengths = [
357
- 0, 0, 0, 0, 0, 0, 0, 0,
358
- 0, 0, 0, 0, 0, 0, 0, 0,
359
- 0, 0, 0, 0, 0, 1, 1, 1,
360
- 1, 0, 1, 1, 0, 0, 0, 0,
361
- 0, 0, 0, 0, 0, 0, 0, 0,
362
- 0, 0, 0, 0, 0, 0, 0, 0,
363
- 0, 0, 0, 0, 0, 0, 0, 1,
364
- 1, 1, 1, 0, 1, 1, 0, 0,
365
- 0, 0, 0, 0, 0, 0, 0, 0,
366
- 0, 0, 0, 0, 0, 0, 0, 0,
367
- 0, 0, 0, 0, 0, 7, 7, 7,
368
- 7, 0, 0, 0, 7, 0, 7, 7,
369
- 7, 0, 0, 0, 7, 7, 7, 7,
370
- 7, 7, 7, 7, 7, 0, 0, 0,
371
- 7, 0, 0, 0, 7, 7, 7, 7,
372
- 7, 7, 7, 7, 0, 0, 0, 7,
373
- 0, 0, 0, 0, 0, 0, 0, 0,
374
- 0, 0, 0, 0, 0, 0, 0, 0,
375
- 0, 0, 0, 0, 0, 0, 0, 0,
376
- 7, 0, 7, 7, 7, 0, 0, 0,
377
- 7, 7, 0, 0, 0, 0, 0, 0,
378
- 0, 0, 0, 0, 0, 0, 0, 0,
379
- 0, 0, 0, 0, 0, 0, 0, 7,
380
- 7, 7, 0, 0, 0, 0, 7, 7,
381
- 7, 0, 0, 0, 0, 7, 7, 7,
382
- 7, 7, 7, 7, 7, 7, 7, 7,
383
- 7, 7, 7, 7, 7, 7, 0, 0,
384
- 0, 7, 7, 0, 7, 0, 0, 0,
385
- 0, 0, 0, 0, 0, 0, 0, 0,
386
- 0, 0, 0, 0, 0, 0, 0, 0,
387
- 0, 0, 0, 0, 0, 0, 0, 0,
388
- 0, 0, 0, 0, 0, 0, 0, 0,
389
- 0, 7, 0, 0, 0, 0, 0, 0,
390
- 0, 0, 0, 0, 7, 0, 7, 7,
391
- 7, 7, 7, 7
392
- ]
393
-
394
- class << self
395
- attr_accessor :_ami_protocol_parser_index_offsets
396
- private :_ami_protocol_parser_index_offsets, :_ami_protocol_parser_index_offsets=
397
- end
398
- self._ami_protocol_parser_index_offsets = [
399
- 0, 0, 2, 4, 6, 8, 10, 12,
400
- 14, 16, 18, 20, 22, 24, 26, 28,
401
- 30, 32, 34, 36, 38, 40, 42, 45,
402
- 47, 50, 52, 55, 58, 62, 66, 68,
403
- 71, 75, 77, 81, 83, 85, 87, 89,
404
- 91, 93, 95, 97, 99, 101, 103, 105,
405
- 107, 109, 111, 113, 115, 117, 119, 121,
406
- 123, 126, 128, 131, 133, 136, 139, 142,
407
- 145, 148, 150, 153, 155, 158, 161, 164,
408
- 167, 170, 173, 176, 179, 181, 191, 201,
409
- 204, 207, 210, 213, 215, 217, 227, 236,
410
- 245, 254, 257, 259, 262, 273, 275, 284,
411
- 293, 302, 305, 307, 310, 321, 330, 341,
412
- 352, 363, 374, 385, 396, 405, 408, 410,
413
- 413, 424, 427, 430, 433, 442, 453, 464,
414
- 475, 486, 497, 508, 517, 520, 522, 525,
415
- 536, 539, 542, 545, 548, 551, 554, 557,
416
- 559, 561, 563, 565, 568, 571, 574, 576,
417
- 578, 581, 584, 587, 590, 593, 596, 598,
418
- 600, 609, 611, 620, 629, 638, 641, 643,
419
- 646, 655, 664, 667, 670, 674, 677, 681,
420
- 685, 689, 693, 697, 701, 705, 709, 713,
421
- 717, 721, 725, 729, 733, 735, 737, 740,
422
- 751, 762, 773, 777, 780, 784, 787, 798,
423
- 809, 820, 824, 827, 831, 834, 846, 858,
424
- 870, 882, 894, 906, 918, 930, 942, 954,
425
- 966, 978, 990, 1002, 1012, 1021, 1030, 1033,
426
- 1035, 1038, 1047, 1056, 1059, 1070, 1074, 1078,
427
- 1082, 1086, 1090, 1094, 1098, 1102, 1106, 1110,
428
- 1114, 1118, 1122, 1126, 1128, 1131, 1135, 1139,
429
- 1143, 1147, 1151, 1155, 1159, 1163, 1167, 1171,
430
- 1175, 1179, 1183, 1187, 1191, 1193, 1195, 1198,
431
- 1201, 1205, 1216, 1218, 1220, 1224, 1226, 1233,
432
- 1235, 1237, 1240, 1243, 1244, 1254, 1258, 1269,
433
- 1280, 1288, 1296, 1304
434
- ]
435
-
436
- class << self
437
- attr_accessor :_ami_protocol_parser_indicies
438
- private :_ami_protocol_parser_indicies, :_ami_protocol_parser_indicies=
439
- end
440
- self._ami_protocol_parser_indicies = [
441
- 1, 0, 2, 0, 3, 0, 4, 0,
442
- 5, 0, 6, 0, 7, 0, 8, 0,
443
- 9, 0, 10, 0, 11, 0, 12, 0,
444
- 13, 0, 14, 0, 15, 0, 16, 0,
445
- 17, 0, 18, 0, 19, 0, 20, 0,
446
- 21, 0, 22, 23, 0, 24, 0, 25,
447
- 26, 0, 27, 0, 25, 26, 0, 22,
448
- 23, 0, 29, 30, 31, 28, 29, 30,
449
- 31, 28, 33, 31, 34, 33, 31, 35,
450
- 30, 31, 28, 33, 31, 36, 30, 31,
451
- 28, 38, 37, 39, 37, 40, 37, 41,
452
- 37, 42, 37, 43, 37, 44, 37, 45,
453
- 37, 46, 37, 47, 37, 48, 37, 49,
454
- 37, 50, 37, 51, 37, 52, 37, 53,
455
- 37, 54, 37, 55, 37, 56, 37, 57,
456
- 37, 58, 37, 59, 60, 37, 61, 37,
457
- 62, 63, 37, 64, 37, 62, 63, 37,
458
- 59, 60, 37, 65, 65, 37, 66, 66,
459
- 37, 67, 67, 37, 68, 37, 70, 71,
460
- 69, 73, 72, 74, 73, 72, 70, 71,
461
- 69, 75, 75, 37, 76, 76, 37, 77,
462
- 77, 37, 78, 78, 37, 79, 79, 37,
463
- 80, 80, 37, 81, 37, 82, 83, 84,
464
- 85, 86, 83, 84, 85, 86, 37, 82,
465
- 83, 84, 85, 86, 83, 84, 85, 86,
466
- 37, 87, 87, 37, 88, 88, 37, 89,
467
- 89, 37, 90, 90, 37, 91, 37, 92,
468
- 37, 95, 95, 93, 94, 93, 94, 93,
469
- 94, 93, 37, 98, 96, 97, 96, 97,
470
- 96, 97, 96, 37, 98, 96, 97, 96,
471
- 97, 96, 97, 96, 37, 98, 96, 97,
472
- 96, 97, 96, 97, 96, 37, 100, 101,
473
- 99, 103, 102, 104, 103, 102, 105, 108,
474
- 108, 106, 107, 106, 107, 106, 107, 106,
475
- 37, 109, 37, 112, 110, 111, 110, 111,
476
- 110, 111, 110, 37, 112, 110, 111, 110,
477
- 111, 110, 111, 110, 37, 112, 110, 111,
478
- 110, 111, 110, 111, 110, 37, 114, 115,
479
- 113, 117, 116, 118, 117, 116, 105, 108,
480
- 108, 106, 107, 106, 107, 106, 107, 106,
481
- 37, 112, 110, 111, 110, 111, 110, 111,
482
- 110, 37, 112, 119, 119, 110, 111, 110,
483
- 111, 110, 111, 110, 37, 112, 120, 120,
484
- 110, 111, 110, 111, 110, 111, 110, 37,
485
- 112, 121, 121, 110, 111, 110, 111, 110,
486
- 111, 110, 37, 112, 122, 122, 110, 111,
487
- 110, 111, 110, 111, 110, 37, 112, 123,
488
- 123, 110, 111, 110, 111, 110, 111, 110,
489
- 37, 112, 124, 124, 110, 111, 110, 111,
490
- 110, 111, 110, 37, 125, 110, 111, 110,
491
- 111, 110, 111, 110, 37, 127, 128, 126,
492
- 130, 129, 131, 130, 129, 105, 108, 108,
493
- 106, 107, 106, 107, 106, 107, 106, 37,
494
- 127, 128, 126, 114, 115, 113, 100, 101,
495
- 99, 98, 96, 97, 96, 97, 96, 97,
496
- 96, 37, 98, 132, 132, 96, 97, 96,
497
- 97, 96, 97, 96, 37, 98, 133, 133,
498
- 96, 97, 96, 97, 96, 97, 96, 37,
499
- 98, 134, 134, 96, 97, 96, 97, 96,
500
- 97, 96, 37, 98, 135, 135, 96, 97,
501
- 96, 97, 96, 97, 96, 37, 98, 136,
502
- 136, 96, 97, 96, 97, 96, 97, 96,
503
- 37, 98, 137, 137, 96, 97, 96, 97,
504
- 96, 97, 96, 37, 138, 96, 97, 96,
505
- 97, 96, 97, 96, 37, 140, 141, 139,
506
- 143, 142, 144, 143, 142, 105, 108, 108,
507
- 106, 107, 106, 107, 106, 107, 106, 37,
508
- 140, 141, 139, 145, 145, 37, 146, 146,
509
- 37, 147, 147, 37, 148, 148, 37, 149,
510
- 149, 37, 150, 150, 37, 151, 37, 152,
511
- 37, 153, 37, 154, 37, 155, 155, 37,
512
- 156, 156, 37, 157, 157, 37, 158, 37,
513
- 159, 37, 160, 160, 37, 161, 161, 37,
514
- 162, 162, 37, 163, 163, 37, 164, 164,
515
- 37, 165, 165, 37, 166, 37, 167, 37,
516
- 168, 170, 171, 170, 171, 170, 171, 170,
517
- 169, 172, 169, 175, 173, 174, 173, 174,
518
- 173, 174, 173, 169, 175, 173, 174, 173,
519
- 174, 173, 174, 173, 169, 175, 173, 174,
520
- 173, 174, 173, 174, 173, 169, 177, 178,
521
- 176, 180, 179, 181, 180, 179, 168, 170,
522
- 171, 170, 171, 170, 171, 170, 169, 175,
523
- 173, 174, 173, 174, 173, 174, 173, 169,
524
- 177, 178, 176, 184, 185, 183, 184, 185,
525
- 186, 183, 184, 185, 183, 184, 185, 187,
526
- 183, 184, 185, 188, 183, 184, 185, 189,
527
- 183, 184, 185, 190, 183, 184, 185, 191,
528
- 183, 184, 185, 192, 183, 184, 185, 193,
529
- 183, 184, 185, 194, 183, 184, 185, 195,
530
- 183, 184, 185, 196, 183, 184, 185, 197,
531
- 183, 184, 185, 198, 183, 184, 185, 199,
532
- 183, 184, 185, 200, 183, 201, 182, 202,
533
- 182, 203, 185, 183, 184, 185, 206, 204,
534
- 205, 204, 205, 204, 205, 204, 183, 184,
535
- 185, 206, 204, 205, 204, 205, 204, 205,
536
- 204, 183, 184, 185, 206, 204, 205, 204,
537
- 205, 204, 205, 204, 183, 208, 209, 210,
538
- 207, 212, 213, 211, 212, 213, 214, 211,
539
- 215, 213, 211, 184, 185, 219, 217, 218,
540
- 217, 218, 217, 218, 217, 183, 184, 185,
541
- 219, 217, 218, 217, 218, 217, 218, 217,
542
- 183, 184, 185, 219, 217, 218, 217, 218,
543
- 217, 218, 217, 183, 221, 222, 223, 220,
544
- 225, 226, 224, 225, 226, 227, 224, 228,
545
- 226, 224, 184, 185, 229, 219, 217, 218,
546
- 217, 218, 217, 218, 217, 183, 184, 185,
547
- 219, 230, 217, 218, 217, 218, 217, 218,
548
- 217, 183, 184, 185, 219, 231, 217, 218,
549
- 217, 218, 217, 218, 217, 183, 184, 185,
550
- 219, 232, 217, 218, 217, 218, 217, 218,
551
- 217, 183, 184, 185, 233, 219, 217, 218,
552
- 217, 218, 217, 218, 217, 183, 184, 185,
553
- 219, 234, 217, 218, 217, 218, 217, 218,
554
- 217, 183, 184, 185, 219, 235, 217, 218,
555
- 217, 218, 217, 218, 217, 183, 184, 185,
556
- 219, 236, 217, 218, 217, 218, 217, 218,
557
- 217, 183, 184, 185, 219, 237, 217, 218,
558
- 217, 218, 217, 218, 217, 183, 184, 185,
559
- 219, 238, 217, 218, 217, 218, 217, 218,
560
- 217, 183, 184, 185, 219, 239, 217, 218,
561
- 217, 218, 217, 218, 217, 183, 184, 185,
562
- 219, 240, 217, 218, 217, 218, 217, 218,
563
- 217, 183, 184, 185, 241, 219, 217, 218,
564
- 217, 218, 217, 218, 217, 183, 184, 185,
565
- 242, 219, 217, 218, 217, 218, 217, 218,
566
- 217, 183, 201, 245, 243, 244, 243, 244,
567
- 243, 244, 243, 216, 245, 243, 244, 243,
568
- 244, 243, 244, 243, 216, 245, 243, 244,
569
- 243, 244, 243, 244, 243, 216, 247, 248,
570
- 246, 250, 249, 251, 250, 249, 245, 243,
571
- 244, 243, 244, 243, 244, 243, 216, 245,
572
- 243, 244, 243, 244, 243, 244, 243, 216,
573
- 247, 248, 246, 184, 185, 219, 217, 218,
574
- 217, 218, 217, 218, 217, 183, 225, 226,
575
- 252, 224, 225, 226, 253, 224, 225, 226,
576
- 254, 224, 225, 226, 255, 224, 225, 226,
577
- 256, 224, 225, 226, 257, 224, 225, 226,
578
- 258, 224, 225, 226, 259, 224, 225, 226,
579
- 260, 224, 225, 226, 261, 224, 225, 226,
580
- 262, 224, 225, 226, 263, 224, 225, 226,
581
- 264, 224, 225, 226, 265, 224, 266, 249,
582
- 267, 250, 249, 221, 222, 223, 220, 212,
583
- 213, 268, 211, 212, 213, 269, 211, 212,
584
- 213, 270, 211, 212, 213, 271, 211, 212,
585
- 213, 272, 211, 212, 213, 273, 211, 212,
586
- 213, 274, 211, 212, 213, 275, 211, 212,
587
- 213, 276, 211, 212, 213, 277, 211, 212,
588
- 213, 278, 211, 212, 213, 279, 211, 212,
589
- 213, 280, 211, 212, 213, 281, 211, 283,
590
- 282, 284, 282, 285, 284, 282, 286, 284,
591
- 282, 208, 209, 210, 207, 184, 185, 206,
592
- 204, 205, 204, 205, 204, 205, 204, 183,
593
- 288, 287, 290, 289, 292, 293, 292, 291,
594
- 33, 31, 296, 297, 298, 299, 298, 299,
595
- 295, 301, 300, 302, 300, 303, 303, 300,
596
- 304, 304, 300, 169, 306, 307, 308, 309,
597
- 308, 309, 308, 309, 308, 305, 184, 185,
598
- 186, 183, 184, 185, 313, 312, 314, 312,
599
- 314, 312, 314, 312, 183, 184, 185, 313,
600
- 312, 314, 312, 314, 312, 314, 312, 183,
601
- 315, 316, 315, 316, 315, 316, 315, 311,
602
- 315, 316, 315, 316, 315, 316, 315, 311,
603
- 315, 316, 315, 316, 315, 316, 315, 311,
604
- 315, 316, 315, 316, 315, 316, 315, 311,
605
- 0
606
- ]
607
-
608
- class << self
609
- attr_accessor :_ami_protocol_parser_trans_targs
610
- private :_ami_protocol_parser_trans_targs, :_ami_protocol_parser_trans_targs=
611
- end
612
- self._ami_protocol_parser_trans_targs = [
613
- 258, 2, 3, 4, 5, 6, 7, 8,
614
- 9, 10, 11, 12, 13, 14, 15, 16,
615
- 17, 18, 19, 20, 21, 22, 23, 27,
616
- 24, 25, 26, 258, 29, 261, 32, 30,
617
- 260, 31, 260, 260, 260, 262, 36, 37,
618
- 38, 39, 40, 41, 42, 43, 44, 45,
619
- 46, 47, 48, 49, 50, 51, 52, 53,
620
- 54, 55, 56, 57, 61, 58, 59, 60,
621
- 262, 63, 64, 65, 66, 67, 68, 69,
622
- 67, 68, 262, 71, 72, 73, 74, 75,
623
- 76, 77, 78, 79, 129, 139, 144, 80,
624
- 81, 82, 83, 84, 85, 86, 116, 117,
625
- 87, 88, 89, 90, 91, 115, 90, 91,
626
- 92, 93, 94, 101, 102, 262, 95, 96,
627
- 97, 98, 99, 114, 98, 99, 100, 103,
628
- 104, 105, 106, 107, 108, 109, 110, 111,
629
- 113, 110, 111, 112, 118, 119, 120, 121,
630
- 122, 123, 124, 125, 126, 128, 125, 126,
631
- 127, 130, 131, 132, 133, 134, 135, 136,
632
- 137, 138, 262, 140, 141, 142, 143, 262,
633
- 145, 146, 147, 148, 149, 150, 151, 262,
634
- 153, 0, 154, 161, 267, 155, 156, 157,
635
- 158, 159, 162, 158, 159, 160, 268, 163,
636
- 164, 165, 166, 167, 168, 169, 170, 171,
637
- 172, 173, 174, 175, 176, 177, 178, 179,
638
- 180, 181, 268, 269, 184, 185, 186, 187,
639
- 188, 189, 256, 187, 188, 189, 238, 270,
640
- 268, 191, 192, 193, 194, 195, 196, 237,
641
- 194, 195, 196, 221, 271, 198, 199, 200,
642
- 201, 202, 203, 204, 205, 206, 207, 208,
643
- 209, 210, 211, 212, 213, 214, 215, 216,
644
- 219, 215, 216, 272, 222, 223, 224, 225,
645
- 226, 227, 228, 229, 230, 231, 232, 233,
646
- 234, 235, 236, 273, 239, 240, 241, 242,
647
- 243, 244, 245, 246, 247, 248, 249, 250,
648
- 251, 252, 253, 255, 254, 274, 275, 258,
649
- 259, 258, 1, 28, 33, 34, 260, 262,
650
- 263, 264, 265, 266, 262, 262, 35, 62,
651
- 70, 163, 164, 182, 183, 257, 268, 268,
652
- 190, 197, 220, 217, 218
653
- ]
654
-
655
- class << self
656
- attr_accessor :_ami_protocol_parser_trans_actions
657
- private :_ami_protocol_parser_trans_actions, :_ami_protocol_parser_trans_actions=
658
- end
659
- self._ami_protocol_parser_trans_actions = [
660
- 43, 0, 0, 0, 0, 0, 0, 0,
661
- 0, 0, 0, 0, 0, 0, 0, 0,
662
- 0, 0, 0, 0, 0, 5, 0, 0,
663
- 0, 7, 0, 37, 0, 130, 0, 0,
664
- 35, 0, 88, 125, 112, 55, 0, 0,
665
- 0, 0, 0, 0, 0, 0, 0, 0,
666
- 0, 0, 0, 0, 0, 0, 0, 0,
667
- 0, 0, 5, 0, 0, 0, 7, 0,
668
- 45, 0, 0, 0, 0, 23, 94, 23,
669
- 0, 25, 103, 0, 0, 0, 0, 0,
670
- 0, 0, 0, 0, 0, 0, 0, 0,
671
- 0, 0, 0, 3, 0, 9, 9, 9,
672
- 0, 0, 11, 13, 79, 13, 0, 15,
673
- 0, 0, 9, 9, 9, 73, 0, 0,
674
- 11, 13, 79, 13, 0, 15, 0, 0,
675
- 0, 0, 0, 0, 0, 11, 82, 120,
676
- 82, 0, 85, 0, 0, 0, 0, 0,
677
- 0, 0, 11, 82, 120, 82, 0, 85,
678
- 0, 0, 0, 0, 0, 0, 0, 0,
679
- 67, 0, 47, 0, 0, 0, 1, 100,
680
- 0, 0, 0, 0, 0, 0, 1, 97,
681
- 0, 0, 9, 9, 70, 0, 0, 11,
682
- 13, 79, 13, 0, 15, 0, 65, 0,
683
- 0, 0, 0, 0, 0, 0, 0, 0,
684
- 0, 0, 0, 0, 0, 0, 0, 0,
685
- 21, 0, 57, 116, 0, 0, 11, 13,
686
- 13, 79, 13, 0, 0, 15, 0, 109,
687
- 63, 0, 0, 11, 13, 13, 79, 13,
688
- 0, 0, 15, 0, 109, 0, 0, 0,
689
- 0, 0, 0, 0, 0, 0, 0, 0,
690
- 0, 0, 21, 0, 0, 11, 13, 79,
691
- 13, 0, 15, 31, 0, 0, 0, 0,
692
- 0, 0, 0, 0, 0, 0, 0, 0,
693
- 0, 21, 15, 31, 0, 0, 0, 0,
694
- 0, 0, 0, 0, 0, 0, 0, 0,
695
- 0, 21, 0, 15, 15, 31, 31, 39,
696
- 31, 41, 0, 91, 17, 91, 33, 51,
697
- 0, 31, 31, 31, 53, 49, 0, 0,
698
- 0, 19, 19, 19, 76, 76, 61, 59,
699
- 9, 9, 9, 9, 9
700
- ]
701
-
702
- class << self
703
- attr_accessor :_ami_protocol_parser_to_state_actions
704
- private :_ami_protocol_parser_to_state_actions, :_ami_protocol_parser_to_state_actions=
705
- end
706
- self._ami_protocol_parser_to_state_actions = [
707
- 0, 0, 0, 0, 0, 0, 0, 0,
708
- 0, 0, 0, 0, 0, 0, 0, 0,
709
- 0, 0, 0, 0, 0, 0, 0, 0,
710
- 0, 0, 0, 0, 0, 0, 0, 0,
711
- 0, 0, 0, 0, 0, 0, 0, 0,
712
- 0, 0, 0, 0, 0, 0, 0, 0,
713
- 0, 0, 0, 0, 0, 0, 0, 0,
714
- 0, 0, 0, 0, 0, 0, 0, 0,
715
- 0, 0, 0, 0, 0, 0, 0, 0,
716
- 0, 0, 0, 0, 0, 0, 0, 0,
717
- 0, 0, 0, 0, 0, 0, 0, 0,
718
- 0, 0, 0, 0, 0, 0, 0, 0,
719
- 0, 0, 0, 0, 0, 0, 0, 0,
720
- 0, 0, 0, 0, 0, 0, 0, 0,
721
- 0, 0, 0, 0, 0, 0, 0, 0,
722
- 0, 0, 0, 0, 0, 0, 0, 0,
723
- 0, 0, 0, 0, 0, 0, 0, 0,
724
- 0, 0, 0, 0, 0, 0, 0, 0,
725
- 0, 0, 0, 0, 0, 0, 0, 0,
726
- 27, 0, 0, 0, 0, 0, 0, 0,
727
- 0, 0, 0, 0, 0, 0, 0, 0,
728
- 0, 0, 0, 0, 0, 0, 0, 0,
729
- 0, 0, 0, 0, 0, 0, 0, 0,
730
- 0, 0, 0, 0, 0, 0, 0, 0,
731
- 0, 0, 0, 0, 0, 0, 0, 0,
732
- 0, 0, 0, 0, 0, 0, 0, 0,
733
- 0, 0, 0, 0, 0, 0, 0, 0,
734
- 0, 0, 0, 0, 0, 0, 0, 0,
735
- 0, 0, 0, 0, 0, 0, 0, 0,
736
- 0, 0, 0, 0, 0, 0, 0, 0,
737
- 0, 0, 0, 0, 0, 0, 0, 0,
738
- 0, 0, 0, 0, 0, 0, 0, 0,
739
- 0, 0, 27, 0, 106, 0, 27, 0,
740
- 0, 0, 0, 0, 106, 0, 0, 0,
741
- 0, 0, 0, 0
742
- ]
743
-
744
- class << self
745
- attr_accessor :_ami_protocol_parser_from_state_actions
746
- private :_ami_protocol_parser_from_state_actions, :_ami_protocol_parser_from_state_actions=
747
- end
748
- self._ami_protocol_parser_from_state_actions = [
749
- 0, 0, 0, 0, 0, 0, 0, 0,
750
- 0, 0, 0, 0, 0, 0, 0, 0,
751
- 0, 0, 0, 0, 0, 0, 0, 0,
752
- 0, 0, 0, 0, 0, 0, 0, 0,
753
- 0, 0, 0, 0, 0, 0, 0, 0,
754
- 0, 0, 0, 0, 0, 0, 0, 0,
755
- 0, 0, 0, 0, 0, 0, 0, 0,
756
- 0, 0, 0, 0, 0, 0, 0, 0,
757
- 0, 0, 0, 0, 0, 0, 0, 0,
758
- 0, 0, 0, 0, 0, 0, 0, 0,
759
- 0, 0, 0, 0, 0, 0, 0, 0,
760
- 0, 0, 0, 0, 0, 0, 0, 0,
761
- 0, 0, 0, 0, 0, 0, 0, 0,
762
- 0, 0, 0, 0, 0, 0, 0, 0,
763
- 0, 0, 0, 0, 0, 0, 0, 0,
764
- 0, 0, 0, 0, 0, 0, 0, 0,
765
- 0, 0, 0, 0, 0, 0, 0, 0,
766
- 0, 0, 0, 0, 0, 0, 0, 0,
767
- 0, 0, 0, 0, 0, 0, 0, 0,
768
- 0, 0, 0, 0, 0, 0, 0, 0,
769
- 0, 0, 0, 0, 0, 0, 0, 0,
770
- 0, 0, 0, 0, 0, 0, 0, 0,
771
- 0, 0, 0, 0, 0, 0, 0, 0,
772
- 0, 0, 0, 0, 0, 0, 0, 0,
773
- 0, 0, 0, 0, 0, 0, 0, 0,
774
- 0, 0, 0, 0, 0, 0, 0, 0,
775
- 0, 0, 0, 0, 0, 0, 0, 0,
776
- 0, 0, 0, 0, 0, 0, 0, 0,
777
- 0, 0, 0, 0, 0, 0, 0, 0,
778
- 0, 0, 0, 0, 0, 0, 0, 0,
779
- 0, 0, 0, 0, 0, 0, 0, 0,
780
- 0, 0, 0, 0, 0, 0, 0, 0,
781
- 0, 0, 29, 0, 29, 0, 29, 0,
782
- 0, 0, 0, 0, 29, 0, 0, 0,
783
- 0, 0, 0, 0
784
- ]
785
-
786
- class << self
787
- attr_accessor :_ami_protocol_parser_eof_trans
788
- private :_ami_protocol_parser_eof_trans, :_ami_protocol_parser_eof_trans=
789
- end
790
- self._ami_protocol_parser_eof_trans = [
791
- 0, 1, 1, 1, 1, 1, 1, 1,
792
- 1, 1, 1, 1, 1, 1, 1, 1,
793
- 1, 1, 1, 1, 1, 1, 1, 1,
794
- 1, 1, 1, 1, 0, 0, 33, 33,
795
- 0, 0, 0, 38, 38, 38, 38, 38,
796
- 38, 38, 38, 38, 38, 38, 38, 38,
797
- 38, 38, 38, 38, 38, 38, 38, 38,
798
- 38, 38, 38, 38, 38, 38, 38, 38,
799
- 38, 38, 38, 38, 38, 38, 38, 38,
800
- 38, 38, 38, 38, 38, 38, 38, 38,
801
- 38, 38, 38, 38, 38, 38, 38, 38,
802
- 38, 38, 38, 38, 38, 38, 38, 38,
803
- 38, 38, 38, 38, 38, 38, 38, 38,
804
- 38, 38, 38, 38, 38, 38, 38, 38,
805
- 38, 38, 38, 38, 38, 38, 38, 38,
806
- 38, 38, 38, 38, 38, 38, 38, 38,
807
- 38, 38, 38, 38, 38, 38, 38, 38,
808
- 38, 38, 38, 38, 38, 38, 38, 38,
809
- 38, 38, 38, 38, 38, 38, 38, 38,
810
- 0, 0, 0, 0, 0, 0, 0, 0,
811
- 0, 0, 0, 183, 183, 183, 183, 183,
812
- 183, 183, 183, 183, 183, 183, 183, 183,
813
- 183, 183, 183, 183, 183, 183, 0, 0,
814
- 0, 0, 0, 0, 0, 0, 217, 217,
815
- 217, 217, 217, 217, 217, 217, 217, 217,
816
- 217, 217, 217, 217, 217, 217, 217, 217,
817
- 217, 217, 217, 217, 217, 217, 217, 217,
818
- 217, 217, 217, 217, 217, 217, 217, 217,
819
- 217, 217, 217, 217, 217, 217, 217, 217,
820
- 217, 217, 217, 217, 217, 217, 0, 0,
821
- 0, 0, 0, 0, 0, 0, 0, 0,
822
- 0, 0, 0, 0, 0, 0, 0, 0,
823
- 0, 0, 0, 290, 0, 295, 0, 301,
824
- 301, 301, 301, 0, 0, 311, 312, 312,
825
- 312, 312, 312, 312
826
- ]
827
-
828
- class << self
829
- attr_accessor :ami_protocol_parser_start
830
- end
831
- self.ami_protocol_parser_start = 258;
832
- class << self
833
- attr_accessor :ami_protocol_parser_first_final
834
- end
835
- self.ami_protocol_parser_first_final = 258;
836
- class << self
837
- attr_accessor :ami_protocol_parser_error
838
- end
839
- self.ami_protocol_parser_error = 0;
840
-
841
- class << self
842
- attr_accessor :ami_protocol_parser_en_irregularity
843
- end
844
- self.ami_protocol_parser_en_irregularity = 260;
845
- class << self
846
- attr_accessor :ami_protocol_parser_en_main
847
- end
848
- self.ami_protocol_parser_en_main = 258;
849
- class << self
850
- attr_accessor :ami_protocol_parser_en_protocol
851
- end
852
- self.ami_protocol_parser_en_protocol = 262;
853
- class << self
854
- attr_accessor :ami_protocol_parser_en_success
855
- end
856
- self.ami_protocol_parser_en_success = 152;
857
- class << self
858
- attr_accessor :ami_protocol_parser_en_response_follows
859
- end
860
- self.ami_protocol_parser_en_response_follows = 268;
861
-
862
-
863
- # line 864 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
864
- begin
865
- @current_pointer ||= 0
866
- @data_ending_pointer ||= @data.length
867
- @current_state = ami_protocol_parser_start
868
- @ragel_stack_top = 0
869
- @token_start = nil
870
- @token_end = nil
871
- @ragel_act = 0
872
- end
873
-
874
- # line 99 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
875
- ##
876
-
877
- end
878
-
879
- def <<(new_data)
880
- extend_buffer_with new_data
881
- resume!
882
- end
883
-
884
- def resume!
885
-
886
- # line 887 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
887
- begin
888
- _klen, _trans, _keys, _acts, _nacts = nil
889
- _goto_level = 0
890
- _resume = 10
891
- _eof_trans = 15
892
- _again = 20
893
- _test_eof = 30
894
- _out = 40
895
- while true
896
- _trigger_goto = false
897
- if _goto_level <= 0
898
- if @current_pointer == @data_ending_pointer
899
- _goto_level = _test_eof
900
- next
901
- end
902
- if @current_state == 0
903
- _goto_level = _out
904
- next
905
- end
906
- end
907
- if _goto_level <= _resume
908
- _acts = _ami_protocol_parser_from_state_actions[ @current_state]
909
- _nacts = _ami_protocol_parser_actions[_acts]
910
- _acts += 1
911
- while _nacts > 0
912
- _nacts -= 1
913
- _acts += 1
914
- case _ami_protocol_parser_actions[_acts - 1]
915
- when 30 then
916
- # line 1 "NONE"
917
- begin
918
- @token_start = @current_pointer
919
- end
920
- # line 921 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
921
- end # from state action switch
922
- end
923
- if _trigger_goto
924
- next
925
- end
926
- _keys = _ami_protocol_parser_key_offsets[ @current_state]
927
- _trans = _ami_protocol_parser_index_offsets[ @current_state]
928
- _klen = _ami_protocol_parser_single_lengths[ @current_state]
929
- _break_match = false
930
-
931
- begin
932
- if _klen > 0
933
- _lower = _keys
934
- _upper = _keys + _klen - 1
935
-
936
- loop do
937
- break if _upper < _lower
938
- _mid = _lower + ( (_upper - _lower) >> 1 )
939
-
940
- if @data[ @current_pointer].ord < _ami_protocol_parser_trans_keys[_mid]
941
- _upper = _mid - 1
942
- elsif @data[ @current_pointer].ord > _ami_protocol_parser_trans_keys[_mid]
943
- _lower = _mid + 1
944
- else
945
- _trans += (_mid - _keys)
946
- _break_match = true
947
- break
948
- end
949
- end # loop
950
- break if _break_match
951
- _keys += _klen
952
- _trans += _klen
953
- end
954
- _klen = _ami_protocol_parser_range_lengths[ @current_state]
955
- if _klen > 0
956
- _lower = _keys
957
- _upper = _keys + (_klen << 1) - 2
958
- loop do
959
- break if _upper < _lower
960
- _mid = _lower + (((_upper-_lower) >> 1) & ~1)
961
- if @data[ @current_pointer].ord < _ami_protocol_parser_trans_keys[_mid]
962
- _upper = _mid - 2
963
- elsif @data[ @current_pointer].ord > _ami_protocol_parser_trans_keys[_mid+1]
964
- _lower = _mid + 2
965
- else
966
- _trans += ((_mid - _keys) >> 1)
967
- _break_match = true
968
- break
969
- end
970
- end # loop
971
- break if _break_match
972
- _trans += _klen
973
- end
974
- end while false
975
- _trans = _ami_protocol_parser_indicies[_trans]
976
- end
977
- if _goto_level <= _eof_trans
978
- @current_state = _ami_protocol_parser_trans_targs[_trans]
979
- if _ami_protocol_parser_trans_actions[_trans] != 0
980
- _acts = _ami_protocol_parser_trans_actions[_trans]
981
- _nacts = _ami_protocol_parser_actions[_acts]
982
- _acts += 1
983
- while _nacts > 0
984
- _nacts -= 1
985
- _acts += 1
986
- case _ami_protocol_parser_actions[_acts - 1]
987
- when 0 then
988
- # line 37 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
989
- begin
990
- init_success end
991
- when 1 then
992
- # line 39 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
993
- begin
994
- init_response_follows end
995
- when 2 then
996
- # line 41 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
997
- begin
998
- init_error end
999
- when 3 then
1000
- # line 43 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1001
- begin
1002
- message_received @current_message end
1003
- when 4 then
1004
- # line 44 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1005
- begin
1006
- error_received @current_message end
1007
- when 5 then
1008
- # line 46 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1009
- begin
1010
- version_starts end
1011
- when 6 then
1012
- # line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1013
- begin
1014
- version_stops end
1015
- when 7 then
1016
- # line 49 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1017
- begin
1018
- key_starts end
1019
- when 8 then
1020
- # line 50 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1021
- begin
1022
- key_stops end
1023
- when 9 then
1024
- # line 52 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1025
- begin
1026
- value_starts end
1027
- when 10 then
1028
- # line 53 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1029
- begin
1030
- value_stops end
1031
- when 11 then
1032
- # line 55 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1033
- begin
1034
- error_reason_starts end
1035
- when 12 then
1036
- # line 56 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1037
- begin
1038
- error_reason_stops end
1039
- when 13 then
1040
- # line 58 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1041
- begin
1042
- syntax_error_starts end
1043
- when 14 then
1044
- # line 59 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1045
- begin
1046
- syntax_error_stops end
1047
- when 15 then
1048
- # line 61 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1049
- begin
1050
- immediate_response_starts end
1051
- when 16 then
1052
- # line 62 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1053
- begin
1054
- immediate_response_stops end
1055
- when 17 then
1056
- # line 64 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1057
- begin
1058
- follows_text_starts end
1059
- when 18 then
1060
- # line 65 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1061
- begin
1062
- follows_text_stops end
1063
- when 19 then
1064
- # line 67 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1065
- begin
1066
- event_name_starts end
1067
- when 20 then
1068
- # line 68 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1069
- begin
1070
- event_name_stops end
1071
- when 21 then
1072
- # line 34 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1073
- begin
1074
- begin
1075
- @current_state = 152
1076
- _trigger_goto = true
1077
- _goto_level = _again
1078
- break
1079
- end
1080
- end
1081
- when 22 then
1082
- # line 35 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1083
- begin
1084
- begin
1085
- @current_state = 152
1086
- _trigger_goto = true
1087
- _goto_level = _again
1088
- break
1089
- end
1090
- end
1091
- when 23 then
1092
- # line 36 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1093
- begin
1094
- begin
1095
- @current_state = 152
1096
- _trigger_goto = true
1097
- _goto_level = _again
1098
- break
1099
- end
1100
- end
1101
- when 24 then
1102
- # line 38 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1103
- begin
1104
- begin
1105
- @current_state = 268
1106
- _trigger_goto = true
1107
- _goto_level = _again
1108
- break
1109
- end
1110
- end
1111
- when 25 then
1112
- # line 43 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1113
- begin
1114
- begin
1115
- @ragel_stack_top -= 1
1116
- @current_state = @ragel_stack[ @ragel_stack_top]
1117
- _trigger_goto = true
1118
- _goto_level = _again
1119
- break
1120
- end
1121
- end
1122
- when 26 then
1123
- # line 78 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1124
- begin
1125
- begin
1126
- @current_state = 262
1127
- _trigger_goto = true
1128
- _goto_level = _again
1129
- break
1130
- end
1131
- end
1132
- when 27 then
1133
- # line 84 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1134
- begin
1135
- message_received @current_message; begin
1136
- @current_state = 262
1137
- _trigger_goto = true
1138
- _goto_level = _again
1139
- break
1140
- end
1141
- end
1142
- when 31 then
1143
- # line 1 "NONE"
1144
- begin
1145
- @token_end = @current_pointer+1
1146
- end
1147
- when 32 then
1148
- # line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1149
- begin
1150
- @ragel_act = 1; end
1151
- when 33 then
1152
- # line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1153
- begin
1154
- @token_end = @current_pointer+1
1155
- end
1156
- when 34 then
1157
- # line 48 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1158
- begin
1159
- @token_end = @current_pointer+1
1160
- begin begin
1161
- @ragel_stack_top -= 1
1162
- @current_state = @ragel_stack[ @ragel_stack_top]
1163
- _trigger_goto = true
1164
- _goto_level = _again
1165
- break
1166
- end
1167
- end
1168
- end
1169
- when 35 then
1170
- # line 47 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1171
- begin
1172
- @token_end = @current_pointer
1173
- @current_pointer = @current_pointer - 1; end
1174
- when 36 then
1175
- # line 1 "NONE"
1176
- begin
1177
- case @ragel_act
1178
- when 0 then
1179
- begin begin
1180
- @current_state = 0
1181
- _trigger_goto = true
1182
- _goto_level = _again
1183
- break
1184
- end
1185
- end
1186
- else
1187
- begin begin @current_pointer = (( @token_end))-1; end
1188
- end
1189
- end
1190
- end
1191
- when 37 then
1192
- # line 55 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1193
- begin
1194
- @token_end = @current_pointer+1
1195
- begin begin
1196
- @current_state = 262
1197
- _trigger_goto = true
1198
- _goto_level = _again
1199
- break
1200
- end
1201
- end
1202
- end
1203
- when 38 then
1204
- # line 56 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1205
- begin
1206
- @token_end = @current_pointer+1
1207
- begin
1208
- # If this scanner's look-ahead capability didn't match the prompt, let's ignore the need for a prompt
1209
- @current_pointer = @current_pointer - 1;
1210
- begin
1211
- @current_state = 262
1212
- _trigger_goto = true
1213
- _goto_level = _again
1214
- break
1215
- end
1216
-
1217
- end
1218
- end
1219
- when 39 then
1220
- # line 56 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1221
- begin
1222
- @token_end = @current_pointer
1223
- @current_pointer = @current_pointer - 1; begin
1224
- # If this scanner's look-ahead capability didn't match the prompt, let's ignore the need for a prompt
1225
- @current_pointer = @current_pointer - 1;
1226
- begin
1227
- @current_state = 262
1228
- _trigger_goto = true
1229
- _goto_level = _again
1230
- break
1231
- end
1232
-
1233
- end
1234
- end
1235
- when 40 then
1236
- # line 56 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1237
- begin
1238
- begin @current_pointer = (( @token_end))-1; end
1239
- begin
1240
- # If this scanner's look-ahead capability didn't match the prompt, let's ignore the need for a prompt
1241
- @current_pointer = @current_pointer - 1;
1242
- begin
1243
- @current_state = 262
1244
- _trigger_goto = true
1245
- _goto_level = _again
1246
- break
1247
- end
1248
-
1249
- end
1250
- end
1251
- when 41 then
1252
- # line 64 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1253
- begin
1254
- @token_end = @current_pointer+1
1255
- end
1256
- when 42 then
1257
- # line 65 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1258
- begin
1259
- @token_end = @current_pointer+1
1260
- end
1261
- when 43 then
1262
- # line 66 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1263
- begin
1264
- @token_end = @current_pointer+1
1265
- end
1266
- when 44 then
1267
- # line 67 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1268
- begin
1269
- @token_end = @current_pointer+1
1270
- end
1271
- when 45 then
1272
- # line 68 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1273
- begin
1274
- @token_end = @current_pointer+1
1275
- end
1276
- when 46 then
1277
- # line 69 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1278
- begin
1279
- @token_end = @current_pointer+1
1280
- end
1281
- when 47 then
1282
- # line 70 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1283
- begin
1284
- @token_end = @current_pointer+1
1285
- begin begin
1286
- @current_state = 262
1287
- _trigger_goto = true
1288
- _goto_level = _again
1289
- break
1290
- end
1291
- end
1292
- end
1293
- when 48 then
1294
- # line 71 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1295
- begin
1296
- @token_end = @current_pointer+1
1297
- begin
1298
- # If NONE of the above patterns match, we consider this a syntax error. The irregularity machine can recover gracefully.
1299
- @current_pointer = @current_pointer - 1;
1300
- begin
1301
- @ragel_stack[ @ragel_stack_top] = @current_state
1302
- @ragel_stack_top+= 1
1303
- @current_state = 260
1304
- _trigger_goto = true
1305
- _goto_level = _again
1306
- break
1307
- end
1308
-
1309
- end
1310
- end
1311
- when 49 then
1312
- # line 71 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1313
- begin
1314
- @token_end = @current_pointer
1315
- @current_pointer = @current_pointer - 1; begin
1316
- # If NONE of the above patterns match, we consider this a syntax error. The irregularity machine can recover gracefully.
1317
- @current_pointer = @current_pointer - 1;
1318
- begin
1319
- @ragel_stack[ @ragel_stack_top] = @current_state
1320
- @ragel_stack_top+= 1
1321
- @current_state = 260
1322
- _trigger_goto = true
1323
- _goto_level = _again
1324
- break
1325
- end
1326
-
1327
- end
1328
- end
1329
- when 50 then
1330
- # line 71 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1331
- begin
1332
- begin @current_pointer = (( @token_end))-1; end
1333
- begin
1334
- # If NONE of the above patterns match, we consider this a syntax error. The irregularity machine can recover gracefully.
1335
- @current_pointer = @current_pointer - 1;
1336
- begin
1337
- @ragel_stack[ @ragel_stack_top] = @current_state
1338
- @ragel_stack_top+= 1
1339
- @current_state = 260
1340
- _trigger_goto = true
1341
- _goto_level = _again
1342
- break
1343
- end
1344
-
1345
- end
1346
- end
1347
- when 51 then
1348
- # line 82 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1349
- begin
1350
- @ragel_act = 13; end
1351
- when 52 then
1352
- # line 84 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1353
- begin
1354
- @ragel_act = 15; end
1355
- when 53 then
1356
- # line 83 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1357
- begin
1358
- @token_end = @current_pointer+1
1359
- end
1360
- when 54 then
1361
- # line 82 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1362
- begin
1363
- @token_end = @current_pointer
1364
- @current_pointer = @current_pointer - 1; end
1365
- when 55 then
1366
- # line 84 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1367
- begin
1368
- @token_end = @current_pointer
1369
- @current_pointer = @current_pointer - 1; end
1370
- when 56 then
1371
- # line 82 "lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl"
1372
- begin
1373
- begin @current_pointer = (( @token_end))-1; end
1374
- end
1375
- when 57 then
1376
- # line 1 "NONE"
1377
- begin
1378
- case @ragel_act
1379
- when 0 then
1380
- begin begin
1381
- @current_state = 0
1382
- _trigger_goto = true
1383
- _goto_level = _again
1384
- break
1385
- end
1386
- end
1387
- else
1388
- begin begin @current_pointer = (( @token_end))-1; end
1389
- end
1390
- end
1391
- end
1392
- # line 1393 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
1393
- end # action switch
1394
- end
1395
- end
1396
- if _trigger_goto
1397
- next
1398
- end
1399
- end
1400
- if _goto_level <= _again
1401
- _acts = _ami_protocol_parser_to_state_actions[ @current_state]
1402
- _nacts = _ami_protocol_parser_actions[_acts]
1403
- _acts += 1
1404
- while _nacts > 0
1405
- _nacts -= 1
1406
- _acts += 1
1407
- case _ami_protocol_parser_actions[_acts - 1]
1408
- when 28 then
1409
- # line 1 "NONE"
1410
- begin
1411
- @token_start = nil; end
1412
- when 29 then
1413
- # line 1 "NONE"
1414
- begin
1415
- @ragel_act = 0
1416
- end
1417
- # line 1418 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb"
1418
- end # to state action switch
1419
- end
1420
- if _trigger_goto
1421
- next
1422
- end
1423
- if @current_state == 0
1424
- _goto_level = _out
1425
- next
1426
- end
1427
- @current_pointer += 1
1428
- if @current_pointer != @data_ending_pointer
1429
- _goto_level = _resume
1430
- next
1431
- end
1432
- end
1433
- if _goto_level <= _test_eof
1434
- if @current_pointer == @eof
1435
- if _ami_protocol_parser_eof_trans[ @current_state] > 0
1436
- _trans = _ami_protocol_parser_eof_trans[ @current_state] - 1;
1437
- _goto_level = _eof_trans
1438
- next;
1439
- end
1440
- end
1441
- end
1442
- if _goto_level <= _out
1443
- break
1444
- end
1445
- end
1446
- end
1447
-
1448
- # line 109 "lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb"
1449
- ##
1450
- end
1451
-
1452
- def extend_buffer_with(new_data)
1453
- length = new_data.size
1454
-
1455
- if length > BUFFER_SIZE
1456
- raise Exception, "ERROR: Buffer overrun! Input size (#{new_data.size}) larger than buffer (#{BUFFER_SIZE})"
1457
- end
1458
-
1459
- if length + @data.size > BUFFER_SIZE
1460
- if @data.size != @current_pointer
1461
- if @current_pointer < length
1462
- # We are about to shift more bytes off the array than we have
1463
- # parsed. This will cause the parser to lose state so
1464
- # integrity cannot be guaranteed.
1465
- raise Exception, "ERROR: Buffer overrun! AMI parser cannot guarantee sanity. New data size: #{new_data.size}; Current pointer at #{@current_pointer}; Data size: #{@data.size}"
1466
- end
1467
- end
1468
- @data.slice! 0...length
1469
- adjust_pointers -length
1470
- end
1471
- @data << new_data
1472
- @data_ending_pointer = @data.size
1473
- end
1474
-
1475
- protected
1476
-
1477
- ##
1478
- # This method will adjust all pointers into the buffer according
1479
- # to the supplied offset. This is necessary any time the buffer
1480
- # changes, for example when the sliding window is incremented forward
1481
- # after new data is received.
1482
- #
1483
- # It is VERY IMPORTANT that when any additional pointers are defined
1484
- # that they are added to this method. Unpredictable results may
1485
- # otherwise occur!
1486
- #
1487
- # @see https://adhearsion.lighthouseapp.com/projects/5871-adhearsion/tickets/72-ami-lexer-buffer-offset#ticket-72-26
1488
- #
1489
- # @param offset Adjust pointers by offset. May be negative.
1490
- #
1491
- def adjust_pointers(offset)
1492
- POINTERS.each do |ptr|
1493
- value = instance_variable_get(ptr)
1494
- instance_variable_set(ptr, value + offset) if !value.nil?
1495
- end
1496
- end
1497
-
1498
- ##
1499
- # Called after a response or event has been successfully parsed.
1500
- #
1501
- # @param [ManagerInterfaceResponse, ManagerInterfaceEvent] message The message just received
1502
- #
1503
- def message_received(message)
1504
- raise NotImplementedError, "Must be implemented in subclass!"
1505
- end
1506
-
1507
- ##
1508
- # Called when there is an Error: stanza on the socket. Could be caused by executing an unrecognized command, trying
1509
- # to originate into an invalid priority, etc. Note: many errors' responses are actually tightly coupled to a
1510
- # ManagerInterfaceEvent which comes directly after it. Often the message will say something like "Channel status
1511
- # will follow".
1512
- #
1513
- # @param [String] reason The reason given in the Message: header for the error stanza.
1514
- #
1515
- def error_received(reason)
1516
- raise NotImplementedError, "Must be implemented in subclass!"
1517
- end
1518
-
1519
- ##
1520
- # Called when there's a syntax error on the socket. This doesn't happen as often as it should because, in many cases,
1521
- # it's impossible to distinguish between a syntax error and an immediate packet.
1522
- #
1523
- # @param [String] ignored_chunk The offending text which caused the syntax error.
1524
- def syntax_error_encountered(ignored_chunk)
1525
- raise NotImplementedError, "Must be implemented in subclass!"
1526
- end
1527
-
1528
- def init_success
1529
- @current_message = ManagerInterfaceResponse.new
1530
- end
1531
-
1532
- def init_response_follows
1533
- @current_message = ManagerInterfaceResponse.new
1534
- end
1535
-
1536
- def init_error
1537
- @current_message = ManagerInterfaceError.new()
1538
- end
1539
-
1540
- def version_starts
1541
- @version_start = @current_pointer
1542
- end
1543
-
1544
- def version_stops
1545
- self.ami_version = @data[@version_start...@current_pointer].to_f
1546
- @version_start = nil
1547
- end
1548
-
1549
- def event_name_starts
1550
- @event_name_start = @current_pointer
1551
- end
1552
-
1553
- def event_name_stops
1554
- event_name = @data[@event_name_start...@current_pointer]
1555
- @event_name_start = nil
1556
- @current_message = ManagerInterfaceEvent.new(event_name)
1557
- end
1558
-
1559
- def key_starts
1560
- @current_key_position = @current_pointer
1561
- end
1562
-
1563
- def key_stops
1564
- @current_key = @data[@current_key_position...@current_pointer]
1565
- end
1566
-
1567
- def value_starts
1568
- @current_value_position = @current_pointer
1569
- end
1570
-
1571
- def value_stops
1572
- @current_value = @data[@current_value_position...@current_pointer]
1573
- @last_seen_value_end = @current_pointer + 2 # 2 for \r\n
1574
- add_pair_to_current_message
1575
- end
1576
-
1577
- def error_reason_starts
1578
- @error_reason_start = @current_pointer
1579
- end
1580
-
1581
- def error_reason_stops
1582
- @current_message.message = @data[@error_reason_start...@current_pointer]
1583
- end
1584
-
1585
- def follows_text_starts
1586
- @follows_text_start = @current_pointer
1587
- end
1588
-
1589
- def follows_text_stops
1590
- text = @data[@last_seen_value_end..@current_pointer]
1591
- text.sub! /\r?\n--END COMMAND--/, ""
1592
- @current_message.text_body = text
1593
- @follows_text_start = nil
1594
- end
1595
-
1596
- def add_pair_to_current_message
1597
- @current_message[@current_key] = @current_value
1598
- reset_key_and_value_positions
1599
- end
1600
-
1601
- def reset_key_and_value_positions
1602
- @current_key, @current_value, @current_key_position, @current_value_position = nil
1603
- end
1604
-
1605
- def syntax_error_starts
1606
- @current_syntax_error_start = @current_pointer # Adding 1 since the pointer is still set to the last successful match
1607
- end
1608
-
1609
- def syntax_error_stops
1610
- # Subtracting 3 from @current_pointer below for "\r\n" which separates a stanza
1611
- offending_data = @data[@current_syntax_error_start...@current_pointer - 1]
1612
- syntax_error_encountered offending_data
1613
- @current_syntax_error_start = nil
1614
- end
1615
-
1616
- def immediate_response_starts
1617
- @immediate_response_start = @current_pointer
1618
- end
1619
-
1620
- def immediate_response_stops
1621
- message = @data[@immediate_response_start...(@current_pointer -1)]
1622
- message_received ManagerInterfaceResponse.from_immediate_response(message)
1623
- end
1624
-
1625
- ##
1626
- # This method is used primarily in debugging.
1627
- #
1628
- def view_buffer(message=nil)
1629
-
1630
- message ||= "Viewing the buffer"
1631
-
1632
- buffer = @data.clone
1633
- buffer.insert(@current_pointer, "\033[0;31m\033[1;31m^\033[0m")
1634
-
1635
- buffer.gsub!("\r", "\\\\r")
1636
- buffer.gsub!("\n", "\\n\n")
1637
-
1638
- puts <<-INSPECTION
1639
- VVVVVVVVVVVVVVVVVVVVVVVVVVVVV
1640
- #### #{message}
1641
- #############################
1642
- #{buffer}
1643
- #############################
1644
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1645
- INSPECTION
1646
-
1647
- end
1648
- end
1649
- class DelegatingAsteriskManagerInterfaceLexer < AbstractAsteriskManagerInterfaceStreamLexer
1650
-
1651
- def initialize(delegate, method_delegation_map=nil)
1652
- super()
1653
- @delegate = delegate
1654
-
1655
- @message_received_method = method_delegation_map && method_delegation_map.has_key?(:message_received) ?
1656
- method_delegation_map[:message_received] : :message_received
1657
-
1658
- @error_received_method = method_delegation_map && method_delegation_map.has_key?(:error_received) ?
1659
- method_delegation_map[:error_received] : :error_received
1660
-
1661
- @syntax_error_method = method_delegation_map && method_delegation_map.has_key?(:syntax_error_encountered) ?
1662
- method_delegation_map[:syntax_error_encountered] : :syntax_error_encountered
1663
- end
1664
-
1665
- def message_received(message)
1666
- @delegate.send(@message_received_method, message)
1667
- end
1668
-
1669
- def error_received(message)
1670
- @delegate.send(@error_received_method, message)
1671
- end
1672
-
1673
- def syntax_error_encountered(ignored_chunk)
1674
- @delegate.send(@syntax_error_method, ignored_chunk)
1675
- end
1676
-
1677
- end
1678
- end
1679
- end
1680
- end
1681
- end