Usm utm5 EN: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
 
(не показаны 3 промежуточные версии этого же участника)
Строка 56: Строка 56:
You can also use the default parameters from the [[usm_billing_EN#Configuration Parameters|usm_billing]] module
You can also use the default parameters from the [[usm_billing_EN#Configuration Parameters|usm_billing]] module


  $usersideUrl - URL to the ERP "UserSide"
  $usersideUrl         - URL to the ERP "UserSide"
  $usersideApiKey - [[UserSide API Key_EN|API-key of ERP "UserSide"]]
  $usersideApiKey     - [[UserSide API Key_EN|API-key of ERP "UserSide"]]
  $billingId - The billing number in ERP "UserSide" ''("Settings - Billings")''
  $billingId           - The billing number in ERP "UserSide" ''("Settings - Billings")''
  $logPath - Path for logging
  $logPath             - Path for logging
  $isSilence - Silence Mode flag ''(hide the output of information messages from the module to the console)''
  $isSilence           - Silence Mode flag ''(hide the output of information messages from the module to the console)''
$billingDBHost      - address of the billing server
$billingDBUser      - customer name for access to the billing database
$billingDBPassword  - password for access to the billing database
$billingDBName      - billing database name
$billingCodePage    - billing database encoding
$billingDbProvider  - DBMS type [mysql|postgresql] ''(default: mysql)''


$billingDBHost - address of the billing server
  $confServiceData                       - use service mappings instead of tariff mappings (0 - service mappings, 1 - tariff mappings, 2 - both)
$billingDBUser - user name for access to the billing database
  $confIsHideShablonsFromTariffList       - flag - do not include templates in tariff imports
$billingDBPassword - password for access to the billing database
  $confServiceDataServiceTypeRestrict     - import tariffs (and customers) with such service_data.service_type
$billingDBBName - billing database name
  $confRentId                             - ID of the field with customer fee for the tariff (services_data.service_type in billing)
$billingCodePage - billing database encoding
  $confDontImportTariffWithComment       - do NOT import tariffs with this comment
$billingDbProvider - DBMS type [mysql|postgresql] ''(default: mysql)''
  $confMultiplicationTariffFees           - multiplication factor for subscription fees in tariffs (1.20 - 20% VAT, etc.)
 
  $confServiceData - use service mappings instead of tariff mappings (0 - service mappings, 1 - tariff mappings, 2 - both)
  $confIsUseDateConnect                   - use customers.connect_date field to get the date of connection to the network (0 - users.create_date, 1 - users.connect_date).
  $confIsHideShablonsFromTariffList - flag - do not include templates in tariff imports
  $confIsCustomerConnectFix               - flag - add information about customers' connection to switches to additional data
  $confServiceDataServiceTypeRestrict - import tariffs (and users) with such service_data.service_type
  $confIsImportBankInformation           - flag - import customer's bank details into the "Additional data" field
  $confRentId - ID of the field with user fee for the tariff (services_data.service_type in billing)
  $confDontImportCustomerFromGroupId     - flag - do not import customers from this group (groups.id)
  $confDontImportTariffWithComment - do NOT import tariffs with this comment
  $confImportCustomerOnlyFromGroupId     - import customers ONLY from this group (groups.id)
  $confMultiplicationTariffFees - multiplication factor for subscription fees in tariffs (1.20 - 20% VAT, etc.)
  $confImportCustomerExpr                 - condition for importing customers. It allows importing only a part of customers from billing (executed before WHERE)
 
  $confImportCustomerExpr2               - condition for importing customers. Allows importing only a part of customers from the billing (executed after WHERE)
  $confIsUseDateConnect - use users.connect_date field to get the date of connection to the network (0 - users.create_date, 1 - users.connect_date).
  $confTrafficRxClass                     - class of incoming traffic  
  $confIsCustomerConnectFix - flag - add information about users' connection to switches to additional data
  $confTrafficTxClass                     - class of outgoing traffic (several comma separated)
  $confIsImportBankInformation - flag - import user's bank details into the "Additional data" field
  $confUseIpMethod                       - operation variant (it is recommended not to change it)
  $confDontImportCustomerFromGroupId - flag - do not import users from this group (groups.id)
  $confIsUseDhcpData                      - load DHCP data from the dhs_sessions_log table (0 - do not load, 2 - dhs_sessons_log)
  $confImportCustomerOnlyFromGroupId - import users ONLY from this group (groups.id)
  $confDhcpServiceLinkId                 - service link ID from "dhs_sessions_log.Acct_Status_Type" (default: 3)
  $confImportCustomerExpr - condition for importing users. It allows importing only a part of users from billing (executed before WHERE)
  $confIsHostByteOrder                   - flag - host byte order in dhs_sessions_log.Framed_IP_Address (Relevant for UTM5 versions >=5.3 update 3. Don't switch it on if you don't know what it's about)  
  $confImportCustomerExpr2 - condition for importing users. Allows importing only a part of users from the billing (executed after WHERE)
  $confIsActiveAllDhcp                   - flag - use current date for active dhs_sessions_log entries
  $confTrafficRxClass - class of incoming traffic  
  $confIsDhcpLeasesLogUse                 - load DHCP data from dhcp_leases_log table (0 - do not load, 1 - load).
  $confTrafficTxClass - class of outgoing traffic (several comma separated)
  $confIsBlockType1IsPause               - flag - consider block_info.block_type #1 as PAUSE
  $confUseIpMethod - operation variant (it is recommended not to change it)
  $confIsBlockType2IsStop                 - flag - consider block_info.block_type #2 as STOP
  $confIsUsUseDhcpData - load DHCP data from the dhs_sessions_log table (0 - do not load, 2 - dhs_sessons_log)
  $confIsUseIdToAgreement                 - use customer ID as contract number
  $confDhcpServiceLinkId - service link ID from "dhs_sessions_log.Acct_Status_Type" (default: 3)
  $confIsSavePasswordToComment           - flag - save customer's password from billing in the "additional data" field
  $confIsHostByteOrder - flag - host byte order in dhs_sessions_log.Framed_IP_Address (Relevant for UTM5 versions >=5.3 update 3. Don't switch it on if you don't know what it's about)  
  $confIsImportPaidHistory               - flag - import data on customer payments (payment_transactions)
  $confIsActiveAllDhcp - flag - use current date for active dhs_sessions_log entries
  $confVersionFramedIp                   - import type dhs_sessions_log.Framed_IP_Address [0|1]
  $confIsDhcpLeasesLogUse - load DHCP data from dhcp_leases_log table (0 - do not load, 1 - load).
  $confIsImportHistoryTariff             - flag - import history of tariff changes by customer
  $confIsBlockType1IsPause - flag - consider block_info.block_type #1 as PAUSE
  $confCustomerAccountSrc                 - source of customer account number [accounts.external_id|accounts.id|users.basic_account]
  $confIsBlockType2IsStop - flag - consider block_info.block_type #2 as STOP
  $confImportCustomerUnlimited           - import "accounts.unlimited" field into UserSide ''(need to specify additional field id)''' additional data
  $confIsUseIdToAgreement - use user ID as contract number
  $confImportCustomerPassport             - import passport data into additional data UserSide ''(need to specify additional field id)''
  $confIsSavePasswordToComment - flag - save user's password from billing in the "additional data" field
  $confIsDontUpdateDateConnect           - flag - do not import customer's date of connection
  $confIsImportPaidHistory - flag - import data on user payments (payment_transactions)
  $confIsImportAdditionalServices         - flag - import additional services
  $confVersionFramedIp - import type dhs_sessions_log.Framed_IP_Address [0|1]
  $confIsImportSwitchCommutation         - flag - import customer's switching to equipment (routers_info table of billing)
  $confIsImportHistoryTariff - flag - import history of tariff changes by user
  $confIsImportSwitchTableCommutation     - flag - import customer switching to equipment (billing switches table)
  $confCustomerAccountSrc - source of user account number [accounts.external_id|accounts.id|users.basic_account]
  $confImportPaidLimit                   - limit on the number of imports at one time of customer payments (default: 5000)
  $confImportCustomerUnlimited - import "accounts.unlimited" field into UserSide ''(need to specify additional field id)''' additional data
  $confIsImportLessPhone                 - flag - whether to import empty phone numbers of customers (this allows to erase in UserSide the numbers that are no longer in billing)
  $confImportCustomerPassport - import passport data into additional data UserSide ''(need to specify additional field id)''
  $confIsSaveVpnPasswordToComment         - flag - save vpn password in customer's comments
  $confIsDontUpdateDateConnect - flag - do not import user's date of connection
  $confAddressSrc                         - source of customer's address (0 - users.house_id, 1 - users.actual_address)
  $confIsImportAdditionalServices - flag - import additional services
  $confExprIpImport                       - condition for importing IP addresses
  $confIsImportSwitchCommutation - flag - import user's switching to equipment (routers_info table of billing)
  $lastPaidIdPlus                         - initial counter for importing payments
  $confIsImportSwitchTableCommutation - flag - import user switching to equipment (billing switches table)
  $confIsSkipCustomerBuilding             - flag - do not import building number for customers
  $confImportPaidLimit - limit on the number of imports at one time of user payments (default: 5000)
  $confImportPaidDisableMethod           - list of ignored payment methods in import
  $confIsImportLessPhone - flag - whether to import empty phone numbers of users (this allows to erase in UserSide the numbers that are no longer in billing)
  $confIsSkipDhsSessionsLogTraffic       - flag - ignore traffic data from dhs_sessions_log table
  $confIsSaveVpnPasswordToComment - flag - save vpn password in user's comments
  $confIsImportServiceWithAddressAsAliasCustomer - flag - import service with address as child record of customer
  $confAddressSrc - source of user's address (0 - users.house_id, 1 - users.actual_address)
  $confIsIgnoreHouseBlock                 - flag - ignore house block
  $confExprIpImport - condition for importing IP addresses
  $lastPaidIdPlus - initial counter for importing payments
  $confIsSkipCustomerBuilding - flag - do not import building number for users
  $confImportPaidDisableMethod - list of ignored payment methods in import
  $confIsSkipDhsSessionsLogTraffic - flag - ignore traffic data from dhs_sessions_log table
  $confIsImportServiceWithAddressAsAliasCustomer - flag - import service with address as child record of user
  $confIsIgnoreHouseBlock - flag - ignore house block
  $confAdditionalFieldWithAgreementNumber - optional billing field with contract number
  $confAdditionalFieldWithAgreementNumber - optional billing field with contract number
  $confAdditionalFieldWithAgreementDate - additional billing field with contract date
  $confAdditionalFieldWithAgreementDate   - additional billing field with contract date
  $confImportCustomerAllowedCid - import "User Allowed Cid" into additional data of UserSide ''(need to specify id of additional field)''
  $confImportCustomerAllowedCid           - import "User Allowed Cid" into additional data of UserSide ''(need to specify id of additional field)''
  $confImportCustomerPassword - import subscriber's password into additional data of UserSide ''(need to specify additional field id)''
  $confImportCustomerPassword             - import subscriber's password into additional data of UserSide ''(need to specify additional field id)''
  $confAccountPattern - template when importing user account number ''(e.g.: 02000000)''
  $confAccountPattern                     - template when importing customer account number ''(e.g.: 02000000)''
  $confImportGateway - import user's gateway into UserSide additional data ''(need to specify id of additional field)''
  $confImportGateway                     - import customer's gateway into UserSide additional data ''(need to specify id of additional field)''
  $confImportMask - import user's mask into UserSide ''(need to specify additional field id)''
  $confImportMask                         - import customer's mask into UserSide ''(need to specify additional field id)''
  $confIsRegionAddressSystem - flag - import regions/regions from billing address system ''(only when $confAddressSrc = 0)''
  $confIsRegionAddressSystem             - flag - import regions/regions from billing address system ''(only when $confAddressSrc = 0)''
  $confIsImportServiceLinksAsChild - flag - import service links as child records of users''(only for UTM+)''
  $confIsImportServiceLinksAsChild       - flag - import service links as child records of customers''(only for UTM+)''
  $confIsImportWorkPhoneToPhone - flag - import work phone as "normal" phone
  $confIsImportWorkPhoneToPhone           - flag - import work phone as "normal" phone
  $confImportCustomerUnlimited - import unlimited fact into UserSide ''(need to specify id of additional field)''
  $confImportCustomerUnlimited           - import unlimited fact into UserSide ''(need to specify id of additional field)''
  $confImportCustomerVlanId - import VlanID into additional data UserSide ''(need to specify additional field id)''
  $confImportCustomerVlanId               - import VlanID into additional data UserSide ''(need to specify additional field id)''
 
$confImportCustomerTaxNumber            - import tax number into additional data UserSide ''(need to specify additional field id)'''
  $confAddressRemoveStr1 - string #1 to replace in the text address
  $confAddressRemoveStr2 - string #2 to replace in text address
  $confAddressRemoveStr1             - string #1 to replace in the text address
  $confAddressRemoveStr3 - string #3 to replace in text address
  $confAddressRemoveStr2             - string #2 to replace in text address
 
  $confAddressRemoveStr3             - string #3 to replace in text address
  // If it is necessary to import an internal IP address for a user when importing an external IP address - fill in the following parameters
  $confIpGrayNet - which IP address subnet to consider as external - e.g.: "172.16.0.0" or "0" - do not process it  
  // If it is necessary to import an internal IP address for a customer when importing an external IP address - fill in the following parameters
  $confIpWhiteNet - which IP address subnet to add - e.g. "10.0.0.0.0" or "0" - do not add it
  $confIpGrayNet                     - which IP address subnet to consider as external - e.g.: "172.16.0.0" or "0" - do not process it  
 
  $confIpWhiteNet                     - which IP address subnet to add - e.g. "10.0.0.0.0" or "0" - do not add it
  // You can configure additional marks on the user depending on the value of the additional field in billing
  $markMerge[6]['id'] = 1; - [utm5.uaddparams_desc.paramid]['id'] = userside.id
  // You can configure additional marks on the customer depending on the value of the additional field in billing
  $markMerge[6]['value'] = 'test_string'; - [utm5.uaddparams_desc.paramid]['value'] = Compare String
  $markMerge[6]['id']     = 1; - [utm5.uaddparams_desc.paramid]['id'] = userside.id
 
  $markMerge[6]['value'] = 'test_string'; - [utm5.uaddparams_desc.paramid]['value'] = Compare String
  // It is possible to configure import of additional fields from billing to additional fields of ERP "UserSide" user (if necessary)
  // It is possible to configure import of additional fields from billing to additional fields of ERP "UserSide" user (if necessary)
  // The $additionalDataMerge array ''(for userside 3.13 and earlier)'' or $additionalCustomerDataMerge array ''(for userside 3.14 and later)'' is filled in. You can add your own fields. If the field code value is null - import is not performed
  // The $additionalDataMerge array ''(for userside 3.13 and earlier)'' or $additionalCustomerDataMerge array ''(for userside 3.14 and later)'' is filled in. You can add your own fields. If the field code value is null - import is not performed
  // Import is performed into already created additional fields. I.e. beforehand - this additional field must be created in UserSide for the user card
  // Import is performed into already created additional fields. I.e. beforehand - this additional field must be created in UserSide for the customer card
  $additionalCustomerDataMerge[1] = 1; - [utm5.uaddparams_desc.paramid] = userside.id
  $additionalCustomerDataMerge[1] = 1; - [utm5.uaddparams_desc.paramid] = userside.id
  $additionalCustomerDataMerge[2] = 2; - [utm5.uaddparams_desc.paramid] = userside.id
  $additionalCustomerDataMerge[2] = 2; - [utm5.uaddparams_desc.paramid] = userside.id

Текущая версия от 07:55, 1 апреля 2024

en | ru

This function is one of the possibilities
to update the activity date of an object

usm_utm5 - module to organise import of data from UTM5 billing system into ERP UserSide

This module is a replacement for the deprecated us_utm5 module - See: Switching from us utm5 to usm utm5

Module Language: PHP

Current version: See: Modules

Module Status: Paid

For more information and a list of imported data, see the page: UTM5

Information on installing the module

Make sure that the php_mysqli library is present on the system where the module will be running

The usm_utm5.zip archive contains the files

usm_utm5.php
usm_utm5.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. Rename the sample configuration file usm_utm5.conf.php-example to usm_utm5.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_utm5.php

It should work without error and return the data:

usm_utm5
====================================
 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_utm5.php

Configuration parameters

The module is configured in the usm_utm5.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           - The 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       - customer name for access to the billing database
$billingDBPassword   - password for access to the billing database
$billingDBName       - billing database name
$billingCodePage     - billing database encoding
$billingDbProvider   - DBMS type [mysql|postgresql] (default: mysql)
$confServiceData                        - use service mappings instead of tariff mappings (0 - service mappings, 1 - tariff mappings, 2 - both)
$confIsHideShablonsFromTariffList       - flag - do not include templates in tariff imports
$confServiceDataServiceTypeRestrict     - import tariffs (and customers) with such service_data.service_type
$confRentId                             - ID of the field with customer fee for the tariff (services_data.service_type in billing)
$confDontImportTariffWithComment        - do NOT import tariffs with this comment
$confMultiplicationTariffFees           - multiplication factor for subscription fees in tariffs (1.20 - 20% VAT, etc.)

$confIsUseDateConnect                   - use customers.connect_date field to get the date of connection to the network (0 - users.create_date, 1 - users.connect_date).
$confIsCustomerConnectFix               - flag - add information about customers' connection to switches to additional data
$confIsImportBankInformation            - flag - import customer's bank details into the "Additional data" field
$confDontImportCustomerFromGroupId      - flag - do not import customers from this group (groups.id)
$confImportCustomerOnlyFromGroupId      - import customers ONLY from this group (groups.id)
$confImportCustomerExpr                 - condition for importing customers. It allows importing only a part of customers from billing (executed before WHERE)
$confImportCustomerExpr2                - condition for importing customers. Allows importing only a part of customers from the billing (executed after WHERE)
$confTrafficRxClass                     - class of incoming traffic 
$confTrafficTxClass                     - class of outgoing traffic (several comma separated)
$confUseIpMethod                        - operation variant (it is recommended not to change it)
$confIsUseDhcpData                      - load DHCP data from the dhs_sessions_log table (0 - do not load, 2 - dhs_sessons_log)
$confDhcpServiceLinkId                  - service link ID from "dhs_sessions_log.Acct_Status_Type" (default: 3)
$confIsHostByteOrder                    - flag - host byte order in dhs_sessions_log.Framed_IP_Address (Relevant for UTM5 versions >=5.3 update 3. Don't switch it on if you don't know what it's about) 
$confIsActiveAllDhcp                    - flag - use current date for active dhs_sessions_log entries
$confIsDhcpLeasesLogUse                 - load DHCP data from dhcp_leases_log table (0 - do not load, 1 - load).
$confIsBlockType1IsPause                - flag - consider block_info.block_type #1 as PAUSE
$confIsBlockType2IsStop                 - flag - consider block_info.block_type #2 as STOP
$confIsUseIdToAgreement                 - use customer ID as contract number
$confIsSavePasswordToComment            - flag - save customer's password from billing in the "additional data" field
$confIsImportPaidHistory                - flag - import data on customer payments (payment_transactions)
$confVersionFramedIp                    - import type dhs_sessions_log.Framed_IP_Address [0|1]
$confIsImportHistoryTariff              - flag - import history of tariff changes by customer
$confCustomerAccountSrc                 - source of customer account number [accounts.external_id|accounts.id|users.basic_account]
$confImportCustomerUnlimited            - import "accounts.unlimited" field into UserSide (need to specify additional field id)' additional data
$confImportCustomerPassport             - import passport data into additional data UserSide (need to specify additional field id)
$confIsDontUpdateDateConnect            - flag - do not import customer's date of connection
$confIsImportAdditionalServices         - flag - import additional services
$confIsImportSwitchCommutation          - flag - import customer's switching to equipment (routers_info table of billing)
$confIsImportSwitchTableCommutation     - flag - import customer switching to equipment (billing switches table)
$confImportPaidLimit                    - limit on the number of imports at one time of customer payments (default: 5000)
$confIsImportLessPhone                  - flag - whether to import empty phone numbers of customers (this allows to erase in UserSide the numbers that are no longer in billing)
$confIsSaveVpnPasswordToComment         - flag - save vpn password in customer's comments
$confAddressSrc                         - source of customer's address (0 - users.house_id, 1 - users.actual_address)
$confExprIpImport                       - condition for importing IP addresses
$lastPaidIdPlus                         - initial counter for importing payments
$confIsSkipCustomerBuilding             - flag - do not import building number for customers
$confImportPaidDisableMethod            - list of ignored payment methods in import
$confIsSkipDhsSessionsLogTraffic        - flag - ignore traffic data from dhs_sessions_log table
$confIsImportServiceWithAddressAsAliasCustomer - flag - import service with address as child record of customer
$confIsIgnoreHouseBlock                 - flag - ignore house block
$confAdditionalFieldWithAgreementNumber - optional billing field with contract number
$confAdditionalFieldWithAgreementDate   - additional billing field with contract date
$confImportCustomerAllowedCid           - import "User Allowed Cid" into additional data of UserSide (need to specify id of additional field)
$confImportCustomerPassword             - import subscriber's password into additional data of UserSide (need to specify additional field id)
$confAccountPattern                     - template when importing customer account number (e.g.: 02000000)
$confImportGateway                      - import customer's gateway into UserSide additional data (need to specify id of additional field)
$confImportMask                         - import customer's mask into UserSide (need to specify additional field id)
$confIsRegionAddressSystem              - flag - import regions/regions from billing address system (only when $confAddressSrc = 0)
$confIsImportServiceLinksAsChild        - flag - import service links as child records of customers(only for UTM+)
$confIsImportWorkPhoneToPhone           - flag - import work phone as "normal" phone
$confImportCustomerUnlimited            - import unlimited fact into UserSide (need to specify id of additional field)
$confImportCustomerVlanId               - import VlanID into additional data UserSide (need to specify additional field id)
$confImportCustomerTaxNumber            - import tax number into additional data UserSide (need to specify additional field id)'

$confAddressRemoveStr1              - string #1 to replace in the text address
$confAddressRemoveStr2              - string #2 to replace in text address
$confAddressRemoveStr3              - string #3 to replace in text address

// If it is necessary to import an internal IP address for a customer when importing an external IP address - fill in the following parameters
$confIpGrayNet                      - which IP address subnet to consider as external - e.g.: "172.16.0.0" or "0" - do not process it 
$confIpWhiteNet                     - which IP address subnet to add - e.g. "10.0.0.0.0" or "0" - do not add it

// You can configure additional marks on the customer depending on the value of the additional field in billing
$markMerge[6]['id']     = 1; - [utm5.uaddparams_desc.paramid]['id'] = userside.id
$markMerge[6]['value']  = 'test_string'; - [utm5.uaddparams_desc.paramid]['value'] = Compare String

// It is possible to configure import of additional fields from billing to additional fields of ERP "UserSide" user (if necessary)
// The $additionalDataMerge array (for userside 3.13 and earlier) or $additionalCustomerDataMerge array (for userside 3.14 and later) is filled in. You can add your own fields. If the field code value is null - import is not performed
// Import is performed into already created additional fields. I.e. beforehand - this additional field must be created in UserSide for the customer card
$additionalCustomerDataMerge[1] = 1; - [utm5.uaddparams_desc.paramid] = userside.id
$additionalCustomerDataMerge[2] = 2; - [utm5.uaddparams_desc.paramid] = userside.id