asterisk-ari-client 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +85 -0
  6. data/Rakefile +54 -0
  7. data/asterisk-ari-client.gemspec +32 -0
  8. data/examples/list_channels.rb +14 -0
  9. data/examples/websocket.rb +33 -0
  10. data/lib/ari.rb +12 -0
  11. data/lib/ari/client.rb +124 -0
  12. data/lib/ari/generators/api.rb +23 -0
  13. data/lib/ari/generators/attribute.rb +35 -0
  14. data/lib/ari/generators/model.rb +38 -0
  15. data/lib/ari/generators/operation.rb +43 -0
  16. data/lib/ari/generators/parameter.rb +35 -0
  17. data/lib/ari/generators/property.rb +32 -0
  18. data/lib/ari/generators/resource_generator.rb +94 -0
  19. data/lib/ari/generators/templates/model.rb.erb +36 -0
  20. data/lib/ari/generators/templates/resource.rb.erb +97 -0
  21. data/lib/ari/list_resource.rb +23 -0
  22. data/lib/ari/model.rb +26 -0
  23. data/lib/ari/models.rb +47 -0
  24. data/lib/ari/models/.DS_Store +0 -0
  25. data/lib/ari/models/application_replaced.rb +17 -0
  26. data/lib/ari/models/asterisk_info.rb +35 -0
  27. data/lib/ari/models/bridge_attended_transfer.rb +63 -0
  28. data/lib/ari/models/bridge_blind_transfer.rb +35 -0
  29. data/lib/ari/models/bridge_created.rb +23 -0
  30. data/lib/ari/models/bridge_destroyed.rb +23 -0
  31. data/lib/ari/models/bridge_merged.rb +27 -0
  32. data/lib/ari/models/build_info.rb +19 -0
  33. data/lib/ari/models/caller_id.rb +19 -0
  34. data/lib/ari/models/channel_caller_id.rb +23 -0
  35. data/lib/ari/models/channel_created.rb +23 -0
  36. data/lib/ari/models/channel_destroyed.rb +23 -0
  37. data/lib/ari/models/channel_dialplan.rb +23 -0
  38. data/lib/ari/models/channel_dtmf_received.rb +23 -0
  39. data/lib/ari/models/channel_entered_bridge.rb +27 -0
  40. data/lib/ari/models/channel_hangup_request.rb +23 -0
  41. data/lib/ari/models/channel_left_bridge.rb +27 -0
  42. data/lib/ari/models/channel_state_change.rb +23 -0
  43. data/lib/ari/models/channel_talking_finished.rb +23 -0
  44. data/lib/ari/models/channel_talking_started.rb +23 -0
  45. data/lib/ari/models/channel_userevent.rb +35 -0
  46. data/lib/ari/models/channel_varset.rb +23 -0
  47. data/lib/ari/models/config_info.rb +27 -0
  48. data/lib/ari/models/device_state_changed.rb +23 -0
  49. data/lib/ari/models/dial.rb +31 -0
  50. data/lib/ari/models/dialed.rb +17 -0
  51. data/lib/ari/models/dialplan_cep.rb +19 -0
  52. data/lib/ari/models/endpoint_state_change.rb +23 -0
  53. data/lib/ari/models/format_lang_pair.rb +19 -0
  54. data/lib/ari/models/live_recording.rb +19 -0
  55. data/lib/ari/models/message.rb +19 -0
  56. data/lib/ari/models/missing_params.rb +19 -0
  57. data/lib/ari/models/playback_finished.rb +23 -0
  58. data/lib/ari/models/playback_started.rb +23 -0
  59. data/lib/ari/models/recording_failed.rb +23 -0
  60. data/lib/ari/models/recording_finished.rb +23 -0
  61. data/lib/ari/models/recording_started.rb +23 -0
  62. data/lib/ari/models/set_id.rb +19 -0
  63. data/lib/ari/models/stasis_end.rb +23 -0
  64. data/lib/ari/models/stasis_start.rb +27 -0
  65. data/lib/ari/models/status_info.rb +27 -0
  66. data/lib/ari/models/stored_recording.rb +19 -0
  67. data/lib/ari/models/system_info.rb +19 -0
  68. data/lib/ari/models/text_message.rb +23 -0
  69. data/lib/ari/models/text_message_received.rb +27 -0
  70. data/lib/ari/models/text_message_variable.rb +19 -0
  71. data/lib/ari/models/variable.rb +19 -0
  72. data/lib/ari/request_error.rb +8 -0
  73. data/lib/ari/resource.rb +37 -0
  74. data/lib/ari/resources.rb +11 -0
  75. data/lib/ari/resources/application.rb +101 -0
  76. data/lib/ari/resources/asterisk.rb +72 -0
  77. data/lib/ari/resources/bridge.rb +286 -0
  78. data/lib/ari/resources/channel.rb +610 -0
  79. data/lib/ari/resources/device_state.rb +98 -0
  80. data/lib/ari/resources/endpoint.rb +124 -0
  81. data/lib/ari/resources/event.rb +25 -0
  82. data/lib/ari/resources/mailbox.rb +99 -0
  83. data/lib/ari/resources/playback.rb +86 -0
  84. data/lib/ari/resources/recording.rb +241 -0
  85. data/lib/ari/resources/sound.rb +64 -0
  86. data/lib/ari/server_error.rb +8 -0
  87. data/lib/asterisk/ari/client.rb +10 -0
  88. data/lib/asterisk/ari/client/version.rb +7 -0
  89. data/test/fixtures/bridge_create.json +74 -0
  90. data/test/fixtures/bridge_get.json +74 -0
  91. data/test/fixtures/bridges_list.json +76 -0
  92. data/test/fixtures/channel_get.json +83 -0
  93. data/test/fixtures/channel_originate.json +83 -0
  94. data/test/fixtures/channel_originate_with_id.json +83 -0
  95. data/test/fixtures/channels_list.json +105 -0
  96. data/test/lib/asterisk-ari-client/.DS_Store +0 -0
  97. data/test/lib/asterisk-ari-client/bridge_test.rb +46 -0
  98. data/test/lib/asterisk-ari-client/channel_test.rb +59 -0
  99. data/test/test_helper.rb +42 -0
  100. metadata +265 -0
@@ -0,0 +1,27 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelLeftBridge < Event
14
+
15
+ attr_reader :bridge, :channel
16
+
17
+ def bridge=(val)
18
+ @bridge ||= Bridge.new(val)
19
+ end
20
+
21
+ def channel=(val)
22
+ @channel ||= Channel.new(val)
23
+ end
24
+
25
+
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelStateChange < Event
14
+
15
+ attr_reader :channel
16
+
17
+ def channel=(val)
18
+ @channel ||= Channel.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelTalkingFinished < Event
14
+
15
+ attr_reader :channel, :duration
16
+
17
+ def channel=(val)
18
+ @channel ||= Channel.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelTalkingStarted < Event
14
+
15
+ attr_reader :channel
16
+
17
+ def channel=(val)
18
+ @channel ||= Channel.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,35 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelUserevent < Event
14
+
15
+ attr_reader :eventname, :channel, :bridge, :endpoint, :userevent
16
+
17
+ def channel=(val)
18
+ @channel ||= Channel.new(val)
19
+ end
20
+
21
+ def bridge=(val)
22
+ @bridge ||= Bridge.new(val)
23
+ end
24
+
25
+ def endpoint=(val)
26
+ @endpoint ||= Endpoint.new(val)
27
+ end
28
+
29
+ def userevent=(val)
30
+ @userevent ||= object.new(val)
31
+ end
32
+
33
+
34
+ end
35
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ChannelVarset < Event
14
+
15
+ attr_reader :variable, :value, :channel
16
+
17
+ def channel=(val)
18
+ @channel ||= Channel.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class ConfigInfo < Model
14
+
15
+ attr_reader :name, :default_language, :max_channels, :max_open_files, :max_load, :setid
16
+
17
+ def max_load=(val)
18
+ @max_load ||= double.new(val)
19
+ end
20
+
21
+ def setid=(val)
22
+ @setid ||= SetId.new(val)
23
+ end
24
+
25
+
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class DeviceStateChanged < Event
14
+
15
+ attr_reader :device_state
16
+
17
+ def device_state=(val)
18
+ @device_state ||= DeviceState.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,31 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class Dial < Event
14
+
15
+ attr_reader :caller, :peer, :forward, :forwarded, :dialstring, :dialstatus
16
+
17
+ def caller=(val)
18
+ @caller ||= Channel.new(val)
19
+ end
20
+
21
+ def peer=(val)
22
+ @peer ||= Channel.new(val)
23
+ end
24
+
25
+ def forwarded=(val)
26
+ @forwarded ||= Channel.new(val)
27
+ end
28
+
29
+
30
+ end
31
+ end
@@ -0,0 +1,17 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class Dialed < Model
14
+
15
+
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class DialplanCEP < Model
14
+
15
+ attr_reader :context, :exten, :priority
16
+
17
+
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class EndpointStateChange < Event
14
+
15
+ attr_reader :endpoint
16
+
17
+ def endpoint=(val)
18
+ @endpoint ||= Endpoint.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class FormatLangPair < Model
14
+
15
+ attr_reader :language, :format
16
+
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class LiveRecording < Model
14
+
15
+ attr_reader :name, :format, :target_uri, :state, :duration, :talking_duration, :silence_duration, :cause
16
+
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class Message < Model
14
+
15
+ attr_reader :type
16
+
17
+
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class MissingParams < Message
14
+
15
+ attr_reader :params
16
+
17
+
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class PlaybackFinished < Event
14
+
15
+ attr_reader :playback
16
+
17
+ def playback=(val)
18
+ @playback ||= Playback.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ #------------------------------------------------------------------------------
2
+ #
3
+ # WARNING !
4
+ #
5
+ # This is a generated file. DO NOT EDIT THIS FILE! Your changes will
6
+ # be lost the next time this file is regenerated.
7
+ #
8
+ # This file was generated using asterisk-ari-client ruby gem.
9
+ #
10
+ #------------------------------------------------------------------------------
11
+
12
+ module Ari
13
+ class PlaybackStarted < Event
14
+
15
+ attr_reader :playback
16
+
17
+ def playback=(val)
18
+ @playback ||= Playback.new(val)
19
+ end
20
+
21
+
22
+ end
23
+ end