Sessionless Signup Form for FusionPBX with FreeSWITCH

1.0.1

  • Password regular expression fix. FusionPBX 4.4 and 4.5 have different default password requirements; we put a password rule that satisfies both;
  • Email fix, TLS/SSL support. If you had issues getting email notifications when a new user signed up, this should be fixed now.
  • Billing for FusionPBX 1.3.0+ compatibility, and
  • Automatic tax assignation based on the geo IP. If configured, all new users may have taxes applied if the country is configured. You may configure more than one tax per country.

1.0.0

  • Initial version

This manual will guide you on every detail about how to install and use the Sessionless Signup Form for FusionPBX native application.  If you want to have a quick setup, you may read the quick guide and later return here.

Content

  1. Sessionless Signup Form for FusionPBX installation
  2. Sessionless Signup Form for FusionPBX configuration
  3. Maintenance Tasks

Sessionless Signup Form for FusionPBX Installation

Before you start Billing for FusionPBX installation, you must satisfy the next requirements:

  • You need to have FusionPBX 4.4 or better installed with MySQL, MariaDB or PostgreSQL as database data storage.  If you don't know how to do this, OKay offers Linux consultant services.
  • Database access must be granted from your webservers. By default, only local access is allowed.
  • You need to have the PHPShadow extension installed. If you already have the Billing or LCR for FusionPBX working, you already have this.
  • Your FusionPBX needs key authentication enabled. By default, it is off. Read this blog post to know how to turn it on.
  • Have these FusionPBX patches applied (if not yet accepted): #5673 for FusionPBX 4.4, #5674 for FusionPBX 4.5.
  • Install or configure in your webpage a way to allow to do < ?php require_once('signup.php'); ? > statements and let them work.

When you satisfy these requisites, please follow the next steps:

  1. In your FusionPBX deployment, edit your superadmin user and create a key. Take note of that key, you will need it.
  2. Unzip the signup-crypted-X.Y.Z.tar.bz2 file inside a published directory.
  3. Rename the signup-config.php-txt file to signup-config.php.
  4. Edit the page where you are going to publish the form and add the tag < ?php require_once('signup/signup.php'); ? >, change the path to fit your webpage scenario. Take note of the URL of that page, you will need it.
  5. Edit the file signup-config.php with your parameters. The file is commented on, if you need more help read the section below.
  6. Edit the file signup-language.php if you want to change or add support to a language.
  7. Edit the file signup.php if you want to change the form aspect. Be careful, the file has some PHP tags you will need to keep functional.

Sessionless Signup Form for FusionPBX Configuration

Inside the session-config.php there are all the configuration settings you need to change. Here is the explanation:

  • ['db']['type'] = 'mysql'; // Take the same value from your FusionPBX config.php, possible values are: mysql, pgsql
  • ['TYPE']['server'] = '192.168.7.25'; // Your DB server IP
  • ['TYPE']['port'] = '3306'; // Your DB port, 3306 for MySQL/MariaDB, 5432 for PgSQL
  • ['TYPE']['database'] = 'fusionpbx'; // The FusionDB database
  • ['TYPE']['user'] = 'fusionpbx'; // Database user
  • ['TYPE']['password'] = 'xxxxxx'; // Database password
  • ['debug'] = true; // Turn to true/false to show/hide debug messages in the syslog
  • ['fusionpbx']['base'] = 'http://pbx'; // Your FusionPBX URL
  • ['fusionpbx']['auth'] = '/app/xml_cdr/xml_cdr.php'; // An application that works with key authentication, keep this value if you do not know what to put
  • ['fusionpbx']['domain'] = '/core/domain_settings/domain_edit.php';
  • ['fusionpbx']['switch_domain'] = '/core/domain_settings/domains.php';
  • ['fusionpbx']['user'] = '/core/users/user_edit.php';
  • ['fusionpbx']['extension'] = '/app/extensions/extension_edit.php';
  • ['fusionpbx']['api_key'] = 'ef6e786e-9a3a-4f6e-8648-012f5569c6a2'; // API key from a superadmin user
  • ['fusionpbx']['group_uuid']='c0462ec9-c906-4b20-96ad-b10b93f4178f'; // Default group UUID, you get this UUID from your FusionPBX group manager
  • ['fusionpbx']['group_name']='trunks'; // Default group name, the UUID and the group name must match
  • ['fusionpbx']['extension_naming'] = 'subdomain'; // subdomain, number, alias, random; subdomain: extension will be the name of your company (alphanumeric); number: the extension will be the specified in the default_extension parameter. Do not use this value if you have create_subdomains = false; alias: the extension will be the name of your company (alphanumeric), the field alias will have the default_extension value; random: the extension will be a random number. Do not use this if you are using create_subdomains = false
  • ['fusionpbx']['default_extension']='1000'; // if using extension_naming = number, the first extension will always be this value.
  • ['fusionpbx']['use_alias']=false; // if true, and the extension number is not numeric, the alias will keep the numeric number
  • ['fusionpbx']['email_as_login']=true; // If your FusionPBX has unique logins, turn this on
  • ['fusionpbx']['create_subdomains']=false; // Turn this on if you want to create a subdomain per customer, otherwise, all new customers will be created within the default domain. Be careful with this value if default_extension = number or random.
  • ['fusionpbx']['ip_auth'] = true; // Turn this on if you want customers to set up IP authentication.
  • ['domain_base'] = 'trunks.okay.network'; // Your base domain in your FusionPBX. If create_subdomains = true, all subdomains will be under this domain.
  • ['done_page'] = '//to-connect.me/index.php?option=com_content&Itemid=224&id=13&lang=en&view=article'; // The page to forward after signup. This page should point where the require_once form the installation step is.
  • ['default_language'] = 'en'; // The default language, edit the file signup-language.php to add more languages. English and Spanish are supported by default.
  • ['languages'] = array ('x-default', 'en', 'ar', 'bg', 'hr', 'zh-CN', 'zh-TW', 'cs', 'da', 'et', 'tl', 'fi', 'fr', 'gl', 'el', 'iw', 'hi', 'es', 'nl', 'id', 'ja', 'ca', 'ko', 'lt', 'lv', 'mt', 'de', 'no', 'pt', 'ru', 'ro', 'sr', 'sk', 'sl', 'sv', 'th', 'tr', 'uk', 'hu', 'vi', 'it', 'pl', 'sq');
  • ['fixed_currency'] = true; // If true, it will use the currency setting from fixed_currency_iso, otherwise the form will allow you to select. The preselection will be done using your source IP.
  • ['fixed_currency_iso'] = 'USD'; // 3-letters currency, USD, CAD, EUR, MXN and so on.
  • ['extension']['set_password'] = true; // If true, the created extension will have the same initial password from the form. Otherwise, FusionPBX will set a random one, you will need to review it manually.
  • ['extension']['range'] = 1; // The following values are extension settings. Keep it 1 always if you are not creating numeric extensions.
  • ['extension']['directory_visible'] = 'false';
  • ['extension']['directory_exten_visible'] = 'false';
  • ['extension']['limit_max'] = 5;
  • ['extension']['limit_destination'] = '';
  • ['extension']['voicemail_enabled'] = 'false';
  • ['extension']['voicemail_file'] = 'attach';
  • ['extension']['voicemail_local_after_email'] = 'false';
  • ['extension']['call_timeout'] = 30;
  • ['extension']['user_record'] = '';
  • ['extension']['hold_music'] = 'local_stream://default';
  • ['extension']['enabled'] = 'true';
  • ['extension']['voicemail_password'] = '';
  • ['extension']['toll_allow'] = 'allow-all'; ['extension']['call_group'] = '';
  • ['extension']['auth_acl'] = ''; ['extension']['limit_max'] = 10;
  • ['extension']['cidr'] = ''; ['extension']['sip_force_contact'] = '';
  • ['extension']['sip_force_expires'] = '';
  • ['extension']['mwi_account'] = '';
  • ['extension']['sip_bypass_media'] = 'bypass-media';
  • ['extension']['dial_string'] = '';
  • ['extension']['description'] = 'Created by Signup';
  • ['select_plans'] = false; // If true, a select combo will allow you to show this.
  • ['plans'][999]['name'] = 'Snorbird Special'; // If select_plans is true, it will display a select box. The value selected won't do anything when signing up, it just will show that in the email or final page.
  • ['plans'][999]['default'] = false;
  • ['plans'][999]['label'] = 'Snorbird Special';
  • ['billing']['do'] = true; // If you have the Billing for FusionPBX, you can use this
  • ['billing']['version'] = 13000; // version 1.3.0, for 1.2.3 use 120030
  • ['billing']['parent_billing_uuid'] = null; // Parent UUID for all the new customers, usually this is null.
  • ['billing']['from_uuid'] = 'xxxxxxxxxxxxxxxxx'; // Contact UUID of the business in your FusionPBX
  • ['billing']['type'] = 'authcode'; // authcode or domain
  • ['billing']['credit_type'] = 'prepaid'; // prepaid or postpaid
  • ['billing']['credit'] = 0; // postpaid credit must be negative, a positive value means they must have a certain balance in favor
  • ['billing']['force_postpaid_full_payment'] = true;
  • ['billing']['lcr_profile'] = 'default'; // pricing list
  • ['billing']['max_rate'] = '999';
  • ['billing']['referred_depth'] = 2;
  • ['billing']['referred_percentage'] = 10;
  • ['billing']['do_referral'] = false; // display a list of current customers to make a referral // Warning: this will disclose your customer base // Show dropdown with options
  • ['actions']['do'] = false; // More options, similar to plans
  • ['actions']['option'][999]['key'] = 'port_my_existing_number';
  • ['actions']['option'][999]['value'] = 'Port';
  • ['smtp']['do'] = true; // SMTP settings
  • ['smtp']['host'] = 'localhost';
  • ['smtp']['from'] = 'signup@to-connect.me';
  • ['smtp']['forge_from'] = true;
  • ['smtp']['to'] = 'admin@to-connect.me';
  • ['smtp']['from_name'] = 'To Connect Me Website';
  • ['smtp']['subject'] = 'To Connect Me SignUp';
  • ['smtp']['path'] = '/usr/share/php/PHPMailer/'; // Go to https://www.google.com/recaptch to obtain your keys
  • ['google']['do_captcha'] = true; // true if you want to use captcha, keys are obtained here https://www.google.com/recaptcha/about/
  • ['google']['private'] = 'XXXXXXXXXXXXXXXXXXXXXX-bUoi'; // your private key
  • ['google']['public'] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // site key

Maintenance Tasks.

None

About OKay

An IT Company whose mission is generating value with low cost of ownership.

We will offer you Linux based solutions that satisfy your needs. We focus on VoIP & Linux, but we are up for any other challenge you may want to bring.