h1. Balances {{>toc}} When dealing with telephony business, it's good to have reliable partners (customers, providers, users). Then you can rely on them and you will always know that they will pay the bill. The calls for such customers could be billed by credit scheme (post-paid). But sometimes this is not possible to rely on them. In this case you can apply prepaid scheme for them. Fortunately, *Streamco Smartswitch* supports both prepaid and post-paid schemes, as well as automatic blocking of services provision when balance goes out of the configured thresholds. *Balance* - is a difference between amount of money, which has been paid, and the cost of services, which has been provided. Each company/user inside the system have their personal balance. h2. Balance types. System supports following types of balances: * _their balance_. This is balance of your partner inside Smartswitch. Practically this is the difference between total amount of money, which partner has paid to you, and total cost of services, which you have provided to your partner. Maintenance of this balance by the system allows to perform the automatic limitation of services provision to your partner when balance becomes negative (see [[Balance cutoff]]) - therefore working in prepaid mode. * _our balance_. This is your balance inside the billing system of your partner. Practically this is difference between total amount of money, which you have paid to your partner, and total cost of services, which you have consumed from you partner. Maintenance of this balance by the system allows to perform automatic limitation of non-paid services consumption by you. For example, your partner-terminator works with you using prepaid scheme, and your balance became negative at his billing system, then there is no reason to send calls to him, as likely they would be blocked, and to make your PDD worse from the point of view of your originators. Also this might be useful to limit originated amount of traffic by some money amount. For this purpose it might be useful to maintain this balance in parallel to partner and to activate [[Balance cutoff]] feature for him. * _mutual balance_. This is difference between _their balance_ and _our balance_. This balance often is used to work using prepaid scheme with partner, with whom you perform both origination and termination services. The calls which has been originated to your side, will be blocked, if mutual balance becomes negative and for this type of balance [[Balance cutoff]] feature has been activated. However after it will become positive again (for example, due to you have originated some calls to this partner), incoming calls from this company will be accepted again. While calls pass through and are getting billed, balances are correspondingly updated in real-time. In standard scheme of balance updates, on call hangup billing of all call legs occurs and balances of all peers which participate in a call, are updated too. There is a difference in this logic when using [[Online billing]]. According to it balances are updated periodically during call (therefore not on completion). Balance maintenance is tightly coupled with [[Consumption profile]] and can be used together. h2. User balance User balance contains of *2 levels*. User with balance can belong to company which has some balance too. The same company might contain other users with personal balances. 2-level balances are updated independently. For example, there are 2 users A and B. They belong to company C. In case if user A has made a call, balances of A and C will be updated. In case if user B has made a cal, balances of B and C will be updated. When checking [[Balance cutoff]] system checks both balances - user's and company's. In case if any of these balances prohibits call passing through, the call is blocked, even if it could be acceptable due to other balance. You can choose mode of [[Balance cutoff]] in user group settings. This configuration option would be used by default for all users of this group. Also you can define this mode for each user personally. In this case system will use option not from user group, but from user's settings. * [[Balance cutoff]] [[Балансы|Русский перевод]]