SlideShare a Scribd company logo
1 of 27
Download to read offline
To A or t KA ?
May 3, 2018
St-Pet b , Rus
… fo t Er a g w a d s a c ...
Tha t BI N ...
The ti t e BI N ...
Kir Sy o
A Bit of Nostalgia
● 2011 -> 201? - The golden era of Kazoo open source
● KazooUI as an example of how to build your very own UI
● waiting for a Monster or miracle is somewhere around the corner.
kirill.sysoev@gmail.comCluecon 2012
Those Were the Days...
Cruel Reality?
● MonsterUI - everything you need, but rarely open-sourced
● Vendor OPEN CORE lock?
● Apocalypsis… and OTF WAS BORN!
● Is there any other open source project to run away?
Open core era disappointment
kirill.sysoev@gmail.com
Is there really any difference?
No difference in case you are able to code on your own a bit...
kirill.sysoev@gmail.com
A feature seems vital to you might not be priorities for the community ( == PR wont be accepted )
VS
Feature you need badly could be out of open core spot ( == PR wont be accepted )
Some bonuses of open core as a plus:
● you can compete with closed features
● you can opensource your “closed feature competotor” … and say hello to 2600hz
● Kazoo got more reasons to have stable future..
● more to be understood...
By the way...
● Just another FreePBX?
● The most powerful and open VoIP platform available? (2600hz.org)
● Mega glue for Kamailio and FreeSwitch?
● Cloud communications platform?
What is Kazoo for you?
kirill.sysoev@gmail.com
Why not?
● distributed
● horizontally scalable
● database backend
● RESTful API
● etc.
KAZOO == Cloud communications platform?
kirill.sysoev@gmail.com
- I wanna sell potatoes online!
- Try KAZOO!
applications
Did I miss something?
Selling potatoes online is a promising idea!
VoIP services is not that bad too…
… but how will I bill my customers?
kirill.sysoev@gmail.com
They say:
● use third-party billing;
● billing is a very complex “thing”;
● understanding of billing differs from one
person/company/country to another;
● better not even start thinking about billing kazoo_app.
Which means:
● use/serve additional technology stack;
● spend more money;
● have another single point of failure.
I’ve got the problem
kirill.sysoev@gmail.com
● get rid of third-party billing/rating system;
● more familiar to customers payment gateways needed;
● dirty hacks before they evolve to PRs should have a place to live somewhere too :)
● don’t want to look like other tens?/hundreds? of VoIP websites;
● don’t want to hire an army of admins to manage the Zoo.
I Want To Break Free
A plan to escape
● dare to run your billing tasks in Kazoo;
● create your very own UI;
● use the same stack as used for Kazoo development to save time and money.
Do more with less tools
kirill.sysoev@gmail.com
FrontendBackend
● Erlang web framework (Zotonic for now)
○ Server side rendering
○ Erlang
○ ErlyDTL
○ Cowboy
○ WebSockets and Comet
● Kazoo app soon
○ Zotonic libs Hex packages
○ What if we omit crossbar just for fun?
● Kazoo app:
○ Erlang
○ ErlyDTL
○ Cowboy
○ Websockets
The same technology stack
A bit about OKUI
kirill.sysoev@gmail.com
● Inspired by KazooUI, therefore:
○ a kind of frontend just to expose features provided by crossbar;
○ probably should be rewritten or at least design should be improved.
● Kazoo administration
○ accounts management
○ routing
○ notifications
● Kazoo monitoring
○ system-wide registrations
○ system-wide current calls (live)
● Customer portal
○ user portal
○ callflow builder
○ conference manager
○ etc.
https://github.com/onnet/zotonic_mod_kazoo
OnNet Kazoo UI
OKUI: Kazoo administration
kirill.sysoev@gmail.com
OKUI: monitoring
kirill.sysoev@gmail.com
OKUI: accounts management
kirill.sysoev@gmail.com
OKUI: Callflow Builder
kirill.sysoev@gmail.com
OKUI: account settings
kirill.sysoev@gmail.com
OnNet Kazoo UI
kirill.sysoev@gmail.com
https://github.com/onnet/zotonic_mod_kazoo
Results:
● Just another Kazoo UI Frontend - boring, huh?
● But big fun is around the corner ...
○ UI as kazoo_app?
○ just git clone, make and run
○ why use crossbar if we are that close to kazoo core libs (beware - dirty hack) :)
○ etc.
Behind the scenes
kirill.sysoev@gmail.com
Goals wanted!
● real time billing;
● each reseller at each level should be able to run it’s billing tasks independently (currency, balances, etc.);
● additional payment gateways like Paypal, Yandex.Money, etc should be connected;
● all charges are made against Kazoo account balance, no hooks to customer’s pocket;
● Braintree top-up is an exception;
● funds could be added manually in case of customers wire transfer;
● different charging schemes support: monthly recurring / daily basis fee;
● documents should be generated automatically at the end of each billing period.
Dare to put all the eggs in one distributed and scalable basket?
https://github.com/onnet/zzapp
Want to get close to real time?
kirill.sysoev@gmail.com
doc_created doc_edited
● <<”doc_type”>>
○ <<”limits”>>
○ <<”user”>>
○ <<”device”>>
○ <<”number”>>
○ <<”credit”>>
○ ...
● <<”doc_type”>>
○ <<”limits”>>
○ ...
Just listen to your docs...
account
● services
○ reconcile/1
○ sync/1
https://github.com/onnet/zzapp/blob/master/src/onbill_handlers.erl#L31-L71
A place where all the logic lives
https://github.com/onnet/zzapp/blob/master/src/misc/kz_bookkeeper_onbill.erl
kirill.sysoev@gmail.com
Wasn’t that hard - just a reworked kz_bookkeeper_braintree.erl
● rely on our own data, not Braintree;
● keep all the transactions’ information in CouchDB;
● implement Prorated/MRC functionality on your own.
Bookkeeper - the module intended to determine the logic of billing process
Bookkeeper tasks
kirill.sysoev@gmail.com
Run checks against account:
● trial or full state
● good standing or delinquent
● whether new period starts
● if sync needed
https://github.com/onnet/zzapp/blob/master/src/misc/kz_bookkeeper_onbill.erl
Bookkeeper tasks
kirill.sysoev@gmail.com
To charge or not to charge:
● newly added services;
● daily fees in case applicable.
Handle transactions
● list transactions - nothing to do it’s already local
● save transactions local
How to charge?
kirill.sysoev@gmail.com
Monthly Recurring Charge Daily fees
● MRC / Prorated MRC;
● In case account lacks of funds for new
billing period flat rate services could be
automatically cancelled.
● account charged on daily basis;
● fraction of monthly fee extracted day by day
● if account goes negative it could be blocked
until top-up;
● some services (flat rate trunks) could be
excluded from this scheme to be charged on
monthly basis.
Payment gateways
kirill.sysoev@gmail.com
Braintree pros & cons:
● works out of the box;
but:
● not all countries supported;
● customers don’t like to share its credit cards info;
● they say Braintree don’t like VoIP businesses :).
Which payment gateway to choose?
● it depends:
○ country;
○ customer type.
● .. you need more than one for failover anyway.
Payment gateways how to
kirill.sysoev@gmail.com
Good news!
Add payment gateway as easy as create crossbar module:
1. Use inbound hook for payment approval to avoid standard auth process
(https://{SERVER}:8443/hooks/paymentgw/5c36900d63069782e4e0b0ad2f131e45)
2. Validate request as payment gateway recommends
3. Add transaction to an account
A couple of examples:
● Paypal - https://github.com/onnet/zzapp/blob/master/src/crossbar/cb_paypal.erl
● Yandex.Money - https://github.com/onnet/zzapp/blob/master/src/crossbar/cb_yandex_money.erl
Payment gateways
kirill.sysoev@gmail.com
Docs as easy as a pie
kirill.sysoev@gmail.com
Documents generation:
● automatically;
● on demand;
● mail to account admins optionally.
https://github.com/onnet/zzapp/blob/master/src/onbill_docs.erl
Ready to sell potatoes online now? :)
Enjoy!
kirill.sysoev@gmail.com

More Related Content

Similar to Kazoo billing

Frappe Open Day - March 2018
Frappe Open Day - March 2018Frappe Open Day - March 2018
Frappe Open Day - March 2018Kenneth Sequeira
 
AppDynamics User Group
AppDynamics User GroupAppDynamics User Group
AppDynamics User GroupMike Ruangutai
 
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfKiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfssuser62db4d1
 
JUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our cultureJUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our culturePeter Mounce
 
Ensuring Your Technology Will Scale
Ensuring Your Technology Will ScaleEnsuring Your Technology Will Scale
Ensuring Your Technology Will Scalebasissetventures
 
Cvg executive-summit-2018-rpa-plus-video
Cvg executive-summit-2018-rpa-plus-videoCvg executive-summit-2018-rpa-plus-video
Cvg executive-summit-2018-rpa-plus-videoDoug Ross
 
Automated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfAutomated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfVishwas N
 
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013Bob Bloom
 
Google Cloud: Next'19 Extended Hanoi
Google Cloud: Next'19 Extended HanoiGoogle Cloud: Next'19 Extended Hanoi
Google Cloud: Next'19 Extended HanoiGCPUserGroupVietnam
 
Technical Debt - Why should you care? (Agiles Buenos Aires 2011)
Technical Debt - Why should you care?  (Agiles Buenos Aires 2011)Technical Debt - Why should you care?  (Agiles Buenos Aires 2011)
Technical Debt - Why should you care? (Agiles Buenos Aires 2011)CI&T
 
Aws uk ug #8 not everything that happens in vegas stay in vegas
Aws uk ug #8   not everything that happens in vegas stay in vegasAws uk ug #8   not everything that happens in vegas stay in vegas
Aws uk ug #8 not everything that happens in vegas stay in vegasPeter Mounce
 
Data Data Everywhere: Drowning in a Sea of Analytics
Data Data Everywhere: Drowning in a Sea of AnalyticsData Data Everywhere: Drowning in a Sea of Analytics
Data Data Everywhere: Drowning in a Sea of AnalyticsMegan Denhardt
 
Shaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingShaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingChristos Tsakostas
 
From 4 releases per year to 104 Joakim Lindbom - Redhat Summit 2020
From 4 releases per year to 104   Joakim Lindbom - Redhat Summit 2020From 4 releases per year to 104   Joakim Lindbom - Redhat Summit 2020
From 4 releases per year to 104 Joakim Lindbom - Redhat Summit 2020Joakim Lindbom
 
Use cases of Grails in web applications
Use cases of Grails in web applicationsUse cases of Grails in web applications
Use cases of Grails in web applicationsGrailsConf
 
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav Singh
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav SinghPyParis2017 / Machine learning to moderate classifieds, by Vaibhav Singh
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav SinghPôle Systematic Paris-Region
 
No Code Past The MVP
No Code Past The MVPNo Code Past The MVP
No Code Past The MVPSteph Smith
 

Similar to Kazoo billing (20)

Frappe Open Day - March 2018
Frappe Open Day - March 2018Frappe Open Day - March 2018
Frappe Open Day - March 2018
 
Frappe Open Day - March 2018
Frappe Open Day - March 2018Frappe Open Day - March 2018
Frappe Open Day - March 2018
 
AppDynamics User Group
AppDynamics User GroupAppDynamics User Group
AppDynamics User Group
 
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdfKiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
Kiwi SaaS Metrics That Matter 2023^LLJ r2.2.pdf
 
Do Digital Right Masterclass - Graeme Blake, Blutui
Do Digital Right Masterclass - Graeme Blake, BlutuiDo Digital Right Masterclass - Graeme Blake, Blutui
Do Digital Right Masterclass - Graeme Blake, Blutui
 
JUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our cultureJUST EAT: Tools we use to enable our culture
JUST EAT: Tools we use to enable our culture
 
Ensuring Your Technology Will Scale
Ensuring Your Technology Will ScaleEnsuring Your Technology Will Scale
Ensuring Your Technology Will Scale
 
Cvg executive-summit-2018-rpa-plus-video
Cvg executive-summit-2018-rpa-plus-videoCvg executive-summit-2018-rpa-plus-video
Cvg executive-summit-2018-rpa-plus-video
 
Automated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdfAutomated Governance for the DevOps Institutions.pdf
Automated Governance for the DevOps Institutions.pdf
 
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013
eCommerce Presentation, Joomla User Group Toronto, Oct 22, 2013
 
Open Day July 2019
Open Day July 2019Open Day July 2019
Open Day July 2019
 
Google Cloud: Next'19 Extended Hanoi
Google Cloud: Next'19 Extended HanoiGoogle Cloud: Next'19 Extended Hanoi
Google Cloud: Next'19 Extended Hanoi
 
Technical Debt - Why should you care? (Agiles Buenos Aires 2011)
Technical Debt - Why should you care?  (Agiles Buenos Aires 2011)Technical Debt - Why should you care?  (Agiles Buenos Aires 2011)
Technical Debt - Why should you care? (Agiles Buenos Aires 2011)
 
Aws uk ug #8 not everything that happens in vegas stay in vegas
Aws uk ug #8   not everything that happens in vegas stay in vegasAws uk ug #8   not everything that happens in vegas stay in vegas
Aws uk ug #8 not everything that happens in vegas stay in vegas
 
Data Data Everywhere: Drowning in a Sea of Analytics
Data Data Everywhere: Drowning in a Sea of AnalyticsData Data Everywhere: Drowning in a Sea of Analytics
Data Data Everywhere: Drowning in a Sea of Analytics
 
Shaping the Future of Automatic Programming
Shaping the Future of Automatic ProgrammingShaping the Future of Automatic Programming
Shaping the Future of Automatic Programming
 
From 4 releases per year to 104 Joakim Lindbom - Redhat Summit 2020
From 4 releases per year to 104   Joakim Lindbom - Redhat Summit 2020From 4 releases per year to 104   Joakim Lindbom - Redhat Summit 2020
From 4 releases per year to 104 Joakim Lindbom - Redhat Summit 2020
 
Use cases of Grails in web applications
Use cases of Grails in web applicationsUse cases of Grails in web applications
Use cases of Grails in web applications
 
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav Singh
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav SinghPyParis2017 / Machine learning to moderate classifieds, by Vaibhav Singh
PyParis2017 / Machine learning to moderate classifieds, by Vaibhav Singh
 
No Code Past The MVP
No Code Past The MVPNo Code Past The MVP
No Code Past The MVP
 

Recently uploaded

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Recently uploaded (20)

Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

Kazoo billing

  • 1. To A or t KA ? May 3, 2018 St-Pet b , Rus … fo t Er a g w a d s a c ... Tha t BI N ... The ti t e BI N ... Kir Sy o
  • 2. A Bit of Nostalgia ● 2011 -> 201? - The golden era of Kazoo open source ● KazooUI as an example of how to build your very own UI ● waiting for a Monster or miracle is somewhere around the corner. kirill.sysoev@gmail.comCluecon 2012 Those Were the Days...
  • 3. Cruel Reality? ● MonsterUI - everything you need, but rarely open-sourced ● Vendor OPEN CORE lock? ● Apocalypsis… and OTF WAS BORN! ● Is there any other open source project to run away? Open core era disappointment kirill.sysoev@gmail.com
  • 4. Is there really any difference? No difference in case you are able to code on your own a bit... kirill.sysoev@gmail.com A feature seems vital to you might not be priorities for the community ( == PR wont be accepted ) VS Feature you need badly could be out of open core spot ( == PR wont be accepted ) Some bonuses of open core as a plus: ● you can compete with closed features ● you can opensource your “closed feature competotor” … and say hello to 2600hz ● Kazoo got more reasons to have stable future.. ● more to be understood...
  • 5. By the way... ● Just another FreePBX? ● The most powerful and open VoIP platform available? (2600hz.org) ● Mega glue for Kamailio and FreeSwitch? ● Cloud communications platform? What is Kazoo for you? kirill.sysoev@gmail.com
  • 6. Why not? ● distributed ● horizontally scalable ● database backend ● RESTful API ● etc. KAZOO == Cloud communications platform? kirill.sysoev@gmail.com - I wanna sell potatoes online! - Try KAZOO! applications
  • 7. Did I miss something? Selling potatoes online is a promising idea! VoIP services is not that bad too… … but how will I bill my customers? kirill.sysoev@gmail.com They say: ● use third-party billing; ● billing is a very complex “thing”; ● understanding of billing differs from one person/company/country to another; ● better not even start thinking about billing kazoo_app. Which means: ● use/serve additional technology stack; ● spend more money; ● have another single point of failure.
  • 8. I’ve got the problem kirill.sysoev@gmail.com ● get rid of third-party billing/rating system; ● more familiar to customers payment gateways needed; ● dirty hacks before they evolve to PRs should have a place to live somewhere too :) ● don’t want to look like other tens?/hundreds? of VoIP websites; ● don’t want to hire an army of admins to manage the Zoo. I Want To Break Free A plan to escape ● dare to run your billing tasks in Kazoo; ● create your very own UI; ● use the same stack as used for Kazoo development to save time and money.
  • 9. Do more with less tools kirill.sysoev@gmail.com FrontendBackend ● Erlang web framework (Zotonic for now) ○ Server side rendering ○ Erlang ○ ErlyDTL ○ Cowboy ○ WebSockets and Comet ● Kazoo app soon ○ Zotonic libs Hex packages ○ What if we omit crossbar just for fun? ● Kazoo app: ○ Erlang ○ ErlyDTL ○ Cowboy ○ Websockets The same technology stack
  • 10. A bit about OKUI kirill.sysoev@gmail.com ● Inspired by KazooUI, therefore: ○ a kind of frontend just to expose features provided by crossbar; ○ probably should be rewritten or at least design should be improved. ● Kazoo administration ○ accounts management ○ routing ○ notifications ● Kazoo monitoring ○ system-wide registrations ○ system-wide current calls (live) ● Customer portal ○ user portal ○ callflow builder ○ conference manager ○ etc. https://github.com/onnet/zotonic_mod_kazoo OnNet Kazoo UI
  • 16. OnNet Kazoo UI kirill.sysoev@gmail.com https://github.com/onnet/zotonic_mod_kazoo Results: ● Just another Kazoo UI Frontend - boring, huh? ● But big fun is around the corner ... ○ UI as kazoo_app? ○ just git clone, make and run ○ why use crossbar if we are that close to kazoo core libs (beware - dirty hack) :) ○ etc.
  • 17. Behind the scenes kirill.sysoev@gmail.com Goals wanted! ● real time billing; ● each reseller at each level should be able to run it’s billing tasks independently (currency, balances, etc.); ● additional payment gateways like Paypal, Yandex.Money, etc should be connected; ● all charges are made against Kazoo account balance, no hooks to customer’s pocket; ● Braintree top-up is an exception; ● funds could be added manually in case of customers wire transfer; ● different charging schemes support: monthly recurring / daily basis fee; ● documents should be generated automatically at the end of each billing period. Dare to put all the eggs in one distributed and scalable basket? https://github.com/onnet/zzapp
  • 18. Want to get close to real time? kirill.sysoev@gmail.com doc_created doc_edited ● <<”doc_type”>> ○ <<”limits”>> ○ <<”user”>> ○ <<”device”>> ○ <<”number”>> ○ <<”credit”>> ○ ... ● <<”doc_type”>> ○ <<”limits”>> ○ ... Just listen to your docs... account ● services ○ reconcile/1 ○ sync/1 https://github.com/onnet/zzapp/blob/master/src/onbill_handlers.erl#L31-L71
  • 19. A place where all the logic lives https://github.com/onnet/zzapp/blob/master/src/misc/kz_bookkeeper_onbill.erl kirill.sysoev@gmail.com Wasn’t that hard - just a reworked kz_bookkeeper_braintree.erl ● rely on our own data, not Braintree; ● keep all the transactions’ information in CouchDB; ● implement Prorated/MRC functionality on your own. Bookkeeper - the module intended to determine the logic of billing process
  • 20. Bookkeeper tasks kirill.sysoev@gmail.com Run checks against account: ● trial or full state ● good standing or delinquent ● whether new period starts ● if sync needed https://github.com/onnet/zzapp/blob/master/src/misc/kz_bookkeeper_onbill.erl
  • 21. Bookkeeper tasks kirill.sysoev@gmail.com To charge or not to charge: ● newly added services; ● daily fees in case applicable. Handle transactions ● list transactions - nothing to do it’s already local ● save transactions local
  • 22. How to charge? kirill.sysoev@gmail.com Monthly Recurring Charge Daily fees ● MRC / Prorated MRC; ● In case account lacks of funds for new billing period flat rate services could be automatically cancelled. ● account charged on daily basis; ● fraction of monthly fee extracted day by day ● if account goes negative it could be blocked until top-up; ● some services (flat rate trunks) could be excluded from this scheme to be charged on monthly basis.
  • 23. Payment gateways kirill.sysoev@gmail.com Braintree pros & cons: ● works out of the box; but: ● not all countries supported; ● customers don’t like to share its credit cards info; ● they say Braintree don’t like VoIP businesses :). Which payment gateway to choose? ● it depends: ○ country; ○ customer type. ● .. you need more than one for failover anyway.
  • 24. Payment gateways how to kirill.sysoev@gmail.com Good news! Add payment gateway as easy as create crossbar module: 1. Use inbound hook for payment approval to avoid standard auth process (https://{SERVER}:8443/hooks/paymentgw/5c36900d63069782e4e0b0ad2f131e45) 2. Validate request as payment gateway recommends 3. Add transaction to an account A couple of examples: ● Paypal - https://github.com/onnet/zzapp/blob/master/src/crossbar/cb_paypal.erl ● Yandex.Money - https://github.com/onnet/zzapp/blob/master/src/crossbar/cb_yandex_money.erl
  • 26. Docs as easy as a pie kirill.sysoev@gmail.com Documents generation: ● automatically; ● on demand; ● mail to account admins optionally. https://github.com/onnet/zzapp/blob/master/src/onbill_docs.erl
  • 27. Ready to sell potatoes online now? :) Enjoy! kirill.sysoev@gmail.com