ruby-asterisk 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -74,19 +74,19 @@ module RubyAsterisk
|
|
74
74
|
_data[:hints].each do |hint|
|
75
75
|
case hint["Status"]
|
76
76
|
when "-1"
|
77
|
-
hint["
|
77
|
+
hint["DescriptiveStatus"] = "Extension not found"
|
78
78
|
when "0"
|
79
|
-
hint["
|
79
|
+
hint["DescriptiveStatus"] = "Idle"
|
80
80
|
when "1"
|
81
|
-
hint["
|
81
|
+
hint["DescriptiveStatus"] = "In Use"
|
82
82
|
when "2"
|
83
|
-
hint["
|
83
|
+
hint["DescriptiveStatus"] = "Busy"
|
84
84
|
when "4"
|
85
|
-
hint["
|
85
|
+
hint["DescriptiveStatus"] = "Unavailable"
|
86
86
|
when "8"
|
87
|
-
hint["
|
87
|
+
hint["DescriptiveStatus"] = "Ringing"
|
88
88
|
when "16"
|
89
|
-
hint["
|
89
|
+
hint["DescriptiveStatus"] = "On Hold"
|
90
90
|
end
|
91
91
|
end
|
92
92
|
_data
|
@@ -149,7 +149,8 @@ describe RubyAsterisk::Response do
|
|
149
149
|
|
150
150
|
it "should correctly fill the fields" do
|
151
151
|
@response = RubyAsterisk::Response.new("ExtensionState",extension_state_response)
|
152
|
-
@response.data[:hints][0]["Status"].should eq("
|
152
|
+
@response.data[:hints][0]["Status"].should eq("0")
|
153
|
+
@response.data[:hints][0]["DescriptiveStatus"].should eq("Idle")
|
153
154
|
end
|
154
155
|
end
|
155
156
|
end
|