electric_slide 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a85c9a483bad9fb21fb302c8914f74323d5f41b
4
- data.tar.gz: 596262ea3479ca13f5031a46fe84210732b1c558
3
+ metadata.gz: baa91eec756c74ee16f54754dc6e3233d112ea1d
4
+ data.tar.gz: 9082bca23ef76e4d3c746bbc379ffb4806fd9c26
5
5
  SHA512:
6
- metadata.gz: 606297daca9e364dd4ddfa7daa47578183ff6d359fcb1d4b66daacbba7786d36e4cbd36aa180c6c80fbd75645c390b55ecbb5dcf862df6f98ccb3c7cab844f8e
7
- data.tar.gz: 1771312a5bbda69e0b2fe802cb3510ee66cc34c158d36b69ec11efc5a0f960c4a955c3869269c333ec81ec2300ceb325d66b0b40e7750d13c76a32476e622b67
6
+ metadata.gz: 753e438b9d3fdf9d8f9b28ffbe6c230b71b82bca4ca79353e02a1746dc82e20fb1dd8826062acbc146c7ad9a5ce1cbec7d8ea9b55d65ebdc95894e99d83e294f
7
+ data.tar.gz: 47457cd3078318a5977e3361c63ee1d1409928bdf11856477bfdfeea085d7304987f66ade7e9c655acbe836673b37d05555ddf5b2167ac54f659e8b30af6235c
@@ -1,5 +1,8 @@
1
1
  # [develop](https://github.com/adhearsion/electric_slide)
2
2
 
3
+ # [0.4.1](https://github.com/adhearsion/electric_slide/compare/v0.4.0...v0.4.1) - [2016-01-04](https://rubygems.org/gems/adhearsion/versions/0.4.1)
4
+ * Bugfix: Don't hand out internal CallQueue references to Agents - thread-safety
5
+
3
6
  # [0.4.0](https://github.com/adhearsion/electric_slide/compare/v0.3.0...v0.4.0) - [2015-12-17](https://rubygems.org/gems/adhearsion/versions/0.4.0)
4
7
  * Change `ElectricSlide::Agent` `#presence=` method name to `#update_presence`. It will also accept one more parameter called `extra_params`, a hash that holds application specific parameters that are passed to the presence change callback.
5
8
  * `ElectricSlide::CallQueue#add_agent` will no longer wait for a connection attempt to complete before returning
@@ -164,7 +164,7 @@ class ElectricSlide
164
164
  abort ArgumentError.new("#add_agent called with nil object") if agent.nil?
165
165
  abort DuplicateAgentError.new("Agent is already in the queue") if get_agent(agent.id)
166
166
 
167
- agent.queue = self
167
+ agent.queue = current_actor
168
168
 
169
169
  case @connection_type
170
170
  when :call
@@ -177,7 +177,7 @@ class ElectricSlide
177
177
  @agents << agent
178
178
  @strategy << agent if agent.presence == :available
179
179
  # Fake the presence callback since this is a new agent
180
- agent.callback :presence_change, self, agent.call, agent.presence, :unavailable
180
+ agent.callback :presence_change, current_actor, agent.call, agent.presence, :unavailable
181
181
 
182
182
  async.check_for_connections
183
183
  end
@@ -304,7 +304,7 @@ class ElectricSlide
304
304
  ignoring_ended_calls do
305
305
  if agent.call && agent.call.active?
306
306
  logger.warn "Dead call exception in #connect but agent call still alive, reinserting into queue"
307
- agent.callback :connection_failed, self, agent.call, queued_call
307
+ agent.callback :connection_failed, current_actor, agent.call, queued_call
308
308
 
309
309
  return_agent agent
310
310
  end
@@ -367,8 +367,10 @@ class ElectricSlide
367
367
  # Stash the caller ID so we don't have to try to get it from a dead call object later
368
368
  queued_caller_id = remote_party queued_call
369
369
 
370
+ queue = current_actor
371
+
370
372
  # The call controller is actually run by #dial, here we skip joining if we do not have one
371
- dial_options = agent.dial_options_for(self, queued_call)
373
+ dial_options = agent.dial_options_for(queue, queued_call)
372
374
  unless dial_options[:confirm]
373
375
  agent_call.on_answer { ignoring_ended_calls { agent_call.join queued_call.uri if queued_call.active? } }
374
376
  end
@@ -394,12 +396,12 @@ class ElectricSlide
394
396
 
395
397
  agent.call = nil
396
398
 
397
- agent.callback :disconnect, self, agent_call, queued_call
399
+ agent.callback :disconnect, queue, agent_call, queued_call
398
400
 
399
401
  unless connected
400
402
  if queued_call.active?
401
403
  ignoring_ended_calls { priority_enqueue queued_call }
402
- agent.callback :connection_failed, self, agent_call, queued_call
404
+ agent.callback :connection_failed, queue, agent_call, queued_call
403
405
 
404
406
  logger.warn "Call did not connect to agent! Agent #{agent.id} call ended with #{end_event.reason}; reinserting caller #{queued_caller_id} into queue"
405
407
  else
@@ -408,7 +410,7 @@ class ElectricSlide
408
410
  end
409
411
  end
410
412
 
411
- agent.callback :connect, self, agent_call, queued_call
413
+ agent.callback :connect, queue, agent_call, queued_call
412
414
 
413
415
  agent_call.execute_controller_or_router_on_answer dial_options.delete(:confirm), dial_options.delete(:confirm_metadata)
414
416
 
@@ -420,8 +422,9 @@ class ElectricSlide
420
422
  queued_caller_id = remote_party queued_call
421
423
  agent.call[:queued_call] = queued_call
422
424
 
425
+ queue = current_actor
423
426
  agent.call.register_tmp_handler :event, Punchblock::Event::Unjoined do
424
- agent.callback :disconnect, self, agent.call, queued_call
427
+ agent.callback :disconnect, queue, agent.call, queued_call
425
428
  ignoring_ended_calls { queued_call.hangup }
426
429
  ignoring_ended_calls { conditionally_return_agent agent if agent.call && agent.call.active? }
427
430
  agent.call[:queued_call] = nil if agent.call
@@ -431,13 +434,13 @@ class ElectricSlide
431
434
  queued_call[:electric_slide_connected_at] = event.timestamp
432
435
  end
433
436
 
434
- agent.callback :connect, self, agent.call, queued_call
437
+ agent.callback :connect, current_actor, agent.call, queued_call
435
438
 
436
439
  agent.join queued_call if queued_call.active?
437
440
  rescue *ENDED_CALL_EXCEPTIONS
438
441
  ignoring_ended_calls do
439
442
  if agent.call && agent.call.active?
440
- agent.callback :connection_failed, self, agent.call, queued_call
443
+ agent.callback :connection_failed, current_actor, agent.call, queued_call
441
444
 
442
445
  logger.info "Caller #{queued_caller_id} failed to connect to Agent #{agent.id} due to caller hangup"
443
446
  conditionally_return_agent agent, :auto
@@ -458,7 +461,7 @@ class ElectricSlide
458
461
  abort ArgumentError.new("Agent has no active call") unless agent.call && agent.call.active?
459
462
  unless agent.call[:electric_slide_callback_set]
460
463
  agent.call[:electric_slide_callback_set] = true
461
- queue = self
464
+ queue = current_actor
462
465
  agent.call.on_end do
463
466
  agent.call = nil
464
467
  queue.return_agent agent, :unavailable
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  class ElectricSlide
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: electric_slide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Klang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adhearsion