Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

2600Hz - Telecom Rating and Limits

2,530 views

Published on

James Aimonetti discusses VoIP Rates, Routing, and Services at KazooCon 2015.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

2600Hz - Telecom Rating and Limits

  1. 1. PRESENTED BY: Rating and Limits ● James Aimonetti
  2. 2. @kazoocon Lets Talk Billing
  3. 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.
  4. 4. @kazoocon ● Recurring Subscriptions (monthly charges) ● Pro-rated monthly subscriptions ● Activation charges ● Per-minute / per-use charges ● Limits on spend (daily, monthly, pre-pay/credit base) ● Allocations of usage (400 minutes included - daily, monthly, etc.)
  5. 5. @kazoocon ● Bursting / overage charges ● Rating of calls ● Pre-pay vs. post-pay ● Auto top up ● Deposit tracking ● Accounts Payable / Accounts Receivable
  6. 6. @kazoocon ● Strategies for warning customers ● low balances ● overdue ● expiring credit card ● Discounts ● one time ● Continuous ● Rate decks (global + account based) ● Actual cost analysis
  7. 7. @kazoocon
  8. 8. @kazoocon Rating – What Is It Good For?
  9. 9. @kazoocon Rate Document ● prefix:"1" ● iso_country_code:"US" ● description:"US default rate" ● direction:"both" ● rate_name:"US-1" ● routes:["^+1d+$"] ● options:[] ● weight:10 ● rate_increment:60 ● rate_minimum:60 ● rate_surcharge:1.00 ● rate_cost:0.01
  10. 10. @kazoocon
  11. 11. @kazoocon Testing Your Rate Deck sup hotornot_maintenance rates_for_did 4158867900 Candidates: RATE NAME | COST | INCREMENT | MINIMUM | SURCHARGE | WEIGHT | PREFIX US-1-INBOUND |0.0049 | 60 | 60 | 0.00 | 2 | 1 US-1-OUTBOUND |0.0089 | 60 | 60 | 0.00 | 2 | 1 Matching: RATE NAME | COST | INCREMENT | MINIMUM | SURCHARGE | WEIGHT | PREFIX * US-1-OUTBOUND | 0.0089 | 60 | 60 | 0.00 | 2 | 1 US-1-INBOUND | 0.0049 | 60 | 60 | 0.00 | 2 | 1
  12. 12. @kazoocon Limits in Kazoo
  13. 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. 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. 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}.
  16. 16. @kazoocon
  17. 17. @kazoocon
  18. 18. @kazoocon Limits – Behind the Curtains
  19. 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. 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
  21. 21. @kazoocon Setup, Configuration, and Monitoring
  22. 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. 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. 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
  25. 25. @kazoocon Authz Summary sup jonny5_maintenance authz_summary [{ACCOUNT_ID}] +--------------+----+-----+------------+---------+----------+---------+ | Account ID | Cs | RCs | Allotments | Inbound | Outbound | Per Min | +==============+====+=====+============+=========+==========+=========+ |{ACCOUNT_ID_1}| 1 | 1 | 0 | 1 | 0 | 0 | +--------------+----+-----+------------+---------+----------+---------+ |{ACCOUNT_ID_2}| 1 | 1 | 0 | 1 | 0 | 0 | +--------------+----+-----+------------+---------+----------+---------+ |{ACCOUNT_ID_3}| 1 | 1 | 0 | 1 | 0 | 0 | +--------------+----+-----+------------+---------+----------+---------+ sup jonny5_maintenance limits_summary [{ACCOUNT_ID}] +--------------+----+-----+----+-----------------+--------+-------------+ |Account ID | Cs | RCs | As | Trunks | PerMin | Max Postpay | | | | | |In|Out|Both|Burst| | | +==============+====+=====+====+=================+========+=============+ |{ACCOUNT_ID_1}| -1 | -1 | 0 |3 |0 |3 |0 | 124.668| disabled | +--------------+----+-----+----+-----------------+--------+-------------+ |{ACCOUNT_ID_2}| -1 | -1 | 0 |20|0 |20 |0 | 814.201| disabled | +--------------+----+-----+----+-----------------+--------+-------------+ |{ACCOUNT_ID_3}| -1 | -1 | 0 |0 |0 |0 |0 | 693.675| -5000.0 | +--------------+----+-----+----+-----------------+--------+-------------+
  26. 26. @kazoocon Managing credit for accounts sup whistle_services_maintenance credit {ACCOUNT_ID} 5.0 sup whistle_services_maintenance debit {ACCOUNT_ID} 5.0
  27. 27. @kazoocon Logs to Look For This call is consuming a flat rate trunk |{CALL_ID}|j5_request:186 (<0.29272.139>) account {ACCOUNT_ID} authorized channel: flat_rate |{CALL_ID}|j5_request:177 (<0.29272.139>) reseller {RESELLER_ID} authorized channel: flat_rate This call was authorized because it is an outbound tollfree call |{CALL_ID}|j5_authz_req:153 (<0.14181.140>) allowing outbound tollfree call |{CALL_ID}|j5_request:186 (<0.14181.140>) account {ACCOUNT_ID} authorized channel: limits_disabled |{CALL_ID}|j5_request:177 (<0.14181.140>) reseller {RESELLER_ID} authorized channel: limits_disabled
  28. 28. @kazoocon What to look for in the CDR { "_id": "201509-{CALL_ID}", "_rev": "1-efde475f92bd0ef742d8de4d788125ac", "billing_seconds": "10", "call_direction": "inbound", "custom_channel_vars": { "base_cost": "49", "rate_name": "US-1-INBOUND", "surcharge": "0", "rate_minimum": "60", "rate_increment": "60", "rate": "49", "account_id": "{ACCOUNT_ID}", "account_billing": "limits_disabled", "reseller_id": "{RESELLER_ID}", "reseller_billing": "limits_disabled", "channel_authorized": "true", "global_resource": "false", "account_trunk_usage": "0/0/0/0", "reseller_trunk_usage": "0/0/0/0" }, }
  29. 29. Thank You! #kazoocon1

×