-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c58513a
commit a289ea7
Showing
27 changed files
with
378 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
* ################################### | ||
* ======================================= | ||
* MagnusSolution.com <[email protected]> | ||
* 2021-03-12 | ||
* 2021-04-08 | ||
*/ | ||
Locale.load({ | ||
'': '', | ||
|
@@ -95,7 +95,6 @@ Locale.load({ | |
'Before answer': '', | ||
'Bigger than': '', | ||
'Bill Date:': '', | ||
'Bill amount': '', | ||
'Billing': '', | ||
'Billing block': '', | ||
'Billing type': '', | ||
|
@@ -218,6 +217,8 @@ Locale.load({ | |
'Contains': '', | ||
'Context': '', | ||
'Continue': '', | ||
'Contract is required': '', | ||
'Contract no': '', | ||
'Count votes': '', | ||
'Country': '', | ||
'Country code': '', | ||
|
@@ -283,6 +284,8 @@ Locale.load({ | |
'Disallowed action': '', | ||
'Discount fee': '', | ||
'Disk space': '', | ||
'Distribution code': '', | ||
'Distribution code required': '', | ||
'Do you already have a SMTP': '', | ||
'Do you confirm buy this DID?': '', | ||
'Do you really want to leave the system?': '', | ||
|
@@ -435,7 +438,6 @@ Locale.load({ | |
'Invalid call reference value': '', | ||
'Invalid format': '', | ||
'Invalid message unspecified': '', | ||
'Invalid number': '', | ||
'Invalid number format': '', | ||
'Invalid plan used to signup': '', | ||
'Invalid register string': '', | ||
|
@@ -508,6 +510,7 @@ Locale.load({ | |
'Minutes': '', | ||
'Misdialled trunk prefix': '', | ||
'Mobile': '', | ||
'Mobile number': '', | ||
'Module': '', | ||
'Modules': '', | ||
'Mon-Fri': '', | ||
|
@@ -621,13 +624,16 @@ Locale.load({ | |
'Penalty, Paused, Invalid, Unavailable': '', | ||
'Pending': '', | ||
'Per': '', | ||
'Percentage': '', | ||
'Period': '', | ||
'Periodic announce': '', | ||
'Perm ban': '', | ||
'Permissions': '', | ||
'Permit': '', | ||
'Personal data': '', | ||
'Phone': '', | ||
'Phone Number': '', | ||
'Phone is required': '', | ||
'Phonebook': '', | ||
'Phonebooks': '', | ||
'Phonenumber': '', | ||
|
@@ -750,6 +756,7 @@ Locale.load({ | |
'Resend': '', | ||
'Reservation date': '', | ||
'Reserved': '', | ||
'Reset': '', | ||
'Reset queue stats': '', | ||
'Response to STATUS ENQUIRY': '', | ||
'Restore': '', | ||
|
@@ -779,6 +786,7 @@ Locale.load({ | |
'SELECT GROUP FOR AGENT USERS': '', | ||
'SIP': '', | ||
'SIP Call': '', | ||
'SIP Code': '', | ||
'SIP To': '', | ||
'SIP Users': '', | ||
'SIP account limit': '', | ||
|
@@ -950,7 +958,6 @@ Locale.load({ | |
'Time for another call': '', | ||
'Time used': '', | ||
'Title': '', | ||
'To date': '', | ||
'To day': '', | ||
'Today': '', | ||
'Today peak': '', | ||
|
@@ -978,6 +985,7 @@ Locale.load({ | |
'Trunk': '', | ||
'Trunk Groups': '', | ||
'Trunk chart': '', | ||
'Trunk erros': '', | ||
'Trunk groups': '', | ||
'Trunks': '', | ||
'Tuesday': '', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.. _find-rate: | ||
|
||
Tariff Search | ||
============== | ||
|
||
How does MagnusBilling select the rate to be used? | ||
-------------------------------------------------- | ||
|
||
When a customer makes an external call, to a landline or cell phone, a verification routine is triggered which consists of: | ||
|
||
1 - Check the username and password. | ||
2 - Checks whether the client is active. | ||
3 - Checks if the number dialed is a DID. | ||
4 - Check if the dialed number is a SIP Account. | ||
5 - Check the customer's plan. | ||
6 - Search within the plan's tariffs which fare best fits the number dialed. | ||
7 - Search for the trunks that belong to the trunk group of the tariff found. | ||
8 - Sends the call to the first trunk, and if it fails it sends to the next. | ||
9 - When the call is finished, the purchase and sale price is calculated | ||
10 - Added the call in the CDR report | ||
11 - Discounting the value of the call in the customer's credit. | ||
|
||
|
||
Rather, how does step 6 work? | ||
|
||
It is carried out as follows. Let's say customer XXXXX called 551140045678 | ||
|
||
In step 5, the system takes the customer's plan, and then in step 6 a "SELECT" is made on the tariff table like this. | ||
|
||
|
||
:: | ||
|
||
$ sql = "SELECT * FROM pkg_plan LEFT JOIN pkg_rate ON pkg_plan.id = pkg_rate.id_plan | ||
LEFT JOIN pkg_prefix ON pkg_rate.id_prefix = pkg_prefix.id | ||
LEFT JOIN pkg_trunk_group ON pkg_trunk_group.id = pkg_rate.id_trunk_group | ||
WHERE pkg_plan.id = $ MAGNUS-> id_plan AND pkg_rate.status = 1 | ||
AND $ MAGNUS-> prefixclause ORDER BY LENGTH (prefix) DESC LIMIT 1 "; | ||
|
||
|
||
The $ MAGNUS-> id_plan variable is the customer's plan id, and the $ MAGNUS-> prefixclause variable is the filter used to find the tariff. | ||
|
||
To facilitate understanding we will explain it in another way. | ||
|
||
As the customer called 551140045678, the system will search as follows. | ||
|
||
Is there a tariff for the prefix 551140045678? | ||
|
||
* If yes, we use this rate | ||
|
||
* If not, we will search again by removing the last number, in this case 55114004567 and so on until we reach only number 5. If we do not find any rate, the system will return an error and will not continue the call. | ||
|
||
|
||
|
||
Going back to "SELECT" it would look like this. | ||
|
||
:: | ||
|
||
$ sql = "SELECT * FROM pkg_plan LEFT JOIN pkg_rate ON pkg_plan.id = pkg_rate.id_plan | ||
LEFT JOIN pkg_prefix ON pkg_rate.id_prefix = pkg_prefix.id | ||
LEFT JOIN pkg_trunk_group ON pkg_trunk_group.id = pkg_rate.id_trunk_group | ||
WHERE pkg_plan.id = 1 AND pkg_rate.status = 1 AND | ||
(prefix = '551140045678' OR | ||
prefix = '55114004567' OR | ||
prefix = '5511400456' OR | ||
prefix = '551140045' OR | ||
prefix = '55114004' OR | ||
prefix = '5511400' OR | ||
prefix = '551140' OR | ||
prefix = '55114' OR | ||
prefix = '5511' OR | ||
prefix = '551' OR | ||
prefix = '55' OR | ||
prefix = '5') | ||
ORDER BY LENGTH (prefix) DESC LIMIT 1 "; | ||
|
||
|
||
Let’s say you have the following 3 tariffs in your customer’s plan | ||
|
||
55, Brasil Fixo Geral | ||
55119, Brazil SP Celular | ||
5511, Brazil SP Fixed | ||
|
||
|
||
In this example, "SELECT" would return tariff 5511, Brasil SP Fixo. | ||
|
||
|
||
|
||
But you may be wondering if the customer calls 5511988551234, the "SELECT" would find the prefix 55119 and 5511 and then which one would use? I would use 55119, because in "SELECT" there is the parameter ORDER BY LENGTH (prefix) DESC and also the parameter LIMIT 1. That is, it will order the results by placing first the prefix that has the largest number of digits. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
******************** | ||
Update MagnusBilling | ||
******************** | ||
|
||
Our team works daily to add new functions and solve problems. You can see the changes made in the link https://github.com/magnussolution/magnusbilling7/commits/source. | ||
|
||
Therefore, our team recommends that you keep your server up to date. | ||
|
||
To update run the following command. | ||
|
||
|
||
:: | ||
|
||
/var/www/html/mbilling/protected/commands/update.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.