From 80c3aa7a30db5ae5f4648d40740b418e53177e17 Mon Sep 17 00:00:00 2001 From: Lulu Du Date: Mon, 4 Aug 2025 13:29:48 -0500 Subject: [PATCH] fix NoMethodError when command timeout --- lib/adhearsion/outbound_call.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/adhearsion/outbound_call.rb b/lib/adhearsion/outbound_call.rb index bce32cb1c..85750d465 100644 --- a/lib/adhearsion/outbound_call.rb +++ b/lib/adhearsion/outbound_call.rb @@ -94,7 +94,12 @@ def dial(to, options = {}) Adhearsion.active_calls << current_actor write_and_await_response(@dial_command, wait_timeout, true).tap do |dial_command| - @start_time = dial_command.timestamp.to_time + if dial_command.respond_to?(:timestamp) + @start_time = dial_command.timestamp.to_time + else + logger.warn "dial_command #{dial_command.inspect} did not respond to timestamp. @dial_command #{@dial_command.inspect}" + end + if @dial_command.uri != self.uri logger.warn "Requested call URI (#{uri}) was not respected. Tracking by new URI #{self.uri}. This might cause a race in event handling, please upgrade your Rayo server." Adhearsion.active_calls << current_actor