Skip to content

Commit

Permalink
fix crypt installation on DEBIAN 10
Browse files Browse the repository at this point in the history
  • Loading branch information
callcenter-magnus committed Oct 3, 2023
1 parent 1dddd75 commit 7b92bd1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
Binary file modified build/MagnusBilling-current.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion classic/src/view/sip/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Ext.define('MBilling.view.sip.Form', {
}, {
name: 'defaultuser',
fieldLabel: t('SIP user'),
minLength: 4,
minLength: window.sip_user_min ? window.sip_user_min : 4,
allowBlank: true,
readOnly: App.user.isClient
}, {
Expand Down
8 changes: 4 additions & 4 deletions protected/commands/CryptocurrencyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class CryptocurrencyCommand extends CConsoleCommand
public function run($args)
{

$modelMethodPay = Methodpay::model()->find('payment_method = :key', array(':key' => 'cryptocurrency'));
if (!isset($modelMethodPay->id)) {
$modelMethodPay = Methodpay::model()->find('payment_method = :key', [':key' => 'cryptocurrency']);
if ( ! isset($modelMethodPay->id)) {
echo 'No method found';
exit;
}

$last_30_minutes = time() - 1800;
$modelCryptocurrency = Cryptocurrency::model()->findAll('date > :key1 AND status = 1',
array(':key1' => date('Y-m-d')));
[':key1' => date('Y-m-d')]);

foreach ($modelCryptocurrency as $key => $payment) {
$result = '';
Expand All @@ -54,7 +54,7 @@ public function run($args)

Yii::log('encontrou liberar credit', 'error');

Cryptocurrency::model()->updateByPk($payment->id, array('status' => 0));
Cryptocurrency::model()->updateByPk($payment->id, ['status' => 0]);
$description = 'CriptoCurrency ' . $value->coin . ', txid: ' . $value->txId;
Yii::log($description, 'error');
echo ($payment->id_user . ' ' . $payment->amount . ' ' . $description . ' ' . $value->txId);
Expand Down
13 changes: 13 additions & 0 deletions protected/commands/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
sudo apt install python3.9-pip
python3.9 -m pip install python-binance
DEBIAN 10
sudo apt install wget build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /tmp
wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz
tar -xf Python-3.9.1.tgz
cd Python-3.9.1
make -j 2
sudo make altinstall
sudo python3.9 -m pip install --upgrade pip
sudo python3.9 -m pip install python-binance
CENTOS 7
yum install libffi-devel -y
Expand Down
14 changes: 7 additions & 7 deletions resources/asterisk/DidAgi.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function checkIfIsDidCall(&$agi, &$MAGNUS, &$CalcAgi)
$sql = "SELECT id FROM pkg_prefix WHERE prefix = SUBSTRING('" . $this->did . "',1,length(prefix))
ORDER BY LENGTH(prefix) DESC";
$modelPrefix = $agi->query($sql)->fetch(PDO::FETCH_OBJ);
if (!isset($modelPrefix->id)) {
if ( ! isset($modelPrefix->id)) {
$agi->verbose('Not found prefix to DID ' . $this->did);
}
$CalcAgi->id_prefix = $modelPrefix->id;
Expand Down Expand Up @@ -220,8 +220,8 @@ public function checkDidDestinationType(&$agi, &$MAGNUS, &$CalcAgi)

$agi->verbose('voip_call ' . $this->voip_call, 5);

if ($this->modelDid->cbr == 1 && !$agi->get_variable("ISFROMCALLBACKPRO", true)) {
if (!$agi->get_variable("SECCALL", true)) {
if ($this->modelDid->cbr == 1 && ! $agi->get_variable("ISFROMCALLBACKPRO", true)) {
if ( ! $agi->get_variable("SECCALL", true)) {
$agi->verbose('RECEIVED 0800 CALLBACPRO', 5);
CallbackAgi::advanced0800CallBack($agi, $MAGNUS, $this, $CalcAgi);
return;
Expand Down Expand Up @@ -265,7 +265,7 @@ public function checkDidDestinationType(&$agi, &$MAGNUS, &$CalcAgi)
CallbackAgi::callbackCID($agi, $MAGNUS, $CalcAgi, $this);
break;
case 6:
if (!$agi->get_variable("SECCALL", true)) {
if ( ! $agi->get_variable("SECCALL", true)) {
$agi->verbose('RECEIVED 0800 CALLBACK', 5);
CallbackAgi::callback0800($agi, $MAGNUS, $CalcAgi, $this);
}
Expand Down Expand Up @@ -412,7 +412,7 @@ public function call_did(&$agi, &$MAGNUS, &$CalcAgi, $destinationIvr = false)
$sql = "SELECT * FROM pkg_sip WHERE sip_group = '" . $inst_listdestination['destination'] . "'";
$modelSip = $agi->query($sql)->fetchAll(PDO::FETCH_OBJ);
$agi->verbose("Call group $group ", 6);
if (!isset($modelSip[0]->id)) {
if ( ! isset($modelSip[0]->id)) {
$answeredtime = 0;
continue;
}
Expand All @@ -424,7 +424,7 @@ public function call_did(&$agi, &$MAGNUS, &$CalcAgi, $destinationIvr = false)
$group .= "SIP/" . $value->name . "&";
}

$dialstr = substr($group, 0, -1) . $dialparams;
$dialstr = substr($group, 0, -1);

$MAGNUS->startRecordCall($agi, $this->did, true);

Expand Down Expand Up @@ -581,7 +581,7 @@ public function call_did(&$agi, &$MAGNUS, &$CalcAgi, $destinationIvr = false)

/* PERFORM THE CALL*/
$result_callperf = $CalcAgi->sendCall($agi, $MAGNUS->destination, $MAGNUS);
if (!$result_callperf) {
if ( ! $result_callperf) {
$prompt = "prepaid-callfollowme";
$agi->verbose($prompt, 10);
$agi->stream_file($prompt, '#');
Expand Down

0 comments on commit 7b92bd1

Please sign in to comment.