Skip to content

Commit

Permalink
add more info (#163)
Browse files Browse the repository at this point in the history
* add more info
  • Loading branch information
dmitry-sinina authored Feb 4, 2025
1 parent 47aaac2 commit 616f7b6
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 122 deletions.
4 changes: 0 additions & 4 deletions en/best-practices/headers-transit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,3 @@ The headers will be filtered twice (by the filter X-YETI-AUTH*, and then by the
sip-session2[Termination gateway<br>**Transit headers from termination** = X-YETI-AUTH*]
end





94 changes: 49 additions & 45 deletions en/web-interface/billing/accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,70 @@ account balance will be **decreased** on call cost if it uses account for **orig
and **increased** if it uses account for **termination** (vendor).


**Account**'s attributes:
`````````````````````````
.. _account_id:

.. _account_id:
Id
Unique account id.

Id
Unique account id.
.. _account_name:

.. _account_name:
Name
Unique account name.

Name
Unique account name.
Contractor
:ref:`Contractor <contractors>` that is related to this *Account*.
Contractor
:ref:`Contractor <contractors>` that is related to this *Account*.

.. _account_balance:
.. _account_balance:

Balance
Current account balance.
Balance
Current account balance.

.. _account_min_balance:
.. _account_min_balance:

Min balance
If account balance become less than this limit, then traffic for this account will be blocked.
Min balance
If account balance become less than this limit, then traffic for this account will be blocked.

.. _account_max_balance:
.. _account_max_balance:

Max balance
If account balance become greater than this limit, then routes, which are belongs to this account, will not be used for calls termination.
Max balance
If account balance become greater than this limit, then routes, which are belongs to this account, will not be used for calls termination.

.. _account_balance_low_threshold:
.. _account_balance_low_threshold:

Balance low threshold
If account balance become less than this limit, notification will be send by email.
Balance low threshold
If account balance become less than this limit, notification will be send by email.

.. _account_balance_high_threshold:
.. _account_balance_high_threshold:

Balance high threshold
If account balance become greater than this limit, notification will be send by email.
Origination capacity
Maximum capacity which can be originated for this account.
If incoming calls number exceed origination capacity, then traffic will be blocked.
Termination capacity
Maximum capacity which can be terminated for this account.
If outgoing calls number exceed origination capacity, then routes, which are belongs to this account, will not be used for new calls.
Total capacity
Shared capacity either for incoming or outgoing calls, i.e. summarized traffic in both directions (but not in particular one) is limited by this number (see the picture below).
Balance high threshold
If account balance become greater than this limit, notification will be send by email.

.. figure:: images/accounts_capacity.png
:scale: 100 %
:align: center
:alt: YETI Account capacity
Origination capacity
Maximum capacity which can be originated for this account.
If incoming calls number exceed origination capacity, then traffic will be blocked.

Termination capacity
Maximum capacity which can be terminated for this account.
If outgoing calls number exceed origination capacity, then routes, which are belongs to this account, will not be used for new calls.

Total capacity
Shared capacity either for incoming or outgoing calls, i.e. summarized traffic in both directions (but not in particular one) is limited by this number (see the picture below).

.. figure:: images/accounts_capacity.png
:scale: 100 %
:align: center
:alt: YETI Account capacity

Invoice period
Automatic invoices generation period.
Invoice template
Template for generation of PDF invoice documents. (Templates can be configured at *Billing->Invoice templates*)
Sent invoices to
Contacts list to send invoices that were generated.
Timezone
Timezone which will be used for invoices generation and statistics for this account.
Invoice period
Automatic invoices generation period.

Invoice template
Template for generation of PDF invoice documents. (Templates can be configured at *Billing->Invoice templates*)

Sent invoices to
Contacts list to send invoices that were generated.

Timezone
Timezone which will be used for invoices generation and statistics for this account.


23 changes: 11 additions & 12 deletions en/web-interface/billing/contacts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ Contact:
Address information about :ref:`Contractor <contractors>` or :ref:`Administrative user <admin_users>` (contact belongs to the contractor or to the system operator).
All email notification and reports use only addresses which were added to the contacts.

**Contact** has the following attributes:
`````````````````````````````````````````
Id
Unique contract id.
Contractor
Choose :ref:`Contractor <contractors>` if this contact belongs to them.
Admin user
:ref:`Administrative user <admin_users>` which may own contact.
E-mail
Address for notifications, invoices and other emails.
Notes
Optional notes.
Id
Unique contract id.
Contractor
Choose :ref:`Contractor <contractors>` if this contact belongs to them.

Admin user
:ref:`Administrative user <admin_users>` which may own contact.
E-mail
Address for notifications, invoices and other emails.
Notes
Optional notes.


50 changes: 24 additions & 26 deletions en/web-interface/billing/contractors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,38 @@ Contractor is a company which will interact with the system.

Contractor may act as **Customer** - Use provided call termination service and **Vendor** - Provide call termination service. Same contractor can be either customer and vendor.

**Contractor** has the following attributes:
````````````````````````````````````````````

.. _contractor_id:
.. _contractor_id:

Id
Unique contractor id.
Id
Unique contractor id.

.. _contractor_name:
.. _contractor_name:

Name
Unique contractor name.
Enabled
Self-descriptive.
If flag is off (contractor disabled) this contractor will not be used for routing and billing.
Name
Unique contractor name.
Enabled
Self-descriptive.
If flag is off (contractor disabled) this contractor will not be used for routing and billing.

.. _contractor_vendor:
.. _contractor_vendor:

Vendor
If enabled contractor can act as vendor and system may terminate calls to it.
Vendor
If enabled contractor can act as vendor and system may terminate calls to it.

.. _contractor_customer:
.. _contractor_customer:

Customer
If enabled contractor can act as customer and originate calls to the system.
Description
Optional description of the contractor.
Address
Optional contractor address.
Phones
List of phone numbers to contact with contractor.
Smtp Connection
Connection to the mail server which will be used to send mails, invoices and notifications
(SMTP connection must be configured previously in *System->SMTP connections*)
Customer
If enabled contractor can act as customer and originate calls to the system.
Description
Optional description of the contractor.
Address
Optional contractor address.
Phones
List of phone numbers to contact with contractor.

Smtp Connection
:ref:`SMTP Connection <smtp_connections>` which will be used for email sending to this contractor. If empty - :ref:`Global SMTP connection <global_smtp_connection>` will be used

.. note:: Fields **Description**, **Address**, **Phones** are informational and not used in routing or billing logic.

Expand Down
12 changes: 11 additions & 1 deletion en/web-interface/billing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
Billing
=======

YETI WEB interface - Billing menu description. This section describes billing and accounting entities.
This section describes billing and accounting entities.


Yeti billing is simple and based on processing different types of billing events


* Call completion
* Payment completion
* Transaction creation

.. toctree::
:maxdepth: 1
Expand All @@ -11,5 +19,7 @@ YETI WEB interface - Billing menu description. This section describes billing an
contacts
accounts
payments
services
transactions
invoices
invoice_templates
31 changes: 20 additions & 11 deletions en/web-interface/billing/payments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
Payments
~~~~~~~~

Payments intended to change account balance.
Payment object represent payments and refunds from/to contractors. After payment completion account balance will be modified according to payment amount.

**Payment**'s attributes:
`````````````````````````
Id
Unique payment id.
Amount
Amount of payment in the monetary units.
Notes
Additional information about payment transactions.
Created at
Date and time of the payment creation.

Id
Unique payment id.
UUID
Unique payment id.
Account
Account related to payment.
Type
Type of payment represent payment provider.
Status
Pending, Canceled or Completed
Amount
Amount of payment in the monetary units.
Notes
Additional information about payment. Visible for customer in Customer Portal
Private Notes
Same as notes, but not visible for customer in Customer Portal.
Created at
Date and time of the payment creation.


70 changes: 70 additions & 0 deletions en/web-interface/billing/services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

.. _service:

========
Services
========

Service object represents additional paid service not related to per-second call billing. Service may charge customer account one time or multiple times during **renew** procedure

Id
Unique payment id.

UUID
Unique payment id.

Name
Name of service.

Account
Account related to payment.

Type
Service Type.

Variables
Service variables. Data format depends on configured Service Type.

State
Current state of service.

Initial price
Price that will bill be charged immediately after service creation.

Renew price
Price of renew.

Created At
Timestamp of service creation.

Renew At
Timestamp when service will be renewed.

Renew Period
Daily or Monthly.


Creation of service with non-zero **Initial price** value will cause creation of :ref:`Transaction <transaction>` object and it will cause Account balance modification.

Renew procedure
===============

Renew time controlled by **Renew At** value. Initially this value defined during service creation. During renew next **Renew At** will be set according to **Renew Period** configuration.



.. mermaid::

flowchart TD

A[Waiting renew_at time reached] --> B{service.type.force_renew?}
B -->|Yes. Renew process| R[<p style='text-align:left'>create transaction<br>set service.state=Active<br>set service.renew_at</p>]
B -->|No. Checking balance| C{Enough balance?}

C -->|No. Suspend service| S[<p style='text-align:left'>set service.state=Suspended</p>]
S --> A
C -->|Yes. Renew process| R

R -->A


23 changes: 23 additions & 0 deletions en/web-interface/billing/transactions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.. _transaction:

Transactions
~~~~~~~~~~~~

Transactions object represents account balance decrease caused by paid services consumption inside Yeti system.


Id
Unique payment id.
UUID
Unique payment id.
Account
Account related to payment.
Service
Link to :ref:`Service <service>`

Amount
Amount of payment in the monetary units.

Description
Additional information about transaction
Loading

0 comments on commit 616f7b6

Please sign in to comment.