mtrudel-adhearsion 0.8.3

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