detect if ouutbound call is never picked up

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

detect if ouutbound call is never picked up

Douglas Seifert
I am making outbound calls via a DRB listener and want to run logic if 1) The call is answered, but the TTD menu code reaches a non-ack branch (this is working fine) or 2) The call is never picked up in the first place.  For case 2), since the outbound call controller never runs, I think I could instead set an event handler on the Call object that is returned by the Adhearsion::OutboundCall.originate method.

My asks: is my assumption correct? If so, what is the name of the event?  Something like:

call = Adhearsion::OutboundCall.originate ...
call.register_event_handler ??

I am at a loss as to how to proceed.  I am using Asterisk as the provider.

Thanks for any help...

-Doug Seifert

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: detect if outbound call is never picked up

Ben Klang-2

Il giorno Oct 10, 2014, alle ore 3:54 PM, Douglas Seifert <[hidden email]> ha scritto:

I am making outbound calls via a DRB listener and want to run logic if 1) The call is answered, but the TTD menu code reaches a non-ack branch (this is working fine) or 2) The call is never picked up in the first place.  For case 2), since the outbound call controller never runs, I think I could instead set an event handler on the Call object that is returned by the Adhearsion::OutboundCall.originate method.

My asks: is my assumption correct? If so, what is the name of the event?  Something like:

call = Adhearsion::OutboundCall.originate ...
call.register_event_handler ??

I usually use `call.on_end` as a generic handler.  One thing you’ll want to do is to create the outbound call object *before* originating.  The #originate method is a convenience in that it creates the object and immediately dials. But that means your event handler gets attached after the call has failed.

Try something like this:

outbound_call = Adhearsion::OutboundCall.new.tap do |call|
  call.execute_controller_or_router_on_answer MyController
end

outbound_call.on_end do |end_event|
  logger.warn “Call #{outbound_call.id} has ended: #{end_event.inspect}”
end

outbound_call.dial destination, options

/BAK/


I am at a loss as to how to proceed.  I am using Asterisk as the provider.

Thanks for any help...

-Doug Seifert

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: detect if outbound call is never picked up

Douglas Seifert
Ben,
Thanks, that works perfectly.

-Doug

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.