Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new actions for Asterisk 12-14 #114

Merged
merged 1 commit into from Nov 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/PAMI/Message/Action/BlindTransferAction.php
@@ -0,0 +1,60 @@
<?php
/**
* BlindTransfer 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;

/**
* BlindTransfer 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
* @link http://marcelog.github.com/PAMI/
*/
class BlindTransferAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $channel Transferer's channel.
* @param string $extension Extension to transfer to.
* @param string $context Context to transfer to.
*/
public function __construct($channel, $extension, $context)
{
parent::__construct('BlindTransfer');
$this->setKey('Channel', $channel);
$this->setKey('Exten', $extension);
$this->setKey('Context', $context);
}
}
55 changes: 55 additions & 0 deletions src/PAMI/Message/Action/ChallengeAction.php
@@ -1 +1,56 @@
<?php
/**
* Challenge 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;

/**
* Challenge 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
* @link http://marcelog.github.com/PAMI/
*/
class ChallengeAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $authType Auth type
*/
public function __construct($authType = 'MD5')
{
parent::__construct('Challenge');
$this->setKey('AuthType', $authType);
}
}
55 changes: 55 additions & 0 deletions src/PAMI/Message/Action/DAHDITransferAction.php
@@ -1 +1,56 @@
<?php
/**
* DAHDITransfer 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;

/**
* DAHDITransfer 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
* @link http://marcelog.github.com/PAMI/
*/
class DAHDITransferAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $channel DAHDIChannel
*/
public function __construct($channel)
{
parent::__construct('DAHDITransfer');
$this->setKey('DAHDIChannel', $channel);
}
}
90 changes: 90 additions & 0 deletions src/PAMI/Message/Action/MixMonitorMuteAction.php
@@ -0,0 +1,90 @@
<?php
/**
* MixMonitorMute action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Matt Styles <mstyleshk@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;

/**
* MixMonitorMute action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Matt Styles <mstyleshk@gmail.com>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @link http://marcelog.github.com/PAMI/
*/
class MixMonitorMuteAction extends ActionMessage
{
const DIRECTION_READ = 'read';
const DIRECTION_WRITE = 'write';
const DIRECTION_BOTH = 'both';

/**
* Sets state key.
*
* @param bool $state Mute state
*
* @return void
*/
public function setState($state)
{
$this->setKey('State', $state ? 1 : 0);
}

/**
* Sets state key.
*
* @param string $direction Which part of the recording to mute:
* read, write or both (from channel, to channel or both channels).
*
* @return void
*/
public function setDirection($direction)
{
$this->setKey('Direction', $direction);
}

/**
* Constructor.
*
* @param string $channel Channel on which to act.
* @param bool $state Turn mute on or off
* @param string $direction Which part of the recording to mute:
* read, write or both (from channel, to channel or both channels).
*/
public function __construct($channel, $state = true, $direction = 'both')
{
parent::__construct('MixMonitorMute');
$this->setKey('Channel', $channel);
$this->setState($state);
$this->setDirection($direction);
}
}
1 change: 0 additions & 1 deletion src/PAMI/Message/Action/SetCDRUserFieldAction.php

This file was deleted.

59 changes: 59 additions & 0 deletions src/PAMI/Message/Action/UserEventAction.php
@@ -1 +1,60 @@
<?php
/**
* UserEvent 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;

/**
* UserEvent 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
* @link http://marcelog.github.com/PAMI/
*/
class UserEventAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $userEvent UserEvent
* @param array $headers
*/
public function __construct($userEvent, array $headers = [])
{
parent::__construct('UserEvent');
$this->setKey('UserEvent', $userEvent);
foreach ($headers as $key => $value) {
$this->setKey((string)$key, (string)$value);
}
}
}
2 changes: 1 addition & 1 deletion src/PAMI/Message/Action/VGSMSMSTxAction.php
Expand Up @@ -150,8 +150,8 @@ public function setConcatSeqNum($seqnum)
public function setConcatTotalMsg($totalmsg)
{
$this->setKey('X-SMS-Concatenate-Total-Messages', $totalmsg);

}

/**
* Sets Account key.
*
Expand Down
55 changes: 55 additions & 0 deletions src/PAMI/Message/Action/WaitEventAction.php
@@ -1 +1,56 @@
<?php
/**
* WaitEvent 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;

/**
* WaitEvent 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
* @link http://marcelog.github.com/PAMI/
*/
class WaitEventAction extends ActionMessage
{
/**
* Constructor.
*
* @param int $timeout Timeout in seconds
*/
public function __construct($timeout)
{
parent::__construct('WaitEvent');
$this->setKey('Timeout', (int)$timeout);
}
}