Usm lanbilling EN: различия между версиями
Нет описания правки |
|||
Строка 2: | Строка 2: | ||
{{ActivEN}} | {{ActivEN}} | ||
'''usm_lanbilling''' - module for organising the import of data from LANBilling billing system into ERP ''UserSide'' | |||
'''This module is a replacement for the obsolete [[us_lanbilling_EN|us_lanbilling]] module''' - See: [[Migration from us lanbilling to usm lanbilling]] | |||
'''Module Language:''' PHP | |||
'''Current version:''' See page: [[Modules_EN|Modules]] | |||
'''Module Status:''' [https://www.userside.eu/en/pricing Paid] | |||
For more information and a list of imported data, see the page: [[LANBilling_EN|LANBilling]] | |||
== Information on installing the module == | |||
'''Make sure that the php_mysqli library is present on the system where the module will run''' | |||
The usm_lanbilling.zip archive contains the files | |||
usm_lanbilling.php | |||
usm_lanbilling.conf.php-example | |||
1. On any server ''(no difference - billing server, userside or third machine)'' allocate a separate ''(arbitrary)'' directory for the module and place these files in it | |||
2. Allocate a separate directory for the module logs. Give write permissions to this directory. | |||
3. The example configuration file usm_lanbilling.conf.php-example should be renamed to usm_lanbilling.conf.php and make the required changes ''(the list of parameters is given below)'' in it | |||
4. Run the module manually several times (*) with the command | |||
php usm_lanbilling.php | |||
It should work without error and return the data: | |||
usm_lanbilling | |||
==================================== | |||
Start module at 2015-11-22 17:32:03 | |||
Finish module at 2015-11-22 17:32:14 | |||
==================================== | |||
''* - At the first run - many objects will be pre-created only. The more objects the module imports - the longer it will take. The second and subsequent runs will reconcile the changed data and only these will be updated. The second run will also take a long time, because after the first run the newly created objects do not contain any data. But the third and subsequent runs will run much faster.'' | |||
5. Visually verify the completeness of the imported data in the ERP "UserSide" | |||
6. When it is clear that the module works stably - add it to the system cron for periodic operation ''(specify the necessary paths)''. | |||
*/10 * * * * php usm_lanbilling.php | |||
== Parameters == | |||
The module is configured in the '''usm_lanbilling.conf.php''' file | |||
You can also use the default parameters from the [[usm_billing#Configuration Parameters|usm_billing]] module | |||
$usersideUrl - URL to the ERP "UserSide" | |||
$usersideApiKey - [[UserSide API Key|API-key of ERP "UserSide"]] | |||
$billingId - Billing number in ERP "UserSide" ''("Settings - Billings")'' | |||
$logPath - Path for logging | |||
$isSilence - Silence Mode flag ''(hide the output of information messages from the module to the console)'' | |||
$billingDBHost - address of the billing server | |||
$billingDBUser - user name for access to the billing database | |||
$billingDBPassword - password for access to the billing database | |||
$billingDBBName - billing database name | |||
$billingCodePage - billing database encoding | |||
$confTariffImportList - types of imported services ''(default 0,1,2,5) (tarifs.type - tariff type: 0-cable agent, 1-RADIUS by volume, 2-RADIUS by time, 3-Classical telephony, 4-VoIP, 5-Periodic and ad hoc services)'' | |||
$confAdrImportSrc - address import source ''(0 - from accounts_addr, 1 - from vgroups_addr, 2 - from both sources)'' | |||
$confImportOnlyVgroupsId - import only with specific vgroups.id ''(it is recommended not to change)'' | |||
$confCollectorType - collector type ''(options "user", "rad")'' | |||
$confCollectorId - traffic collector code - used for billing tables - usernnnyyyyymmdd or radnnnyyyyyymmdd | |||
$confIsSkipUpdateAgreementDate - flag - do not update contract date | |||
$confIsSkipCustomerWithClosedAgreement - flag - do not import subscribers with closed contracts | |||
$confIsOldBillingIp - flag - old IP-address format | |||
$accountAddString - add string when importing personal accounts | |||
$confAddFieldForPhone - additional field for phone number | |||
$confIsSkipLoadIp - flag - do not load IP addresses | |||
$confIsAddCityTypeToName - flag - add the type of our point to the name of our point | |||
$confIsAddStreetTypeToName - add street type to street name ''(0 - don't add, 1 - add after street name, 2 - add before street name)'' | |||
$confIsImportAlias - flag - import child records | |||
$confParameterTypePhone - suffix of the contract_parameter_type_ table field with phone number | |||
$confImportPassport - import passport data into additional field ... ''(specify additional field ID)'' | |||
$confIsCityNameInStreetName - flag - add name of settlement to street name | |||
$confIsImportOnlyWithVgroup - flag - import subscribers with vgroup only | |||
$confTrafLimitSelection - minimum value for importing traffic by subscriber ''(default: 2048)'' | |||
$confAccountsTable - name of the table with subscribers' accounts ''(default: accounts)'' | |||
$confIsDoNotUpdateAddPhone - flag - do not update values of subscribers' additional phones | |||
$confIsOnlyAdrSrc1 - flag - import addresses only with accounts_addr.type = 1 | |||
$accountExprString - additional string with the condition of importing subscribers ''(to table account)'' | |||
$confIsImportCustomerWoTariff - flag - import also subscribers without tariffs | |||
$confBillingBlockState0 - ID of used work status in USERSIDE for blocking state #0 in billing ''(vgroups.blocked) (default: 2 - working)''. | |||
$confBillingBlockState1 - ID of used work status in USERSIDE for blocking state #1 in billing ''(vgroups.blocked) (default: 1 - pause)'' | |||
$confBillingBlockState2 - ID of used work status in USERSIDE for blocking state #2 in billing ''(vgroups.blocked) (default: 1 - pause)'' | |||
$confBillingBlockState3 - ID of used work status in USERSIDE for blocking state #3 in billing ''(vgroups.blocked) (default: 1 - pause)'' | |||
$confBillingBlockState4 - ID of used work status in USERSIDE for blocking state #4 in billing ''(vgroups.blocked) (default: 0 - stop)'' | |||
$confBillingBlockState5 - ID of the used work status in USERSIDE for blocking state #1 in billing ''(vgroups.blocked) (default: 1 - pause)'' | |||
$confBillingBlockState10 - ID of used work status in USERSIDE for blocking state #4 in billing ''(vgroups.blocked) (default: 0 - pause)'' | |||
Access data to the second collector (statistics) LANBilling ''(if empty, then these credentials will not be used)'' | |||
$confStat2DBHost - address of the statistics server | |||
$confStat2DBUser - user name to access the statistics database | |||
$confStat2DBPassword - password to access the statistics database | |||
$confStat2DBBName - name of statistics database | |||
Access data to the third collector (statistics) LANBilling ''(if empty, then these credentials will not be used)'' | |||
$confStat3DBHost - address of the statistics server | |||
$confStat3DBUser - user name to access the statistics database | |||
$confStat3DBPassword - password to access the statistics database | |||
$confStat3DBName - name of statistics database | |||
$confCollector3Type - collector type ''(options "user", "rad")'' | |||
$confCollector3Id - traffic collector code - used for billing tables - usernnnyyyyymmdd or radnnnyyyyyymmdd |
Версия от 15:28, 26 октября 2023
This function is one of the possibilities |
usm_lanbilling - module for organising the import of data from LANBilling billing system into ERP UserSide
This module is a replacement for the obsolete us_lanbilling module - See: Migration from us lanbilling to usm lanbilling
Module Language: PHP
Current version: See page: Modules
Module Status: Paid
For more information and a list of imported data, see the page: LANBilling
Information on installing the module
Make sure that the php_mysqli library is present on the system where the module will run
The usm_lanbilling.zip archive contains the files
usm_lanbilling.php usm_lanbilling.conf.php-example
1. On any server (no difference - billing server, userside or third machine) allocate a separate (arbitrary) directory for the module and place these files in it
2. Allocate a separate directory for the module logs. Give write permissions to this directory.
3. The example configuration file usm_lanbilling.conf.php-example should be renamed to usm_lanbilling.conf.php and make the required changes (the list of parameters is given below) in it
4. Run the module manually several times (*) with the command
php usm_lanbilling.php
It should work without error and return the data:
usm_lanbilling ==================================== Start module at 2015-11-22 17:32:03 Finish module at 2015-11-22 17:32:14 ====================================
* - At the first run - many objects will be pre-created only. The more objects the module imports - the longer it will take. The second and subsequent runs will reconcile the changed data and only these will be updated. The second run will also take a long time, because after the first run the newly created objects do not contain any data. But the third and subsequent runs will run much faster.
5. Visually verify the completeness of the imported data in the ERP "UserSide"
6. When it is clear that the module works stably - add it to the system cron for periodic operation (specify the necessary paths).
*/10 * * * * php usm_lanbilling.php
Parameters
The module is configured in the usm_lanbilling.conf.php file
You can also use the default parameters from the usm_billing module
$usersideUrl - URL to the ERP "UserSide" $usersideApiKey - API-key of ERP "UserSide" $billingId - Billing number in ERP "UserSide" ("Settings - Billings") $logPath - Path for logging $isSilence - Silence Mode flag (hide the output of information messages from the module to the console)
$billingDBHost - address of the billing server $billingDBUser - user name for access to the billing database $billingDBPassword - password for access to the billing database $billingDBBName - billing database name $billingCodePage - billing database encoding
$confTariffImportList - types of imported services (default 0,1,2,5) (tarifs.type - tariff type: 0-cable agent, 1-RADIUS by volume, 2-RADIUS by time, 3-Classical telephony, 4-VoIP, 5-Periodic and ad hoc services) $confAdrImportSrc - address import source (0 - from accounts_addr, 1 - from vgroups_addr, 2 - from both sources) $confImportOnlyVgroupsId - import only with specific vgroups.id (it is recommended not to change) $confCollectorType - collector type (options "user", "rad") $confCollectorId - traffic collector code - used for billing tables - usernnnyyyyymmdd or radnnnyyyyyymmdd $confIsSkipUpdateAgreementDate - flag - do not update contract date
$confIsSkipCustomerWithClosedAgreement - flag - do not import subscribers with closed contracts $confIsOldBillingIp - flag - old IP-address format $accountAddString - add string when importing personal accounts $confAddFieldForPhone - additional field for phone number $confIsSkipLoadIp - flag - do not load IP addresses $confIsAddCityTypeToName - flag - add the type of our point to the name of our point $confIsAddStreetTypeToName - add street type to street name (0 - don't add, 1 - add after street name, 2 - add before street name) $confIsImportAlias - flag - import child records $confParameterTypePhone - suffix of the contract_parameter_type_ table field with phone number $confImportPassport - import passport data into additional field ... (specify additional field ID) $confIsCityNameInStreetName - flag - add name of settlement to street name $confIsImportOnlyWithVgroup - flag - import subscribers with vgroup only $confTrafLimitSelection - minimum value for importing traffic by subscriber (default: 2048) $confAccountsTable - name of the table with subscribers' accounts (default: accounts) $confIsDoNotUpdateAddPhone - flag - do not update values of subscribers' additional phones $confIsOnlyAdrSrc1 - flag - import addresses only with accounts_addr.type = 1 $accountExprString - additional string with the condition of importing subscribers (to table account) $confIsImportCustomerWoTariff - flag - import also subscribers without tariffs $confBillingBlockState0 - ID of used work status in USERSIDE for blocking state #0 in billing (vgroups.blocked) (default: 2 - working). $confBillingBlockState1 - ID of used work status in USERSIDE for blocking state #1 in billing (vgroups.blocked) (default: 1 - pause) $confBillingBlockState2 - ID of used work status in USERSIDE for blocking state #2 in billing (vgroups.blocked) (default: 1 - pause) $confBillingBlockState3 - ID of used work status in USERSIDE for blocking state #3 in billing (vgroups.blocked) (default: 1 - pause) $confBillingBlockState4 - ID of used work status in USERSIDE for blocking state #4 in billing (vgroups.blocked) (default: 0 - stop) $confBillingBlockState5 - ID of the used work status in USERSIDE for blocking state #1 in billing (vgroups.blocked) (default: 1 - pause) $confBillingBlockState10 - ID of used work status in USERSIDE for blocking state #4 in billing (vgroups.blocked) (default: 0 - pause)
Access data to the second collector (statistics) LANBilling (if empty, then these credentials will not be used)
$confStat2DBHost - address of the statistics server $confStat2DBUser - user name to access the statistics database $confStat2DBPassword - password to access the statistics database $confStat2DBBName - name of statistics database
Access data to the third collector (statistics) LANBilling (if empty, then these credentials will not be used)
$confStat3DBHost - address of the statistics server $confStat3DBUser - user name to access the statistics database $confStat3DBPassword - password to access the statistics database $confStat3DBName - name of statistics database $confCollector3Type - collector type (options "user", "rad") $confCollector3Id - traffic collector code - used for billing tables - usernnnyyyyymmdd or radnnnyyyyyymmdd