Source of file AttendedTransferAction.php

Size: 2,666 Bytes - Last Modified: 2019-12-18T12:03:21+00:00

/data/development/sccp/sources/PAMI/src/PAMI/Message/Action/AttendedTransferAction.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
<?php
/**
 * Atxfer action message.
 *
 * PHP Version 5
 *
 * @category   Pami
 * @package    Message
 * @subpackage Action
 * @author     Marcelo Gornstein <marcelog@gmail.com>
 * @license    http://marcelog.github.com/PAMI/ Apache License 2.0
 * @version    SVN: $Id$
 * @link       http://marcelog.github.com/PAMI/
 *
 * Copyright 2011 Marcelo Gornstein <marcelog@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
namespace PAMI\Message\Action;

/**
 * AttendedTransfer action message.
 * using 'Atxfer'
 */
class AttendedTransferAction extends ActionMessage
{
        /**
         * Constructor.
         *
         * @param string $channel
         *        Transferer's channel.
         *
         * @param string $exten
         *        Extension to transfer to.
         *
         * @param string $context
         *        Context to transfer to.
         *
         * @param string $priority
         *        Priority to transfer to.
         *
         * @return void
         */
    public function __construct($channel, $exten, $context = null, $priority = null)
    {
        parent::__construct('Atxfer');
        $this->setKey('Channel', $channel);
        $this->setKey('Exten', $exten);

        if ($context !== null) {
            trigger_error('Argument $context will be remove at next major version', E_USER_DEPRECATED);
            $this->setContext($context);
        }

        if ($priority !== null) {
            trigger_error('Argument $priority will be remove at next major version', E_USER_DEPRECATED);
            $this->setPriority($priority);
        }
    }

        /**
         * set Context
         *
         * @param string $context
         *        Context to transfer to.
         *
         * @return void
         */
    public function setContext($context)
    {
        $this->setKey('Context', $context);
    }

        /**
         * set Priority
         *
         * @param string $priority
         *        Priority to transfer to.
         *
         * @return void
         */
    public function setPriority($priority)
    {
        $this->setKey('Priority', $priority);
    }
}