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

OutboundCall#on_end not executed on call failure #550

Open
lpradovera opened this issue May 25, 2015 · 2 comments
Open

OutboundCall#on_end not executed on call failure #550

lpradovera opened this issue May 25, 2015 · 2 comments
Milestone

Comments

@lpradovera
Copy link
Member

See logs and code here:
https://gist.github.com/polysics/76c45bdab87638aa2b32#file-gistfile1-txt-L220

The on_end handler defined in Adhearsion is run, while the application-defined one is not.

@benlangfeld
Copy link
Member

You register the callback too late. You should do it before OutboundCall#originate.

@benlangfeld benlangfeld modified the milestone: 3.0.0 Dec 20, 2015
@benlangfeld benlangfeld modified the milestones: 3.0.0, 3.1.0 Jan 5, 2016
@system123
Copy link

system123 commented Dec 6, 2016

I am experiencing this issue when a call is rejected. This is how the call is originated, yet sometimes if the call is rejected with ISDN code 21 then the on_end event is not triggered. Reproducible with around 25 active calls.

Adhearsion::OutboundCall: ae1363ae-7ed9-43c7-957b-385848347f46@�[0m: Call 27121110512 -> SIP/platforma/0720000035 ended due to reject (code 21)

The call is originated as follows:

def init_outbound(contact_ref)
    @contact_ref = contact_ref
    @route = :outbound
    @call = Adhearsion::OutboundCall.new
    @call[:callee] = self

    # Set the dialplan to execute for this agent
    metadata = {
      campaign: @campaign,
      callee: self,
    }
    @call.execute_controller_or_router_on_answer OutboundCalleeController, metadata
    @call.tag(@call_ref.to_s)

    @call.on_end { |event| callee_ended(event) }

    @dialled_time = Time.now
    @campaign.add_ringing_call @call_ref, @call 
    @call.dial @callee_address, from: @outbound_id
  end

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

No branches or pull requests

3 participants