Skip to content

Commit

Permalink
change from iptables to firewalld
Browse files Browse the repository at this point in the history
  • Loading branch information
callcenter-magnus committed Jul 22, 2024
1 parent 3702f68 commit 6d0e380
Show file tree
Hide file tree
Showing 6 changed files with 1,961 additions and 854 deletions.
Binary file modified build/MagnusBilling-current.tar.gz
Binary file not shown.
12 changes: 7 additions & 5 deletions protected/commands/CallChartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public function run($args)
sleep(4);
continue;
}

print_r($calls);
echo "\n\n\n\nSTART ------" . $calls . "\n\n";

if ($calls == 'old_version') {
Expand Down Expand Up @@ -510,7 +512,7 @@ public function use_concise()
$tech = substr($ndiscado, 0, $config['global']['ip_tech_length']);

$modelSip = Sip::model()->find('techprefix = :key AND host != "dynamic" ', [':key' => $tech]);
if ( ! count($modelSip)) {
if ( ! isset($modelSip->id)) {
if (preg_match('/^SIP\/sipproxy\-/', $channel)) {
$modelSip = Sip::model()->find('name = :key',
[
Expand All @@ -522,23 +524,23 @@ public function use_concise()
':key' => $originate,
]);
}
if ( ! count($modelSip)) {
if ( ! isset($modelSip->id)) {
//check if is via IP from proxy
$callProxy = AsteriskAccess::getCoreShowChannel($channel, null, $call['server']);
$modelSip = Sip::model()->find('host = :key', [':key' => $callProxy['X-AUTH-IP']]);
}
}

if (count($modelSip)) {
if (isset($modelSip->id)) {
$userType = 'User';
} else {
$resultTrunk = Trunk::model()->find('trunkcode = :key', [':key' => $originate]);
if (count($resultTrunk)) {
if (isset($resultTrunk->id)) {
$userType = 'Trunk';
}
}

if ( ! count($userType)) {
if ( ! isset($userType)) {
//not fount the type call
continue;
} elseif ($userType == 'User') {
Expand Down
23 changes: 12 additions & 11 deletions protected/models/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ public function primaryKey()

public function rules()
{
$rules = array(
array('name', 'required'),
array('id_user, tariff_limit, play_audio,techprefix, lcrtype, signup, portabilidadeMobile, portabilidadeFixed', 'numerical', 'integerOnly' => true),
array('name, ini_credit', 'length', 'max' => 50),
array('techprefix', 'length', 'max' => 5),
array('name', 'unique', 'caseSensitive' => 'false'),
);
$rules = [
['name', 'required'],
['id_user, tariff_limit, play_audio,techprefix, lcrtype, signup, portabilidadeMobile, portabilidadeFixed', 'numerical', 'integerOnly' => true],
['name, ini_credit', 'length', 'max' => 50],
['techprefix', 'length', 'max' => 5],
['name', 'unique', 'caseSensitive' => 'false'],
['creationdate', 'safe'],
];
return $this->getExtraField($rules);
}

Expand All @@ -68,9 +69,9 @@ public function rules()
*/
public function relations()
{
return array(
'idUser' => array(self::BELONGS_TO, 'User', 'id_user'),
);
return [
'idUser' => [self::BELONGS_TO, 'User', 'id_user'],
];
}

public function searchTariff($id_plan, $destination)
Expand All @@ -92,6 +93,6 @@ public function searchTariff($id_plan, $destination)
LEFT JOIN pkg_trunk_group ON pkg_trunk_group.id = pkg_rate.id_trunk_group
WHERE pkg_plan.id=$id_plan AND pkg_rate.status = 1 AND $prefixclause
ORDER BY LENGTH( prefix ) DESC LIMIT 1";
return array($sql, Yii::app()->db->createCommand($sql)->queryAll(), $prefixclause);
return [$sql, Yii::app()->db->createCommand($sql)->queryAll(), $prefixclause];
}
}
Loading

0 comments on commit 6d0e380

Please sign in to comment.