3. @kazoocon
People like to talk a lot about "billing"
What IS billing?
The request usually comes in the form "I just
need something simple."
That's usually a gross understatement of the
actual desire.
13. @kazoocon
● Inbound
● Limit the number of simultaneous inbound calls
that can be received
● Outbound
● Limit the number of simultaneous outbound calls
that can be made
● Two-way
● Limit the number of simultaneous calls that can be made
● Resource consuming
● Any endpoint the system operators likely pay for
(upstream carriers generally)
● Limit the number of calls that can consume resources
(internal calls unaffected)
14. @kazoocon
● Burst
● Allows account to consume more trunks than the base
number allotted, typically for short intervals
● Good for seasonal, customer support, radio shows, call
centers, schools, etc
● Bundled Trunks
● Inbound, Outbound, Twoway as well
● Limit determined by the number of users or devices
(configurable)
● "twoway_bundled":"user", for example
● Prepay
● Pay up front, deduct until 0
● No simultaneous call limit
● Postpay
● Basically prepay that can go negative
15. @kazoocon
● Allotments
● Buckets of minutes per time-period
● Monthly, Weekly, Daily, Hourly, Minutely (seriously)
Emergency calls are immediately authorized, as are
outbound calls to tollfree numbers.
Each CDR is augmented with two fields showing the trunk
usage for the account and the reseller at the time of the call.
The format is:
{INBOUND}/{OUTBOUND}/{TWOWAY}/{BURST}.
19. @kazoocon
Track temporal data in temporal databases
● Affectionately called MODBs (month-only databases)
● Stores temporal data for a given month (ACCTID-YYYYMM)
● Keeps account database small and fast
● Monthly rollovers for transactions and other ledger-based
work
● Views with map/reduce maintain the month's balances
● Once out of scope, MODBs can be archived and deleted
20. @kazoocon
● Rate real-time, in parallel with authorization
● Helps with fraud
● Scales by accounts, so technically infinitely
● Tracks funny money
● Allows external billing systems
● Admins can easily apply credits to accounts
22. @kazoocon
Setup Authorization
● Enable authorization on calls
● sup whapps_config set_default ecallmgr authz_enabled true
● sup whapps_config flush ecallmgr
● sup -necallmgr ecallmgr_config flush
● Authorize local resource usage
● sup whapps_config set_default ecallmgr authz_local_resources true
● sup whapps_config flush ecallmgr
● sup -necallmgr ecallmgr_config flush
● Dry Run authz attempts (useful when testing authz)
● sup whapps_config set_default ecallmgr authz_dry_run true
● Still allows a call that would have been denied
● Require a rate to continue call
● sup whapps_config set_default ecallmgr {DIRECTION}_rate_required true
● If enabled, ensures a rate is found for the leg; otherwise kills the channel
● Default Authz action (if authz request fails)
● sup whapps_config set_default ecallmgr authz_default_action deny
● Alternative setting is “allow”
23. @kazoocon
Adding limits to an account
Add limits to an account:
POST /v2/accounts/{ACCOUNT_ID}/limits
{
"data": {
"twoway_trunks": 0,
"inbound_trunks": 11,
"allow_prepay": true,
"outbound_trunks": 5
}
}
Check the limits schema for various limits to be set here and read more about
the limits API in applications/crossbar/doc/limits.md
Resellers and system admins can perform this request.
24. @kazoocon
Manually limit account limit settings
System admins can manually restrict an account's limits:
Prefixing any of the limit doc's keys with “pvt_” will restrict the account's
ability to set that limit.
Setting “pvt_enabled" to false on the account's limit doc