lib/mock/twilio/webhooks/call_status_updates.rb in mock-twilio-1.1.0 vs lib/mock/twilio/webhooks/call_status_updates.rb in mock-twilio-1.2.0

- old
+ new

@@ -4,17 +4,17 @@ module Twilio module Webhooks class CallStatusUpdates < Base URL = "/api/v1/twilio_calls/voice_responses" - def self.trigger(sid, conference_uuid, answered_by) + def self.trigger(sid, conference_uuid, answered_by, call_status) # Wait simulation from twilio sleep DELAY.sample request_url = Mock::Twilio.proto + "://" + Mock::Twilio.forwarded_host + URL - data = call_status_updates_data(sid, conference_uuid, answered_by) + data = call_status_updates_data(sid, conference_uuid, answered_by, call_status) signature = build_signature_for_request(request_url, data) response = webhook_client.request(Mock::Twilio.host, Mock::Twilio.port, @@ -31,11 +31,11 @@ when 400..600 raise Webhooks::RestError, Mock::Twilio::ErrorHandler.new(response).raise end end - def self.call_status_updates_data(sid, conference_uuid, answered_by) + def self.call_status_updates_data(sid, conference_uuid, answered_by, call_status) { :AccountSid=> twilio_client.account_sid, :ApiVersion=> "2010-04-01", :CallbackSource=> "call-progress-events", :CallDuration=> "0", @@ -48,10 +48,10 @@ :CallerCity=> "no value", :CallerCountry=> "US", :CallerState=> "CA", :CallerZip=> "no value", :CallSid=> sid, - :CallStatus=> "in-progress", + :CallStatus=> call_status, :Direction=> "outbound-api", :Duration=> "0", :From=> "+18111111111", :FromCity=> "no value", :FromCountry=> "US",