-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch mod_rayo to fix idle timeout for connect verb
- Loading branch information
Showing
7 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ module Command | |
end | ||
|
||
require_relative "command/twilio_stream" | ||
require_relative "command/update_call_progress" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "adhearsion/rayo/command_node" | ||
|
||
module Rayo | ||
module Command | ||
class UpdateCallProgress < Adhearsion::Rayo::CommandNode | ||
register :call_progress, :core | ||
|
||
attribute :status | ||
|
||
def rayo_attributes | ||
{ "flag" => flag } | ||
end | ||
|
||
private | ||
|
||
def flag | ||
status == :in_progress ? 1 : 0 | ||
end | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
components/app/spec/lib/rayo/command/update_call_progress_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require "spec_helper" | ||
|
||
module Rayo | ||
module Command | ||
RSpec.describe UpdateCallProgress do | ||
describe "#to_xml" do | ||
it "serializes to Rayo XML" do | ||
xml = Hash.from_xml(UpdateCallProgress.new(status: :in_progress).to_xml) | ||
expect(xml.fetch("call_progress")).to include("flag" => "1") | ||
|
||
xml = Hash.from_xml(UpdateCallProgress.new(status: :stopped).to_xml) | ||
expect(xml.fetch("call_progress")).to include("flag" => "0") | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters