Skip to content
Browse files

[BUGFIX] Incorrect uniqueid value in guard

  • Loading branch information...
1 parent 6c28e29 commit 65f44c535fa21e3a369436a712a10a3f23606fc3 @benlangfeld benlangfeld committed Jul 17, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/punchblock/translator/asterisk/call.rb
  2. +2 −2 spec/punchblock/translator/asterisk/call_spec.rb
View
2 lib/punchblock/translator/asterisk/call.rb
@@ -141,7 +141,7 @@ def process_ami_event(ami_event)
send_pb_event Event::Answered.new
end
when 'OriginateResponse'
- if ami_event['Response'] == 'Failure' && !ami_event['Uniqueid']
+ if ami_event['Response'] == 'Failure' && ami_event['Uniqueid'] == '<null>'
pb_logger.info "Outbound call could not be established!"
send_end_event :error
end
View
4 spec/punchblock/translator/asterisk/call_spec.rb
@@ -478,7 +478,7 @@ class Asterisk
context 'sucessful' do
let(:response) { 'Success' }
- let(:uniqueid) { nil }
+ let(:uniqueid) { '<null>' }
it 'should not send an end event' do
translator.expects(:handle_pb_event).once.with is_a(Punchblock::Event::Asterisk::AMI::Event)
@@ -498,7 +498,7 @@ class Asterisk
context 'failed without ever having connected' do
let(:response) { 'Failure' }
- let(:uniqueid) { nil }
+ let(:uniqueid) { '<null>' }
it 'should send an error end event' do
expected_end_event = Punchblock::Event::End.new :reason => :error,

0 comments on commit 65f44c5

Please sign in to comment.
Something went wrong with that request. Please try again.