Implement an ari application

Hello everybody.

I am developing an ARI application . i am trying to create a queue application in PHP language which it uses php-ari library to originates bunch of calls at the same time. the queue is being handled and i don’t have worry about it . the thing that matters the most is how to push channels to my stasis application.
let’s say my stasis app name is hello-world.i implemented a listener in order to listen to an stasis app .
my listener constantly listens to events of the stasis app for example StasisStart or StasisEnd.
here are my problems.

  1. i don’t know to how to call $channels->channel_originate() properly that my stasis app takes control of the calls immediately and listens to all events => for example if you originate a call and then you stasis app takes control you might lose some events such as Dial Event. i don’t want this . i need to take control of all aspect of my call procedure and listen to all events in order to take action properly. i am guessing i must pass my Number as an argument to my stasis app and when StasisStart event is called, i resolve the number and originate a call.
  2. how can i refer to a proper endpoint and stasis app when i originate a call ?

thank you for your answers in advance

technology stack which was used:

  1. PHP + php-ari library
  2. Asterisk ARI

Why dont you use AMI (Originate action ) to complete the described project ?

I would like to experience ARI by doing a project based on that. Whats wrong with this ARI method ?. for the time being i use AMI to implement my project but there are a few resources for learning ARI. how can i learn it ? where can find resources or books for learning ARI ?

The method you are requesting is part of the PHP ARI class you are using , so you must address the questio with them, related to the resources you can start here https://wiki.asterisk.org/wiki/display/AST/Getting+Started+with+ARI