Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: prevent actor crash on AMI action when asterisk unavailable #600

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

serioja90
Copy link
Contributor

When a call starts while asterisk is running and before the call is answered or terminated asterisk becomes unavailable, further ami actions related to that call will result in Celluloid: Actor crashed! error messages. This is caused because ...Asterisk::AMIAction#send_actions() raises Celluloid::DeadActorError, that crashes the translator. Even if after a while asterisk becomes available, there isn't any translator to process AMI actions and events.
To fix this issue Celluloid::DeadActorError have to be caught within ...Asterisk::AMIAction#execute().

How to reproduce?

  1. Start a call and let it ring
  2. Kill asterisk process
  3. Try to hangup the call or wait until the call goes in timeout

After asterisk becomes unavailable, Adhearsion::Rayo::Initializer will try to reconnect to asterisk, but in this state any attempt to execute an AMI action will crash the translator.

  - When a call starts while asterisk is running and before the call
    is answered or terminated asterisk becomes unavailable, further ami
    actions related to that call will result in "Celluloid: Actor crashed!".
    This is caused because `...Asterisk::AMIAction#send_actions()` raises
    Celluloid::DeadActorError, that crashes the translator. Even if after
    a while asterisk becomes available, there isn't any translator to
    process AMI actions and events.
    To fix this issue Celluloid::DeadActorError have to be caught
    within `...Asterisk::AMIAction#execute()`.

Update CHANGELOG.md
@benlangfeld
Copy link
Member

Thanks for this considered contribution. I need to think this through a little; I have some pending thoughts about how we handle this more generally which I need to formalise.

@serioja90
Copy link
Contributor Author

Sure, take your time ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants