ASTPP paths and conf files

By Yevgeniya Suminova on 2021-04-07

Contents

Application/config. 1

Application/modules. 1

Account_import. 1

Account_import/config. 1

Problem with email field when import customers. 1

Where it is in the code?. 1

Other issues that maybe could be resolved. 1

END.. 1

 

 

Application/config

 

1.       There are following directories inside :

addons        config.php     cron.php      doctypes.php       hooks.php   migration.php  profiler.php  smileys.php

autoload.php  constants.php  database.php  foreign_chars.php  index.html  mimes.php      routes.php    user_agents.php

 

2.       Found that different paths are set and described in the following file:

/opt/ASTPP/web_interface/astpp/application/config/config.php

 

For example it shows where the template for invoices is stored:

 

3.       In the following file we have arrays:

It might be interesting for us for SIP-device created by customer problem:

/opt/ASTPP/web_interface/astpp/application/config/constants.php

$CUSTOMEREDIT_ARRAY=array (

                "Customer Profile" => "accounts/customer_edit/",

                "SIP Devices" => "accounts/customer_sipdevices/",

                "IP Settings" => "accounts/customer_ipmap/",

                "Caller IDs" => "accounts/customer_animap/",

                "Force Caller ID" => "accounts/customer_add_callerid/",

                "DIDs" => "accounts/customer_dids/",

                "Products" => "accounts/customer_product/",

                "Speed Dial" => "accounts/customer_speeddial/",

                "Blocked Codes" => "accounts/customer_blocked_prefixes/",

                "Alert Threshold" => "accounts/customer_alert_threshold/",

                "Invoices" => "accounts/customer_invoices/",

                "Refill Report" => "accounts/customer_refillreport/",

                "Charges History" => "accounts/customer_charges/",

                "CDRs"=>"accounts/customer_cdrs/",

                "Emails" => "accounts/customer_emailhistory/",

 

 

$CUSTOMERPROFILE_ARRAY=array (

                "My Profile" => "user/user_myprofile/",

                "SIP Devices" => "user/user_sipdevices/",

                "IP Settings"=>"user/user_ipmap/",

                "Speed Dial"=>"user/user_speeddial/",

                "Alert Threshold"=>"user/user_alert_threshold/",

                "Change Password"=>"user/user_change_password/"

 

I tried to remove the “SIP devices” line in the $CUSTOMERPROFILE_ARRAY=array ( but it did not bring any result. I have placed it back as it was before.

 

Application/modules

The following directory could be interesting for us:

/opt/ASTPP/web_interface/astpp/application/modules/accounts

 

It contains following files:

view_accounting_taxes_add.php      view_ani_map.php                    view_customer_cdrs_list.php      view_customer_ipmap.php             view_customer_speed_dial.php

view_accounts_add_callerid.php     view_block_prefix_list.php          view_customer_charges.php        view_customer_opensips_devices.php  view_provider_details.php

view_accounts_create.php           view_bulk_account_creation.php      view_customer_details.php        view_customer_orders_assign.php     view_reseller_details.php

view_accounts_list.php             view_customer_alert_threshold.php   view_customer_dids.php           view_customer_products.php

view_accounts_process_payment.php  view_customer_animap.php            view_customer_email_history.php  view_customer_refill_report.php

view_admin_details.php             view_customer_blocked_prefixes.php  view_customer_invoices.php       view_customer_sipdevices.php

 

Account_import

Probably this directory will be very interesting for us:

/opt/ASTPP/web_interface/astpp/application/modules/account_import

 

Here is the content of the account_import.php file:

Account_import/config

nano /opt/ASTPP/web_interface/astpp/application/modules/account_import/config/account_import.php

<?php defined('BASEPATH') OR exit('No direct script access allowed');

 

$config ['Customers-field'] = array (   'Generate Pin' => 'pin',

        'Allow Local Calls' => 'local_call',

        'Allow Recording' => 'is_recording',

        'Billing Schedule' => 'sweep_id',

        'Allow IP Management' => 'allow_ip_management',

        'Billing Day' => 'invoice_day',

        'Rate Group' => 'pricelist_id',

        "Create Sip Device"=>"sipdevice_flag",

        'LC Charge / Min' => 'charge_per_min',

        "Currency"=>"currency_id",

        'Account Type' => "posttoexternal",

        "Country"=>"country_id",

        "Timezone"=>"timezone_id",

        "Currency"=>"currency_id",

        "Email Alerts"=>"notify_flag",

        "Tax" =>"tax_id"

);

$config ['Customers-mapper-fields'] = array ( "general_info" => array(

        'Account'=>"number",

        'Password' => 'password',

        'First Name' => 'first_name',

        'Last Name' => 'last_name',

        "Company"=>"company",

        "Phone"=>"telephone_1",

        "Mobile"=>"telephone_2",

        "Email"=> "email",

        "Address"=> "address_1",

        "City"=>"city",

        "Province/State"=>"province",

        "Zip/Postal Code"=>"postal_code"

),

"settings"=>array(

        "Balance"=>"balance",

        "Credit Limit"=>"credit_limit",

        'Concurrent Calls' => 'maxchannels',

        'CPS' => "cps",

        "SIP Username"=>"sip_username",

        "SIP Password"=>"sip_password"

)

);

 

 

nano /opt/ASTPP/web_interface/astpp/application/modules/account_import/controllers/account_import.php

For example this part is maybe responsible for “Invoices date” and the impossibility to set any date we want:

  if ($invalid_flag) {

            $data['invoice_date'] = gmdate("d") > 28 ? gmdate("28") : gmdate("d");

            $data['error'] = $error;

 

 

Problem with email field when import customers

 

When importing customers emails are corrupted. System takes the field that you choose (in our case email field) and does the following: field@field.com

If I enter my email as genia@test.ch the result is: genia@test.ch@genia@test.ch.com

 

Where it is in the code?

 

Looks like, here is the problematic part of the code that mess customers’ emails when we are importing accounts:

nano /opt/ASTPP/web_interface/astpp/application/modules/account_import/controllers/account_import.php

if (! empty($add_array["email-select"]) && $csv_data[$add_array["email-select"]] && ! isset($email[$csv_data[$add_array["email-select"]]])) {

                    $this->db->select('id');

                    $email_result = (array) $this->db->get_where('accounts', array(

                        'email' => $csv_data[$add_array["email-select"]],

                        "deleted" => 0

                    ))->first_row();

                    if (empty($email_result)) {

                        $new_array['email'] = $csv_data[$add_array["email-select"]] . '@' . $csv_data[$add_array["email-select"]] . '.com';

                        $email[$csv_data[$add_array["email-select"]]] = $new_array['email'];

                    } else {

                        $invalid_flag = TRUE;

                    }

 

Full file can be downloaded here: account_import.php

 

Other issues that maybe could be resolved

-          Balance

-          Invoice date

-          Translation rule

END

***

© 4z.com