punchblock 2.7.1 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35195771cc15e2610a1150b15154cf6c3116db63
4
- data.tar.gz: bf32f24e8587d6463bb1c8a358fe3ebd78524756
3
+ metadata.gz: 02c18140e4e4849651937dbae454e815b0674579
4
+ data.tar.gz: 5465841458d3d77df6b362ed694ad34978678bf4
5
5
  SHA512:
6
- metadata.gz: e48260063f15f468c12306ae1b109d75499d18eb6bbfc0d18aca8dec0db385c537e661242f73e8f1b58d70a19042afc96875ac7bec11281b668a270b381938e5
7
- data.tar.gz: 9f595263dae20bb2d44cc0f630e35da720e5063e1b4a89b79ebf7b8625ed58d2ebe811e0197fb0e50cfdb5761da99f12cf356016bc39d6cc5a6d147d3651eac7
6
+ metadata.gz: ee18823aea7cdba8ab462c4cf9571d894b4a35412bbf489c9c02adbd505ea4e4110a3e72d0a12c723d317b21c96f70d9e78345109ed86a26d505e791df88fede
7
+ data.tar.gz: 7416b6895971bcebd5e97b4886e7c9094a3673329c61717ce2245b25d82523d3f7e5c6a5fc85b86285244cfadf20730c725a8d313346b75d1b98b5288ccf8d94
@@ -1,5 +1,8 @@
1
1
  # [develop](https://github.com/adhearsion/punchblock)
2
2
 
3
+ # [v2.7.2](https://github.com/adhearsion/punchblock/compare/v2.7.1...v2.7.2) - [2015-08-10](https://rubygems.org/gems/punchblock/versions/2.7.2)
4
+ * Bugfix: Process joined events on Asterisk 13 in any order, avoiding Join command timeouts
5
+
3
6
  # [v2.7.1](https://github.com/adhearsion/punchblock/compare/v2.7.0...v2.7.1) - [2015-07-14](https://rubygems.org/gems/punchblock/versions/2.7.1)
4
7
  * Bugfix: Ensure components are deregistered from asterisk translator once the call is ended ([#250](https://github.com/adhearsion/punchblock/pull/250))
5
8
 
@@ -139,7 +139,8 @@ module Punchblock
139
139
  when 'BridgeEnter'
140
140
  if other_call_channel = translator.bridges.delete(ami_event['BridgeUniqueid'])
141
141
  if other_call = translator.call_for_channel(other_call_channel)
142
- join_command = other_call.pending_joins.delete channel
142
+ join_command = @pending_joins.delete other_call_channel
143
+ join_command ||= other_call.pending_joins.delete channel
143
144
  join_command.response = true if join_command
144
145
 
145
146
  event = Event::Joined.new call_uri: other_call.id, timestamp: ami_event.best_time
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Punchblock
4
- VERSION = "2.7.1"
4
+ VERSION = "2.7.2"
5
5
  end
@@ -836,11 +836,11 @@ module Punchblock
836
836
  Punchblock::Command::Join.new call_uri: other_call_id
837
837
  end
838
838
 
839
- let :ami_event do
839
+ let :second_ami_event do
840
840
  RubyAMI::Event.new 'BridgeEnter',
841
841
  'Privilege' => "call,all",
842
842
  'BridgeUniqueid' => bridge_uniqueid,
843
- 'Channel' => call_channel
843
+ 'Channel' => other_channel
844
844
  end
845
845
 
846
846
  let :expected_joined do
@@ -854,27 +854,49 @@ module Punchblock
854
854
  end
855
855
 
856
856
  before do
857
- translator.bridges[bridge_uniqueid] = other_channel
857
+ translator.register_call subject
858
858
  translator.register_call other_call
859
-
860
- other_call.pending_joins[channel] = command
861
859
  command.request!
862
860
  expect(subject).to receive(:execute_agi_command).and_return code: 200
863
861
  subject.execute_command command
862
+ translator.handle_ami_event ami_event
864
863
  end
865
864
 
866
865
  it 'sends the correct Joined events' do
867
866
  expect(translator).to receive(:handle_pb_event).with expected_joined
868
867
  expect(translator).to receive(:handle_pb_event).with expected_joined_other
869
- subject.process_ami_event ami_event
868
+ translator.handle_ami_event second_ami_event
870
869
  expect(command.response(0.5)).to eq(true)
871
870
  end
871
+
872
+ context 'out of order' do
873
+ let :ami_event do
874
+ RubyAMI::Event.new 'BridgeEnter',
875
+ 'Privilege' => "call,all",
876
+ 'BridgeUniqueid' => bridge_uniqueid,
877
+ 'Channel' => other_channel
878
+ end
879
+
880
+ let :second_ami_event do
881
+ RubyAMI::Event.new 'BridgeEnter',
882
+ 'Privilege' => "call,all",
883
+ 'BridgeUniqueid' => bridge_uniqueid,
884
+ 'Channel' => call_channel
885
+ end
886
+
887
+ it 'sends the correct Joined events' do
888
+ expect(translator).to receive(:handle_pb_event).with expected_joined
889
+ expect(translator).to receive(:handle_pb_event).with expected_joined_other
890
+ translator.handle_ami_event second_ami_event
891
+ expect(command.response(0.5)).to eq(true)
892
+ end
893
+ end
872
894
  end
873
895
  end
874
896
 
875
897
  context 'with a BridgeLeave event' do
876
898
  let(:bridge_uniqueid) { "1234-5678" }
877
- let(:call_channel) { "SIP/foo-1234" }
899
+ let(:call_channel) { "SIP/foo" }
878
900
  let :ami_event do
879
901
  RubyAMI::Event.new 'BridgeLeave',
880
902
  'Privilege' => "call,all",
@@ -896,11 +918,11 @@ module Punchblock
896
918
  end
897
919
  let(:other_call_id) { other_call.id }
898
920
 
899
- let :ami_event do
921
+ let :second_ami_event do
900
922
  RubyAMI::Event.new 'BridgeLeave',
901
923
  'Privilege' => "call,all",
902
924
  'BridgeUniqueid' => bridge_uniqueid,
903
- 'Channel' => call_channel
925
+ 'Channel' => other_channel
904
926
  end
905
927
 
906
928
  let :expected_unjoined do
@@ -914,14 +936,37 @@ module Punchblock
914
936
  end
915
937
 
916
938
  before do
917
- translator.bridges[bridge_uniqueid + '_leave'] = other_channel
939
+ translator.register_call subject
918
940
  translator.register_call other_call
941
+ translator.handle_ami_event ami_event
919
942
  end
920
943
 
921
944
  it 'sends the correct Unjoined events' do
922
945
  expect(translator).to receive(:handle_pb_event).with expected_unjoined
923
946
  expect(translator).to receive(:handle_pb_event).with expected_unjoined_other
924
- subject.process_ami_event ami_event
947
+ translator.handle_ami_event second_ami_event
948
+ end
949
+
950
+ context 'out of order' do
951
+ let :ami_event do
952
+ RubyAMI::Event.new 'BridgeLeave',
953
+ 'Privilege' => "call,all",
954
+ 'BridgeUniqueid' => bridge_uniqueid,
955
+ 'Channel' => other_channel
956
+ end
957
+
958
+ let :second_ami_event do
959
+ RubyAMI::Event.new 'BridgeLeave',
960
+ 'Privilege' => "call,all",
961
+ 'BridgeUniqueid' => bridge_uniqueid,
962
+ 'Channel' => call_channel
963
+ end
964
+
965
+ it 'sends the correct Unjoined events' do
966
+ expect(translator).to receive(:handle_pb_event).with expected_unjoined
967
+ expect(translator).to receive(:handle_pb_event).with expected_unjoined_other
968
+ translator.handle_ami_event second_ami_event
969
+ end
925
970
  end
926
971
  end
927
972
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punchblock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Goecke
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-07-14 00:00:00.000000000 Z
13
+ date: 2015-08-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri