outbound call queuing

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

outbound call queuing

dev
I am using adhearsion+asterisk and activerecord ORM. I need to play one recorded message to many agents whose contact number is saved in database. 
where i have only one call outgoing channel and have to call one agent at a time. when one agent receive call, listen message and hang up then adhearsion have to call next agent. similarly, for all selected contact lists.

what i have done is :
->read database and make queue of selected contact list.
->pop each number from queue and originate call with controller which play msg


until @contact_in_queue.empty?
       number=@contact_in_queue.pop
      call_status=CallThisNumberCallController.new(number).start!
            #wait until call completion 
end

def start!
    @ahn_call = Adhearsion::OutboundCall.originate number,
      from:                "Notification Service",
      controller:          PlayMsgController,
  end

  def status
    if @ahn_call
      @ahn_call.active? ? true : false
    else
      false
    end
  end
i have problem in wait  part. it try to call all at once. Is there any better way to do that?

--
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: outbound call queuing

ik_5
Originate waits until someone is answered a call and then returns, unless it's async and then it returns right away.

I haven't tried it, but I think that if you will use it like so:

...
sleep 0.1 while ! @answer

...
@answer = false
Adhearsion::OutboundCall.originate number,from: "Notification Service", controller: PlayMsgController do
  @answer = true
end
...


It might work as you wish.

On Mon, Feb 16, 2015 at 8:06 AM, dev <[hidden email]> wrote:
I am using adhearsion+asterisk and activerecord ORM. I need to play one recorded message to many agents whose contact number is saved in database. 
where i have only one call outgoing channel and have to call one agent at a time. when one agent receive call, listen message and hang up then adhearsion have to call next agent. similarly, for all selected contact lists.

what i have done is :
->read database and make queue of selected contact list.
->pop each number from queue and originate call with controller which play msg


until @contact_in_queue.empty?
       number=@contact_in_queue.pop
      call_status=CallThisNumberCallController.new(number).start!
            #wait until call completion 
end

def start!
    @ahn_call = Adhearsion::OutboundCall.originate number,
      from:                "Notification Service",
      controller:          PlayMsgController,
  end

  def status
    if @ahn_call
      @ahn_call.active? ? true : false
    else
      false
    end
  end
i have problem in wait  part. it try to call all at once. Is there any better way to do that?

--
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.

--
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.
dev
Reply | Threaded
Open this post in threaded view
|

Re: outbound call queuing

dev
In reply to this post by dev
thanks Ido, 
But,  it does not work for me. it originates call for first number of the queue and do nothing. I have also tried using multi - thread but that concept also does not work. 

--
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.