Skip to content

Commit

Permalink
Avoid race conditions in processing calls
Browse files Browse the repository at this point in the history
Methods called on Asterisk calls are always dispatched through the translator. Those which call back to the translator should do so within the task rather than exposing race conditions (and performance impact) of calling back through the translator actor proxy.
  • Loading branch information
benlangfeld committed Aug 19, 2015
1 parent 40edc2e commit 14f6e76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,4 +1,5 @@
# [develop](https://github.com/adhearsion/punchblock)
* Bugfix: Avoid race conditions in processing calls with interactions between them

# [v2.7.3](https://github.com/adhearsion/punchblock/compare/v2.7.2...v2.7.3) - [2015-08-18](https://rubygems.org/gems/punchblock/versions/2.7.3)
* Bugfix: Handle correct event for confirming that a component stop was completed on Asterisk 13
Expand Down
4 changes: 2 additions & 2 deletions lib/punchblock/translator/asterisk.rb
Expand Up @@ -151,7 +151,7 @@ def execute_global_command(command)
if call = call_with_id(command.uri)
command.response = ProtocolError.new.setup(:conflict, 'Call ID already in use')
else
call = Call.new command.to, current_actor, ami_client, connection, nil, command.uri
call = Call.new command.to, self, ami_client, connection, nil, command.uri
register_call call
call.dial command
end
Expand Down Expand Up @@ -231,7 +231,7 @@ def handle_async_agi_start_event(event)

return if env[:agi_extension] == 'h' || env[:agi_type] == 'Kill'

call = Call.new event['Channel'], current_actor, ami_client, connection, env
call = Call.new event['Channel'], self, ami_client, connection, env
register_call call
call.send_offer
end
Expand Down

0 comments on commit 14f6e76

Please sign in to comment.