Skip to content

Commit

Permalink
Commit additional channels API handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir Simionovich committed Oct 8, 2014
1 parent b589f54 commit 0f99e52
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/BasicAriConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function handlers()
break;
case "#":
echo "+++ Playback ID: " . $this->phpariObject->playbacks()->get_playback();
$this->phpariObject->channels()->channel_continue($this->stasisChannelID,"demo","s",1);
break;
default:
break;
Expand Down
21 changes: 15 additions & 6 deletions src/interfaces/channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,31 @@ public function channel_delete($channel_id = NULL)


/**
* continue an active channel
*
* @param null (string) $channel_id - channel identifier to query
* @param null $channel_id
* @param null $context
* @param null $extension
* @param null $priority
*
* @return bool - false on success, Integer or True on failure
* @return bool
*/
public function channel_continue($channel_id = NULL)
public function channel_continue($channel_id = NULL, $context = NULL, $extension = NULL, $priority = NULL)
{
try {

// $result = false;

if (is_null($channel_id))
throw new Exception("Channel ID not provided or is null", 503);
if (is_null($context))
throw new Exception("Content not provided or is null", 503);
if (is_null($extension))
throw new Exception("Extension not provided or is null", 503);
if (is_null($priority))
throw new Exception("Priority not provided or is null", 503);

$postArray = array('context'=>$context, 'extension'=>$extension, 'priority'=>(int)$priority);

$result = $this->pestObject->post("/channels/" . $channel_id . "/continue", NULL);
$result = $this->pestObject->post("/channels/" . $channel_id . "/continue", $postArray);

return $result;

Expand Down

0 comments on commit 0f99e52

Please sign in to comment.