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 missing action #196

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/PAMI/Message/Action/ConfbridgeKickAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
namespace PAMI\Message\Action;

/**
* ConfbridgeKickAction action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Szabolcs Morvai <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
*
* Copyright 2011 Marcelo Gornstein <[email protected]>
*
* 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.
*
*/
class ConfbridgeKickAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $channel Channel to be muted.
* @param string $conference Conference on which to act.
*
* @return void
*/
public function __construct($channel, $conference)
{
parent::__construct('ConfbridgeKick');
$this->setKey('Channel', $channel);
$this->setKey('Conference', $conference);
}
}
44 changes: 44 additions & 0 deletions src/PAMI/Message/Action/ConfbridgeLockAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
namespace PAMI\Message\Action;

/**
* ConfbridgeLockAction action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Szabolcs Morvai <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
*
* Copyright 2011 Marcelo Gornstein <[email protected]>
*
* 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.
*
*/
class ConfbridgeLockAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $conference Conference on which to act.
*
* @return void
*/
public function __construct($conference)
{
parent::__construct('ConfbridgeLock');
$this->setKey('Conference', $conference);
}
}
44 changes: 44 additions & 0 deletions src/PAMI/Message/Action/ConfbridgeUnlockAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
namespace PAMI\Message\Action;

/**
* ConfbridgeUnlockAction action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Szabolcs Morvai <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
*
* Copyright 2011 Marcelo Gornstein <[email protected]>
*
* 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.
*
*/
class ConfbridgeUnlockAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $conference Conference on which to act.
*
* @return void
*/
public function __construct($conference)
{
parent::__construct('ConfbridgeUnlock');
$this->setKey('Conference', $conference);
}
}
7 changes: 5 additions & 2 deletions src/PAMI/Message/Action/GetConfigAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ class GetConfigAction extends ActionMessage
* Constructor.
*
* @param string $filename Configuration filename (e.g.: foo.conf).
* @param boolean $category Category in configuration file.
* @param string $category Contect name in ini file (e.g.: [general]).
*
* @return void
*/
public function __construct($filename, $category = false)
public function __construct($filename, $category = false, $filter = false)
{
parent::__construct('GetConfig');
$this->setKey('Filename', $filename);
if ($category != false) {
$this->setKey('Category', $category);
}
if ($filter != false) {
$this->setKey('Filter', $filter);
}
}
}
9 changes: 8 additions & 1 deletion src/PAMI/Message/Action/GetConfigJSONAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,19 @@ class GetConfigJSONAction extends ActionMessage
* Constructor.
*
* @param string $filename Configuration filename (e.g.: foo.conf).
* @param string $category Contect name in ini file (e.g.: [general]).
*
* @return void
*/
public function __construct($filename)
public function __construct($filename, $category = false, $filter = false)
{
parent::__construct('GetConfigJSON');
$this->setKey('Filename', $filename);
if ($category != false) {
$this->setKey('Category', $category);
}
if ($filter != false) {
$this->setKey('Filter', $filter);
}
}
}
70 changes: 70 additions & 0 deletions src/PAMI/Message/Action/PJSIPNotifyAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/**
* PJSIPNotify action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Sperl Viktor <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @version SVN: $Id$
* @link http://marcelog.github.com/PAMI/
*
* Copyright 2023 Sperl Viktor <[email protected]>
*
* 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;

/**
* PJSIPNotify action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Sperl Viktor <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @link http://marcelog.github.com/PAMI/
*/
class PJSIPNotifyAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $endpoint PJSIP endpoint or URI to receive the notify.
* @param array/string $variables Variable Key-Value pairs / pjsip_notify.conf context (section) name.
*
* @return void
*/
public function __construct($endpoint, $variables)
{
parent::__construct('PJSIPNotify');
if (strpos($endpoint, "@") !== false) {
$this->setKey('URI', $endpoint);
} else {
$this->setKey('Endpoint', $endpoint);
}
if (is_array($variables)) {
foreach ($variables as $key => $value) {
$this->setKey('Variable', $key . '=' . $value);
}
} else {
$this->setKey('Option', $variables);
}
}
}
55 changes: 55 additions & 0 deletions src/PAMI/Message/Action/PJSIPShowContactsAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* PJSIPShowContacts action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Morvai Szabolcs <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @version SVN: $Id$
* @link http://marcelog.github.com/PAMI/
*
* Copyright 2022 Morvai Szabolcs <[email protected]>
*
* 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;

/**
* PJSIPShowContacts action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Morvai Szabolcs <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @link http://marcelog.github.com/PAMI/
*/
class PJSIPShowContactsAction extends ActionMessage
{
/**
* Constructor.
*
* @return void
*/
public function __construct()
{
parent::__construct('PJSIPShowContacts');
}
}
58 changes: 58 additions & 0 deletions src/PAMI/Message/Action/PJSIPShowEndpointAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* PJSIPShowEndpoint action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Morvai Szabolcs <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @version SVN: $Id$
* @link http://marcelog.github.com/PAMI/
*
* Copyright 2022 Morvai Szabolcs <[email protected]>
*
* 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;

/**
* PJSIPShowEndpoint action message.
*
* PHP Version 5
*
* @category Pami
* @package Message
* @subpackage Action
* @author Morvai Szabolcs <[email protected]>
* @license http://marcelog.github.com/PAMI/ Apache License 2.0
* @link http://marcelog.github.com/PAMI/
*/
class PJSIPShowEndpointAction extends ActionMessage
{
/**
* Constructor.
*
* @param string $endpoint Endpoint name.
*
* @return void
*/
public function __construct($endpoint)
{
parent::__construct('PJSIPShowEndpoint');
$this->setKey('Endpoint', $endpoint);
}
}
6 changes: 5 additions & 1 deletion src/PAMI/Message/Action/SIPNotifyAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ class SIPNotifyAction extends ActionMessage
* Constructor.
*
* @param string $channel Peer to receive the notify.
* @param array $variables Variable Key-Value pairs.
*
* @return void
*/
public function __construct($channel)
public function __construct($channel, $variables)
{
parent::__construct('SIPnotify');
$this->setKey('Channel', $channel);
foreach ($variables as $key => $value) {
$this->setKey('Variable', $key . '=' . $value);
}
}
}
Loading