Real-time charging for OpenSIPS CGRateS - Workshop
Dan Christian [email protected]
OpenSIPS Workshop Chicago, August 2015
Our Background
Located in Bavaria/Germany, over 8 years of experience with architecting server side solutions in VoIP environment Platform implementations covering both wholesale and retail business categories
Responsibly understanding real-time processing constrains and the seriousness of live system outages
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
About CGRateSCharging/Billing engine Plug-able into existing billing infrastructureAccommodate new components into ISP/ITSP network (eg: add new VoIP switch, SMS Service, Data stream)Non-intrusive
Modular architectureEasy to enhance by rewriting specific components - JSON/HTTP/GOB RPC API
Performance OrientedBuilt-in transactional cache system (data ageing, live counters)Asynchronous processing with micro-threads
Feature-richMulti-tenancy, derived charging, account bundles, LCR, CDRStats, rates history, etcAgile in developing new features
Test driven developmentAprox. 1000 tests as part of the build system
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
CGRateS subsystems
OpenSIPS Integration
Multiple integration mechanismsBased on traffic profileShared data through pseudovariables
REST_CLIENT for call authorization, LCRHTTP-JSON RPC Request/Answer
EVI ACC_ACCOUNTING*prepaid, *pseudoprepaid, *postpaid, *rated
EVI E_ACC_CDR*pseudoprepaid, *postpaid, *rated
Db_flatstore CDR processing*pseudoprepaid, *postpaid, *rated
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
OpenSIPS Real-time Prepaid
Call AuthorizationAsync/sync support through the user of rest_clientSets maximum call duration through dialog timeout
Call disconnectExecuted through mi_datagram by CGR SessionManager
Call StartOut of E_ACC_EVENT via event_datagram to CGR-SMStarts debit loop in case of prepaid calls – real or emulated ones
Call Stop/MissedOut of E_ACC_EVENT/E_ACC_MISSED_EVENT via event_datagram to CGR-SMStops debit loopWrites CDRs
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task - Installation
VM installEmpty Debian Jessie out of netinstall
OpenSIPS installBuild debian packages, include rest_client (2.1 branch)
CGRateS installPrerequisites: git, redis-server, mysql-serverOut of officially provided packages by CGRateS team (0.9.1rc6)
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task - Configuration
OpenSIPSProvided opensips.cfg file out of cgrates repositoryPart of CGRateS build test environment
MySQLCreate CGRateS DB schema
CGRateSProvided cgrates.json dedicated for OpenSIPS integration
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – CGRateS Tariff Plan
AccountActions.csvActionPlans.csvActions.csvActionTriggers.csvCdrStats.csvDerivedChargers.csvDestinationRates.csvDestinations.csvLcrRules.csvRates.csvRatingPlans.csvRatingProfiles.csvSharedGroups.csvTimings.csvUsers.csv
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Meet the cgr-console
InteractiveOr not ...
History
Auto-completion
Help
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task - Calls
Prepaid users1001, 1006, 1007
Postpaid users1002
Pseudoprepaid users1003
Rated users1004
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – CDRC CDR import
Db_flatstore generated CDRRecords split between multiple filesFailed/missed calls CDR records
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – Check CDR Stats
Customer Stats
Supplier Stats
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – Exporting CDRs
Standard templateCheck derived charging
Extended template
Retrieve call detailsUsing cgr-console
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – Fraud Mitigation
Accounting levelMultiple calls from same account 1001
External top-up out of patternWarning – threshold level 1Account disable - threshold level 2Multiple calls out of same account – simultaneous disconnect on fraud detection
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Task – Console simulation
Check accounts
Call cost queries
LCR queries
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015
Questions?
Websitehttp://www.cgrates.org
Documentationhttp://cgrates.readthedocs.org
Code + issues tracker https://github.com/cgrates/cgrates
SupportGoogle group: CGRateSIRC Freenode: #cgrates
Real-time charging for OpenSIPSOpenSIPS Workshop Chicago, August 2015