src/interfaces/channels.php
public function hold($channel_id = NULL, $action = "start")
        {
            try {

                // $result = false;

                if (is_null($channel_id))
                    throw new Exception("Channel ID not provided or is null", 503);

                switch ($action) {
                    case "stop":
                        $result = $this->pestObject->delete("/channels/" . $channel_id . "/hold");
                        break;
                    case "start":
                    default:
                        $result = $this->pestObject->post("/channels/" . $channel_id . "/hold", array());
                        break;
                }

                return $result;

            } catch (Pest_NotFound $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            } catch (Pest_BadRequest $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            } catch (Exception $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            }
        }
public function hold($channel_id = NULL, $action = "start")
        {
            try {

                // $result = false;

                if (is_null($channel_id))
                    throw new Exception("Channel ID not provided or is null", 503);

                switch ($action) {
                    case "stop":
                        $result = $this->pestObject->delete("/channels/" . $channel_id . "/hold");
                        break;
                    case "start":
                    default:
                        $result = $this->pestObject->post("/channels/" . $channel_id . "/hold", array());
                        break;
                }

                return $result;

            } catch (Pest_NotFound $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            } catch (Pest_BadRequest $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            } catch (Exception $e) {
                $this->phpariObject->lasterror = $e->getMessage();
                $this->phpariObject->lasttrace = $e->getTraceAsString();

                return FALSE;
            }
        }
public function hold ( $ channel_id = NULL , $ action = "start" ) { try { // $result = false; if ( is_null ( $ channel_id ) ) throw new Exception ( "Channel ID not provided or is null" , 503 ) ; switch ( $ action ) { case "stop" : $ result = $ this -> pestObject -> delete ( "/channels/" . $ channel_id . "/hold" ) ; break ; case "start" : default : $ result = $ this -> pestObject -> post ( "/channels/" . $ channel_id . "/hold" , array ( ) ) ; break ; } return $ result ; } catch ( Pest_NotFound $ e ) { $ this -> phpariObject -> lasterror = $ e -> getMessage ( ) ; $ this -> phpariObject -> lasttrace = $ e -> getTraceAsString ( ) ; return FALSE ; } catch ( Pest_BadRequest $ e ) { $ this -> phpariObject -> lasterror = $ e -> getMessage ( ) ; $ this -> phpariObject -> lasttrace = $ e -> getTraceAsString ( ) ; return FALSE ; } catch ( Exception $ e ) { $ this -> phpariObject -> lasterror = $ e -> getMessage ( ) ; $ this -> phpariObject -> lasttrace = $ e -> getTraceAsString ( ) ; return FALSE ; } }
Hold a channel

@param null $channel_id

@return bool
Hold a channel