wormling / phparia

Framework for creating ARI (Asterisk REST Interface) applications.
http://phparia.org
Apache License 2.0
39 stars 35 forks source link

Sequential Call #35

Open bashong opened 6 years ago

bashong commented 6 years ago

Hi,

I'm testing sequential call, so ring another endpoint if the previous endpoint does not take the call.

I have three endpoints.

$endpoints = array("PJSIP/000001115","PJSIP/116","PJSIP/117");
`
$this->dialedChannel = $this->client->channels()->createChannel($endpoints[0],null,'null',null,null,$this->client->getStasisApplicationName(),'dialed');`

Now on code below use to trigger the second endpoint.

$this->dialedChannel->onChannelDestroyed(function (ChannelDestroyed $event) use($endpoints) {
      $this->dialedChannel = $this->client->channels()->createChannel($endpoints[1],null,'null',null,null,$this->client->getStasisApplicationName(),'dialed');      
 });    

How can I make this to ring the 3rd endpoint once second endpoint channel has been destroyed.

TIA.