Archives August 2023

Contact Center Build-Outs

Custom built dialer

Contact Center Build-Outs

Why choose us for your Contact Center Build-Out?

We are the only vendor on the planet that has everything under one roof for a complete Contact Center Build-Out.

Providing customer service is basic, however, it is a top priority that directly affects a company’s bottom line. With Dialer One, you have control of inbound/outbound customer campaigns without contracts or excuses from a service provider. Wouldn’t it be nice to own your own contact center system? Imagine not having to rely on another businesses downtime or wait time for support. We specialize in building your business a contact center system that not only dials your customers, but also had the ability to email, chat directly with potential clients from your website or other platforms, send and receive text messages, video conferencing, as well as full integrations with your CRM of choice such as Zoho, SalesForce, vTiger, SuiteCRM or any other CRM software of your choice. So what are you waiting for, give us a call now and let’s talk about how we can help you triple your results at the very least with our Contact Center Build-Outs!

Voip phone system
Voip phone system

What Is Included in your Contact Center Build-Out?

Full System Automation

  • AI numbers which takes your DID you place the call from, changes the caller ID to a local area code presence and attestation level A shaken token and then sends the call, if the caller calls back, it’s handled by their backend to automatically map the call back to your original DID.
  • Full 2-Way seamless integrations with High Level, SalesForce, Zoho and more.
  • Artificial Intelligence driven answering machine detection giving your agents more humans and less answering machines, saving wasted time and money
  • Blended outbound & inbound campaigns
  • All Leads Go To All your Agents

Agent Performance Monitoring

  • Full Visibility as to what all your agents are doing
  • Provide full reports for all your clients
  • Full Quality ControlControlControlControloutboundControlControlControlControloutbound Implementation
  • Full Quality Control and Coaching implemented: We’ve examined countless call centers and almost everyone is missing the mark!

Agent Performance / Time Management

  • Able to monitor what agents are doing at a granular level
  • Individual agent monitoring / DID disposition
  • Monitor agents individually for conversion rates.
  • Full Learning Management System for easy onboarding of new agents

Who Should Use Dialer One’s Services?

  • Solar Companies
  • Marketing Agencies
  • Health Insurance Companies
  • Real Estate Companies
  • Travel Agencies and Vacation clubs

Any company that wants to focus on revenue-generating activities and also be in complete control of their business. We are ready to get you going TODAY!

Hey, my name is Chris aka carpenox. I am one of the most well known vicidial contributers on the planet, just ask around. The blog on our website gets over 250 hits a day from around the globe and I also contribute on the ViciDial forums. I know this dialer system inside and out and have made many custom features for clients as needed as well as a nicer user and admin interface. I now have put together a team of talented individuals to which we build custom dialer solutions with full CRM integrations and API capabilities as needed through your requests. So what are you waiting for? Let us start building your future!

Fill out the form below to get started or join our live support channel .

Special Offer for the first 10 applicants : Basic dialer build that YOU own for $250(50% off)

Why choose The Dialer One? Here’s what sets us apart:

You own this system, you don’t rent it so there’s no monthly charges. Reduce you’re business overhead by 65%, without those expensive per user monthly dialer fees. Effective and efficient USA based customer support. Unbeatable pricing – With this one time discount of 50% off, you can’t beat it for something you’ll own once built. Fully customizable platform, with full API capabilities, features to add or remove with thousands of options, plus the design itself can all be changed. Can be fully integrated with most CRM systems such as Zoho, SugarCRM, TigerCRM, GoHighLevel or whatever CRM you are using. Guaranteed one POC – You’ll be assigned your own support rep to handle your entire build process. Remote installation, your support tech will install your system with all your changes directly onto YOUR server, not ours within 24 hours of your purchase.

Experience seamless communication from your state-of-the-art VoIP phone system custom built to meet your business needs. As a special offer, we’re providing a basic dialer build to the next 10 applicants! Don’t miss out on this opportunity to discover the possibilities and reduce your monthly communication costs but as much as 75%!

Just to clarify, your dialer system can do everything the big companies like RingCentral, Dialpad, Convoso and the others can do and much much more with the ability to add both basic and API features, as and when needed. Not only that but we can also integrate your CRM with automated processes that add the information for you as soon as your sales call is done. Not only that, but we can also add other communication options such as SMS, Video chat, WhatsApp, Facebook and more. How is that possible? It’s YOUR system, you OWN it, you don’t rent it with those expensive monthly or yearly charges. So what are you waiting for, let’s get your dialer system up and running today!

If you want to get right into a more advanced build with API triggers and design changes or added features, we will give you a free quote today.

For a free quote on a more customized system click here

If you’re ready to buy our $250 special, clock the button below:

How to – Upgrade your Vicidial Database from 2.2 all the way up to 2.14 & all versions in between

SVN Update

How to – Upgrade your Vicidial Database from 2.2 all the way up to 2.14 & all versions in between

This article is going to go over how to upgrade your ViciDIal database as far back as 1.1.12-3 all the way up to the current 2.14 and every step in between. No matter what version of Astguiclient you have, this post will show you how to step yourself up, one upgrade at a time until you get to the version you want to be at. It will also show you what was added to each GUI version starting from day one.

########## UPGRADE

NOTE: Upgrading from 2.11 to 2.13 is below the first section
NOTE: Upgrading from 2.9 to 2.11 is below the first section
NOTE: Upgrading from 2.7 to 2.9 is below the first section
NOTE: Upgrading from 2.4 to 2.7 is below the first section
NOTE: Upgrading from 2.2.1 to 2.4 is below the first section
NOTE: Upgrading from 2.0.5 to 2.2.0 is below the second section
NOTE: Upgrading from 2.0.4 to 2.0.5 is below the third section
NOTE: Upgrading from 2.0.3 to 2.0.4 is below the fourth section
NOTE: Upgrading from 2.0.2 to 2.0.3 is below the fifth section
NOTE: Upgrading from 2.0.1 to 2.0.2 is in the next section
NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom

#### UPGRADING FROM 2.13 TO 2.14

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. Check system_settings, make sure you are at DB Schema Version 1478 or higher
    If not, run the instructions for 2.11 to 2.13 before this section.
  2. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.14.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.14.sql
  3. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  5. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Added script for in-group call data exports
  2. Added cm_sc_areacode.agi script that allows you to use a Settings Container
    with the script in a Call Menu to define different destinations for
    customers from each state to go to: DID, CALLMENU, EXTEN
  3. Added Agent DID Report
  4. Added the ability for internal chats to have more than one agent participant
  5. Added cm_phonesearch.agi script that can search for a phone number within the
    system and redirect a call to an in-group that is defined as the Default
    Transfer Group in a campaign that the lead belongs to. This must be
    configured in a Call Menu
  6. Added In-Group option to populate new leads with a DID descriptive value in
    the province field of the new lead.
  7. Added cm_sc_send_url.agi script for Call Menus on calls tied to a lead_id to
    send a URL defined in a Settings Container.
  8. Added phone_number_log Non-Agent API export function
  9. Added api_only_user User option to prevent access to admin and agent screens
    by an API-only user account.
  10. Added logging of API request URLs
  11. Added campaign setting for Dead Call to Dispo Only, to allow the Dead Call
    Max Seconds setting to send the agent to the dispo screen
  12. Added web lead loader duplicate check options to check for leads loaded only
    within the last 90-days. Also added to Non-Agent API add_lead function.
  13. Added Agent API function switch_lead to switch the active call lead_id while
    the agent is on a live inbound phone call.
  14. Added In-group areacode_filter feature, allowing you to drop calls after a
    set number of seconds in queue that either match or do not match a list
    of areacodes defined per in-group.
  15. Added new DNC options to Manual Dial Filter campaign feature that are not
    tied to the campaign DNC settings.
  16. Changed Emergency Logout processes to hangup all agent session calls, and
    added better logging
  17. Changed Custom Fields of SCRIPT type to allow URLs and urlencoded variables
    when using –U– and –V– to declare variables
  18. Added option for custom list fields to be required for all calls or only
    inbound calls. Will prevent agent hanging up call if field is not filled
    in. Must also have campaign option enabled for it to work. Will work for
    the following custom field types:
  19. Added admin Automated Reports section, allowing easier web configuration of
    scheduled reports being sent by Email or FTP.
  20. Added campaign option to validate transfer agent list based upon which
    AGENTDIRECT in-groups those agents had selected.
  21. Added In-Group option to look up the state based upon the areacode of the
    caller ID phone number of the person calling in.
  22. Added CHAT option to Inbound Queue No Dial campaign setting to prevent
    outbound auto-dialing if a chat is waiting for an agent
  23. Added qualify option to phones for IAX type phones
  24. Added Pause Code Time Limits to allow you to set a time limit on the number
    of seconds an agent can be in a specific pause code before the real-time
    report will show them in a different color.
  25. Added Drop Lists feature, allowing you to add new leads to a list built from
    DROPped calls from inbound groups on a scheduled basis.
  26. Added USER_CUSTOM_ options to campaign custom callerID setting to allow for
    custom caller IDs to be used per agent in MANUAL and INBOUND_MAN modes
  27. Added IP Lists feature, allowing creating of lists of IP Addresses that can
    be used as whitelists on a User Group basis for Agent, Admin and API
    web resources.
  28. Added campaign option(with user override) Ready Max Seconds Logout to log an
    agent out of the agent screen if they have been in a ready state for
    more than X seconds.
  29. Added cm_fpg.agi script to allow callers to place their phone numbers into a
    Filter Phone Group. Works from a Call Menu.
  30. Added Inbound and Advanced Forecasting Reports. Both use the Erlang formulas
    and past data to forecast agent and call metrics.
  31. Added campaign option for Callbacks Display Days which can limit the
    scheduled callbacks displayed to an agent by a number of days from now
  32. Added campaign options to stop recording when a 3-way call is started and
    start recording when the hangup xfer line button is clicked
  33. Added start call URL feature support for manual dial calls
  34. Added logging of Real-Time report monitoring, and report in Admin Utilities
  35. Added Agent Push Events, allowing for HTTP Push events to be sent on agent
    screen events. See the AGENT_EVENTS.txt doc for more details.
  36. Added Add-to-hopper options to update_lead function in the Non-Agent API
  37. Added basic one-way Cross-Cluster-Communication feature. Allowing for lead
    information to pass from one VICIdial system to another with a call.
    See the CROSS_CLUSTER_COMMUNICATION.txt document for more information.
  38. Added Real-Time agent status of “DIAL” for agent manual dial calls after
    they have been placed but before they have been answered.
  39. Changed password fields to allow up to 100 character passwords. Also changed
    password recommendations to emphasize length over complexity.
  40. Added logging and notification of 3-way call hung up in agent screen.
  41. Added URL logging of Agent Screen Webform button clicks and URLs
  42. Added script to send out emails if there are agents
    waiting more than X seconds.
  43. Added In-Group option to ask callers if they would take a survey after
    agent has handled their call. Overrides agent HANGUP CUSTOMER button
    to send call to survey instead.
  44. Added system setting to allow Lead Management admin utilities to handle
    active lists. Also changed Advanced Lead Management tool to allow
    you to select multiple lists.
  45. Added Inbound DID Summary Report
  46. Added Agent Inbound Status Summary Report
  47. Added experimental support for Asterisk 13. See the ASTERISK_13.txt doc
    for notes on changes needed to get it to work.
  48. Added System Settings option to set lists to inactive once they pass their
    expiration date
  49. NEW REQUIREMENT!!! Perl CPAN Net::Telnet version 3.0.4(April 21, 2013)
    If you are using an older Net::Telnet version, you will need to upgrade!
    this should take just two commands: “cpan” and “install Net::Telnet”
  50. Added DID System-wide filter option to System Settings
  51. Added DNC.COM inbound number filtering with DNCcom_inbound_filter.php
  52. Added cm_cid_change.agi script to alter the CID of calls in the Call Menu
    Prompt. Also, added ability for cm_dnc.agi to recognize Vicidial-tagged
    calls and update lead records without lookups from a phone number
  53. Added Webphone Layout option in Phones and override in User Groups
  54. Added campaigns-scheduled_callbacks_email_alert option to send email alerts
    to agents when scheduled callbacks are triggered while they are logged
    in to the agent screen. Read the HELP for instructions to set up.
  55. Added new Real-Time Whiteboard multi-report
  56. Added the ability to include duplicate custom text fields in a custom fields
    form in the agent screen.
  57. Added Max Inbound Calls Outcome to allow for different behaviors when an
    agent reaches their maximum inbound calls for the day
  58. Added campaign option to allow agents to pause the Manual Dial Auto Next
  59. Added ability to display inbound email messages in Script tab scripts.
  60. Added dispo_change_status.php script to allow changing of a lead’s status
    to a different status after it has been dispositioned as a specified
    status a set number of times.
  61. Added Agent Screen Time Report campaign option, to display agent time
    statistics in the agent screen for the current day.
  62. Added List Override setting for Default Transfer Group
  63. Added lead_status_search Non-Agent API function
  64. Added “Next-Dial My Callbacks” campaign setting that will automatically dial
    USERONLY Scheduled Callbacks for agents in MANUAL or INBOUND_MAN
    no-hopper campaigns when they click DIAL NEXT NUMBER in the agent screen
  65. Added “Anyone Callback Inactive Lists” System Setting option to determine
    how ANYONE scheduled callbacks from inactive lists should be handled.
  66. Added “Inbound No-Agents No-Dial” Campaign setting, checks if any agents are
    ready and waiting for phone calls from listed In-Groups before allowing
    outbound auto-dialing.
  67. Added new PRESS_CALLBACK_QUEUE option to Hold Time and Wait Time In-Group
    settings, allowing for a customer to retain their place in line in the
    queue and be called back when their turn is reached.
  68. Added new Closed Time features to In-Groups that allow all calls in queue
    to be presented with an option when the in-group closing time for the
    day has been reached. Also, an option was added to manually force the
    end of all queueing of calls for an in-group for the day.
  69. Added dial_ingroup option to Agent API external_dial function.
  70. Added In-Group option to look up timezone of customer when a new lead is
    added during the routing of the call.
  71. Added the Outbound Lead Source Report
  72. Added basic GDPR features for lead activity download and delete. Must enable
    System setting and user permission to use.
  73. Added CID Groups, allowing for groups of caller IDs to be defined by state
    or areacode, and allowing a single CID Group to be set across multiple
  74. Added NO_READY option for no_agent_no_queue in-group feature.
  75. Added campaign option “Script on top of Dispo” to allow the agent screen
    script tab to cover the dispo screen after hanging up the customer to
    allow for Agent-API-enabled IFRAMEs to control the agent dispo process.
  76. Added feature to allow for bulk change of campaign and in-group ranks and
    grades in the User Modify page.
  77. Added “Admin Lead Source ID Display” System Settings option to allow Modify
    Lead page modification of Source ID field, and display in hopper list.
  78. Added LOCALFQDN trigger for webforms and script Iframes to allow for use of
    absolute URLs on multi-home networks. See CALL_URL_FEATURES.txt doc.
  79. Added update_did Non-Agent API function
  80. Added pause code manager approval option, requires a manager to approve a
    specific flagged pause code before the agent is allowed to use it in
    their agent screen. Manager approves by entering their login credentials
    into a window on the agent’s screen.
  81. Added DISPO_FILTER Settings Container option allowing for match-and-replace
    function in Dispo Call URLs. See CALL_URL_FEATURES.txt doc for details.
  82. Added populate_lead_vendor and populate_lead_source options for In-Groups.
  83. Added In-Group option to override the Park Music-on-Hold.
  84. Added SWITCH custom field type to put buttons on the agent FORM to allow for
    the form to be switched while on an active call.
  85. Rewrote HELP display in web admin screens to function as database-driven
    javascript popup.
  86. Added per-user options for maximum number of outbound manual dial hopper
    calls per-hour and per-day.
  87. Added In-Group option for Waiting Call On/Off URL, which we added to allow
    a client to control a web-power-switch to turn lights on and off if
    there are any calls waiting in an In-Group.
  88. Added In-Group option for Enter In-Group URL, which can send a URL request
    when a caller enters an In-Group right before the system looks for an
    agent to send the call to.
  89. Added Manual Dial Routing Initiated Recording, must enable setting at the
    campaign level and have a 0 recording delay.
  90. Added campaign features for Dead Call Trigger. Allowing an audio alert to be
    sent to an agent and/or a back-end URL to be submitted when an agent has
    been in a dead call for X number of seconds.
  91. Added the ability for customers to be able to enter a new phone number to be
    called back on for the CallerID CallBack Queue feature.
  92. Added the new Callmenu Survey Report(linked as “Callmenu Agent” in Reports).
  93. Added “Agent Screen Logout Link Credentials” System Setting to change the
    agent screen logout page login link to not include user credentials.
  94. Added new campaign feature to force agents to call back their triggered
    USERONLY Scheduled Callbacks.
  95. Added new campaign feature to automatically reschedule ANYONE callbacks when
    they are dispositioned as a non-Human-Answered status flag status.
  96. Added new campaign feature to allow agents to select a specific timezone to
    use when scheduling callbacks. For this to work, the Phone Codes must be
    updated on your system using the following command:
    /usr/share/astguiclient/ –purge-table –debug
  97. Added new ‘force_fronter_leave_3way’ Agent API function, allowing an API
    command to be sent to the fronter of a call to leave-3way their call.
  98. Added List Daily Reset Limit option, only editable by level 9 users.
  99. Added 3-Way Volume Buttons campaign setting to allow disabling of volume
    and mute buttons in the LIVE CALLS IN YOUR SESSION panel during a 3-way
  100. Added campaign setting to filter ANYONE Scheduled Callbacks by the DNC
    settings set in the campaign
  101. Added _wait_time options to Next Agent Call settings for Campaigns and
    Inbound Groups.
  102. Added External Web Socket URL option so a WebRTC phone can be used outside
    a network if the Phone is set to Use External Server IP = Y
  103. Added SYSTEM options to the campaign detail Manual Dial Filter feature
  104. Added lead_callback_info Non-Agent API function, it outputs scheduled
    callback data for a specific lead
  105. Added Manual Dial Validation campaign and system settings, forces agent to
    manually enter in the phone number before a call is placed. Does not
    affect 3way calls or transfers.
  106. Added alphabet letters translation to phone DTMF digits feature in Agent
    Screen. For example, Putting “SMITH” in the SendDTMF field would result
    in “76484” being sent over DTMF.
  107. Added “force_fronter_audio_stop” Agent API function, allowing an API
    command to be sent to the fronter session of a closer call to stop
    playing of an audio_playback pre-recorded audio stream
  108. Added options to define the static prompts to use for the Inbound Group
    “Play Place in Line” feature
  109. Added new web pages for mobile application
  110. Added feature allowing agents to mute recordings of calls from the agent
    screen. Must be enabled in System Settings to be able to use it in
    campaigns. There is also a User Override option.
  111. Added more options to the Campaign “Hide Call Log Info” feature to be able
    to show only the last X number of calls in the Lead Info screen. Also
    added a User Override setting for this feature.
  112. Released VICIdial Manager Manual version 2.14-704a:
  113. Added more logging for Asterisk AMD as well as beta AMD patch for logging
    of NOAUDIODATA answered calls and more AMD stats gathering. Also added
    an AMD Log Report to the Admin Utilities page.
  114. Added Admin User Redirect URL settings, which allows you to define a web
    address that a user is to be sent to when they log in to the admin web
    screen. This is usually used for level 7 report only users to send them
    to one specific report when they log in without seeing the admin web
    screen at all. Must be enabled in System Settings.
  115. Added experimental SIP event logging. Requires patched Asteirsk 13 and
    newer version of MySQL/MariaDB. Must be enabled in System Settings and
    each dialer’s astguiclient.conf/extensions.conf/manager.conf files
    Read SIP_EVENT_LOGGING.txt doc for more details
  116. Added new Non-Agent API function ‘update_cid_group_entry’ which allows you
    to add/update/delete/info CID Group entries and AC-CID entries
  117. Added new Non-Agent API ‘custom_fields_copy’ option to the ‘add_list’
  118. Added new Call Quota Lead Ranking recycling feature-set. A new and
    completely different way to do lead recycling for outbound campaigns.
    See the CALL_QUOTA_LEAD_RANKING.txt document for more info
  119. Added bench_agent_assign.php script to allow managers to move
    ‘owner-assigned’ to another agent.
  120. Added User Inbound Max Calls filtering options. Allowing selective counting
    of inbound calls excluding calls involving set in-groups, statuses and
    with a minimum time threshold. Also, new in-group routing options based
    on last non-filtered call times
  121. Added System Settings option for second agent screen script tab
  122. Added a Campaign option for VoiceMail Message Groups, allowing agents to be
    able to select a message to transfer a customer answering machine to
    from a list of pre-recorded messages that can be defined by time-of-day.
  123. Added a Campaign option to not send an agent immediately to the disposition
    screen after transferring a customer call to a VoiceMail Message.
  124. Added Campaign option for Dial Timeout Lead overrides, allowing you to set
    up a Settings Container with values for manual-dial and/or auto-dial
    lead fields and associated values that will tie to different
    Dial Timeouts.
  125. Added LTMGAD and XAMMAD Campaign Hotkey options that will transfer to the
    Leave-Voicemail option as well as dispositioning the call.
  126. Added a per-User option to define an additional Status Group of call
    statuses that agents can use to disposition all calls they handle.
  127. Added System Setting to hide the first web form button on the agent screen.
  128. Added System Setting options for alternate agent screen recording buttons.
    This includes different wording, different sizes and removing the blank
    space below the recording buttons.
  129. Added ability to play multiple audio prompts for outbound survey campaigns
    and to use DYN for lead field wildcards defined as audio prompts.
  130. Added ability to limit the number of voicemail messages played to a single
    lead per day, as a campaign setting.
  131. Added CID Group Type of NONE to allow for a group of outbound CIDs to be
    used for all outbound phone calls no matter where they are.
  132. Added Auto-Rotating CID Group numbers, allowing for timed automatic cycling
    of CID numbers, one-at-a-time, within a CID Group.
  133. Added optional OpenSIPs CallerID Name settings, for use only with systems
    that use an OpenSIPs server to route outbound calls where this feature
    has been enabled.
  134. Added system settings option to require passwords of a set minimum length.
    This setting affects User passwords, Phone and Server registration
    passwords and the System Settings default passwords.
  135. Added support for KHOMP Answering Machine Detection. This is a 3rd-party
    commercial(paid-for) solution. The code and documentation can be found
    in the “extras/KHOMP” directory of the codebase.
  136. Added AMD Agent Route Options as a campaign option allowing you to set
    the specific AMD responses for calls that should be routed to agents
  137. Added the “list_custom_fields” Non-Agent API function, to show all list
    custom data fields in a list/all-lists.
  138. Added an optional “send this user a login link email” link to the User
    Modify page to send a shortcut URL link for the agent to more easily
    log into the agent screen. Must be enabled in System Settings.
  139. Added new System Settings option to allow sending of any CallerID through
    the Agent API for external_dial outbound calls.
  140. Added system setting to allow you to restrict Admin Phones display to a
    set number of records per page.
  141. Added options at the campaign and in-group levels to allow you to play
    alert sounds when a call arrives in the agent’s session, in the agents’
    web browser that they are logged into the agent screen with. Must be
    enabled in system settings.
  142. Added “3-Way Recording Stop Exception” campaign option to override the
    “3-Way Recording Stop” setting based upon the 3way phone number dialed.
  143. Added the ability to use Automated Reports with standard SFTP and FTPSSL
    remote servers.
  144. Added the ability to configure when the Answer signal is sent to inbound
    calls at the DID, In-Group and Call Menu level. For this to work, you
    must set the conf files to be rebuilt after upgrading your systems.
  145. Added options for HTML formatting and UTF-8 charset in emails through the
    dispo_send_email.php script.
  146. Added tools for International DNC phone number scrubbing. See the
    INTERNATIONAL_DNC_SCRUB.txt doc for more information.
  147. Added option ‘2’ to the User Modify “Modify Leads” setting allowing admin
    users to modify all lead fields except for phone number and alt phone.
  148. Added campaigns_list & hopper_list functions to the Non-Agent API
  149. Added code and instructions for multi-campaign outbound agents, see the
  150. Added Screen Colors option to set the submit button color on the admin
    screens and reports.
  151. Added the ability to modify the status of any call or agent log in the
    Admin Modify Lead page. Must use new ‘Modify Leads’ options to enable
    for a user.
  152. Added system settings allowing you to remove digits from the beginning of
    a phone number when it is manual dialed or through the web lead loader.
  153. Added Pause Max Exceptions campaign setting, allowing for exceptions to the
    Agent Pause Max feature for specified Pause Codes.
  154. Added optional display of parked call stats and SLA 1&2 percentages to the
    Real-Time Report
  155. Added Campaign setting for Hopper Drop-Run triggering. Forcing the one-time
    hopper insertion of DROP status leads instead of standard hopper loading
  156. Added Agent API function ‘vm_message’ allowing you to set the VM message to
    be played to a customer when the agent clicks on the VM button in the
    agent screen.
  157. Added Daily Called Count Limits as a campaign setting, with options to
    count and/or restrict for manual dial calls or not.
  158. Added Transfer-Conf Button Launch campaign setting, allowing you to set a
    webform window to open when an agent clicks on the Transfer-Conf button.
  159. Added SHARED_… campaign dial method auto-dial options, for more efficient
    agent multi-campaign dialing. Read the AGENT_MULTI-CAMPAIGN_DIALING.txt
    document for more information.
  160. Added Agent Search Method override options for campaigns and in-groups.
  161. Added ‘copy_user’ function to the Non-Agent API.
  162. Added ‘add_did’ function to the Non-Agent API.
  163. Added new SOURCESELECT Custom Field Type, it is a single-selection pull-
    down menu where there are multiple sets of options available depending
    on the value of another field for the lead. Also added the ability to
    perform basic Math functions within a SCRIPT Custom Field using values
    from other fields in the equations. For more information on how both of
    these new features work, see the Field Options help in the admin web
  164. Added Phone Defaults system setting, allowing you to set many default
    values when adding new phones through admin.php. Also added a Copy New
    Phone admin web function.
  165. Redesign of QC module, with new QC scorecards, the ability to do QC by
    Campaign/List/In-Group, new reporting and more. See the
    docs/QC_PROCCES.txt document for more information.
  166. Added the BUTTON Field Type option to Custom List Fields. Allows you to add
    a button to the form that will commit any changes made in the form and
    automatically reload the form.
  167. Added Two-Factor Authentication(2FA) as an option for the admin web screens
    This adds a required second step to the admin web screen login process
    through a method other than a password, such as: an Email, Phone Call or
    Text-Message(SMS). This 2FA auth also lasts only a set amount of time
    (defined in System Settings[number of hours, from 1-9999 hours]), or
    until the user logs out. For more information, read the
  168. Added a page to allow Editing existing Lead Loader Templates.
  169. Added System Settings for “Agent Hidden Browser Sound” to repeatedly play
    a selected sound at a set interval to an agent when their Agent Screen
    is hidden from view. Can be used to disable web browser javascript
    throttling if set to an audible sound at a 20 second interval. Tested
    with the ‘click_quiet’ sound file at a volume of ’25’.
  170. Added WAV audio file validation for Audio Store, and display of badly
    formatted WAV files in the audio chooser in admin.php
  171. Added “Leave 3-Way Start Recording” campaign feature that will start a new
    recording after the agent clicks on the LEAVE 3WAY button and leaves the
    call. Also includes an “Exception” option to disable/enable only for
    specific 3-way call numbers.
  172. Added “Populate Lead Comments” In-Group option, allowing configuration of
    how the ‘comments’ lead field is filled-in when a new lead is inserted
    because of an inbound phone call.
  173. Added options to add/update/delete custom fields within the ‘update_list’
    function of the Non-Agent API.
  174. Added Settings Compare Utility page to Admin Utilities to allow you to
    compare the settings from two records in your system and see what
    settings are different between the two.
  175. Added campaign options to add extra lead-field columns to the “Calls In
    Queue” panel in the agent screen.
  176. Added Calls In Queue Count Display campaign options, allowing for two
    separate Calls Waiting counters at the top of the agent screen, each
    with separate configurable labels and in-group/campaign parameters.
    Also, this can be used with the alt_display.php script.
  177. Added new “Music on Hold Suggest” Phones setting for SIP and IAX phones.
    It will define the Hold music played to a customer when the phone user
    puts them on hold through the phone.
  178. Added compatibility with TILTX STIR/SHAKEN Call Shaper pre-carrier call
    filtering service. Read the TILTX_SHAKEN_API.txt doc for more info.
  179. Added In-Group Drop Seconds Override Container, allowing for overriding of
    the Drop Seconds setting based upon the day of the week and time of day.
  180. Added Inbound Manual Dial Agent Forced Ready features allowing for forcing
    agents in INBOUND_MAN dial method campaigns to be in the READY state
    (able to take inbound calls) for a set amount of time before they are
    able to click on the DIAL NEXT NUMBER button each time. Also allows for
    an override setting based upon the day of the week and time of day.
  181. Added CORS(Cross-Origin Resource Sharing) support for the VICIdial agent
    PHP scripts and select admin PHP scripts. see the CORS_SUPPORT.txt doc
    for more information.
  182. Added Transfer No Dispo campaign setting, allowing for transferred calls
    to not immediately show the disposition panel on the agent screen.
  183. Added User override setting for campaign Manual Dial Filter option.
  184. Added display of active Call Time Holidays in the agent screen Scheduled
    Callbacks calendar panel.
  185. SECURITY NOTE: For agent screen Webform buttons, we have changed the
    default behavior to not include user credentials in non-custom URL
    strings unless you set the new agc/options.php settings to do so:
    “$user_pass_webform and “$phone_login_webform”
    See the “agc/options-example.php” file for more information.
    *This will not affect custom webform query strings that start with “VAR”
  186. Added display of the Phone Codes and Postal Codes that are loaded into the
    system. Linked from the System Settings page.
  187. Added 24-Hour Called Count Limit campaign feature, allows you to limit the
    number of calls to be placed to a phone number or lead in a 24-hour time
    period. Also allows for state-based override settings. For more
    information, read the CALL_COUNT_LIMITS.txt doc.
  188. Added CID Group Failover setting for campaigns, to allow for backup CID
    Group to use if no AREACODE or STATE match found from first CID Group.
  189. Added agc/dispo_list_quota.php script to deactivate lists once a limit of
    the number of leads matching set statuses is reached. See the comments
    in the code for more details.
  190. Changed agc/dispo_send_email.php to only allow attachments in the new
    “agc/attachments” web directory.
  191. Added Asterisk 16 “PJSIP” compatibility
  192. Added ‘batch_update_lead’ Non-Agent API function
  193. Added ‘Agent In-Call Tally Seconds Threshold’ campaign setting, to better
    handle dialing volume on campaigns with long agent talk time.
  194. Added ‘In-Queue No Agents Check’ in-group setting, to allow for checking of
    logged-in or available agents for the in-group while calls are in-queue,
    and if there are no agents available, sending the customers to the
    No-Agent-No-Queue Action. With configurable pause code exceptions.
  195. Added MIN LENGTH to the Dispo Call URL ALT admin screen, allowing for a
    minimum call time threshold before a Dispo Call URL will trigger.
  196. Added User Location to the Modify User page. Also added Queue Groups Admin
    pages, allowing you to define multiple campaigns and/or in-groups in a
    single Queue Group to be used in some reports.
  197. Added Campaign and List options for “Auto Alt-Number Dialing Threshold”
    allowing you to stop auto-dialing alternate phone numbers for a lead
    after a set number of call attempts, and thereafter only dialing the
    main phone number for the lead.
  198. Added ‘update_alt_url’ Non-Agent API function
  199. Added “Pause Max URL” Campaign feature
  200. Added “Allow Web DB Debug” System Settings feature, to allow use of the $DB
    variable on the web screens for troubleshooting issues.
    It is disabled by default.
  201. Added List CID Group Override to the List Modification admin screen.
  202. Added “Pre-Filter Recent Call” DID feature, to be able to filter out
    inbound calls based on the caller phone number and whether it had been
    called(or had called in) within the last X number of days.
  203. Added the “Inbound DID Detail Report” to the Admin Utilities page.
  204. Added Beta support for ConfBridge Asterisk Conferencing engine. See the
    “/extras/ConfBridge” directory for more information.
  205. Added Beta support for VERM(the VICIdial Enhanced Reporting Module),
    accessible from the “Reports -> Admin Utilities” page.
  206. Added User Group “Script Override” option, with per-campaign activation.
  207. Added “Webphone Settings” option to Phones, allows for more WebRTC config
    options to be set through a Settings Container.
  208. Added “Agent Call Hangup Route” campaign settings, allowing you to send
    calls that an agent is finished with to a Call Menu, In-Group or a
    pre-recorded message before hanging up the call. NOTE: After upgrading your system, be sure to set each dialer to "Rebuild conf files" = 'Y' for this feature to work properly.
  209. Added instructions and scripts for creating a Gateway Recording server
    See the GATEWAY_RECORDING_SERVER.txt doc for more info.
  210. Added the ability to have multiple “No Agent Call URL” entries for a
    single Campaign/In-Group/List, by putting “ALT” in the No Agent Call URL
    field on the Campaign, In-Group, List modify screen. Just like how it
    works with Dispo Call URL currently.
  211. Added new User Group <93>Script Tab Frame Location<94> allowing the script tab
    to extend to the far left side of the screen.
  212. Added new campaign setting <93>Max Logged-In Agents<94>, allowing you to set a
    maximum number of agents that can be logged into this campaign at any
  213. Added list option for <93>Dial Prefix Override<94>.
  214. Added a <93>color chooser<94> for the In-Group Color and Screen Colors fields.
    Also added color hex code validation to those fields.
  215. Added <93>Invalid Phone Number Replacement<94> option to the Web Lead Loader,
    allowing you to replace an invalid phone_number lead value with either
    the alt_phone or address3 value in the same lead.
  216. Added optional <93>Agent Login Kick-all<94> system setting which hangs up any
    channels that were already in the agent session before the agent is
    placed into the session.
  217. Added <93>User Codes Admin Pulldown<94> allowing only User Level 9 users to
    modify the User Code field on the User Modify page, and it will change
    the User Code field to a pulldown menu.
  218. Added “Show Confetti” campaign setting, allowing for confetti to be shown
    to agents when they disposition a call as a SALE and/or a CALLBACK
    flagged status.
  219. Added “Abandon Check Queue” feature, to catch dropped Call Menu calls that
    are tagged with a Lead ID. For more information, see the bottom of the
    INBOUND_CALLBACK_QUEUE.txt document.
  220. Added “Asterisk Restart URL” to the Modify Servers page, this can send a
    URL request any time Asterisk is auto-restarted on that server.
  221. Added Agent API “send_notification” function, allowing you to send
    notifications to agents by User, User Group or Campaign.
  222. Added “AMD Agent Route Options” flag to allow immediately hangup and dispo
    of calls with no audio data. This is a campaign feature.
  223. Added agent screen latency logging, viewable in the Real-Time Report and
    the new Agent Latency Report and Latency Gaps Report.
  224. Added Demographic Quotas, allowing for setting of quota goals for leads
    based upon lead field values for demographic parameters like: gender,
    age-group, political-party, etc… For more information on this set of
    features, read the DEMOGRAPHIC_QUOTAS.txt document.
  225. Added Inbound Calls Credits, allowing per-User setting of a number of
    inbound calls that can be handled, until reset by a manager.
  226. Added List Weekday Resets, allowing for automatic list resets scheduled by
    day-of-the-week on a per-list basis.
  227. Added Second and Third Agent Alert Trigger In-Group settings, allowing for
    a second and/or third audio alert to be played to the agent on repeat
  228. Added VIDPROMPTSPECIAL Call Menu Handle Methods when sending calls to
    In-Groups. Allows for list-based In-Group routing based on settings in
    a Settings Container. Also allows for separate routing of not-found
  229. Added Dead Call Stop Recording campaign feature.
  230. Manual VM Message Status Updates campaign option.
  231. Added Per Call Notes Required campaign option.

#### UPGRADING FROM 2.11 TO 2.13

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. Check system_settings, make sure you are at DB Schema Version 1403 or higher
    If not, run the instructions for 2.9 to 2.11 before this section.
  2. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.12.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.12.sql
  3. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  5. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Added System Settings to allow custom prompts on agent login and when an
    agent leaves a 3way call in the agent screen. Must Have Asterisk 1.8+
    for it to work.
  2. Added ability to use single-quotes in vicidial_list fields. Through the
    agent screen and all lead import methods
  3. Added option to populate the entry_list_id from the DID when routing to an
  4. Added agent screen webform 3 feature
  5. Added user API restrictions for allowed lists and allowed API functions
  6. Added web administration for chat features
  7. Added new campaign settings for Manual Dial Search and Manual Dial Filter to
    allow for Alt phone and Address3 phone numbers to be allowed
  8. Added campaign option to disable the Manual Dial Override field
  9. Added option to change the background color for agent scripts
  10. Added option to hide the In-Group ID in the agent screen for inbound calls
  11. Added option to not populate the In-Group Name in the security_phrase field
    (the “Show” field) of the vicidial_list table on new inbound leads.
  12. Added list_description as a webform and script variable
  13. Added campaign option to allow you to set the number of seconds after a
    customer hangs up before the warning shows on the agent screen
  14. Added ability to use No Agent Call URL with the dispo_move_list.php script
    see script comments for instructions.
  15. Added DID options to check for a Maximum number of calls in queue in a set
    In-Group and route the call to an extension if over the set number.
  16. Added the ability to define multiple Dispo Call URLs as well as define
    specific statuses that they will be triggered for.
  17. Added compatibility in the Vicidial code for Asterisk 11.
  18. Added database and logfile logging of DTMF events. Works with Asterisk
    versions 1.8 and higher. If upgrading, you will need to add “dtmf” to
    the listencron user in manager.conf and reload asterisk.
  19. Added agent screen debug logging, which will log almost all mouse clicks
    and AJAX calls on the agent screen. Can be enabled for all agents or
    only one agent. Also added report to display logs by date/time. These
    agent debug logs are deleted after 7 days.
  20. Added agc/dispo_add_FPG.php script to be able to insert a phone number into
    an inbound Filter Phone Group when set to a certain specific disposition
    using the Dispo Call URL.
  21. Added campaign option to display some lead fields as read-only in the agent
    screen. Those fields are: entry_date,source_id,date_of_birth,rank,owner
  22. Added option in the web-based lead loader to convert state names to their
    two-letter abbreviations.
  23. Added option to Secondary Lead Sort by vendor lead code
  24. Added option to User Stats report to only show call logs with a specified
    call status.
  25. Added experimental Agent Whisper Monitoring from the Real-time Report.
    Must be enabled in System Settings.
  26. Added the ability in in-groups to set reset a lead’s called status when a
    call is ended by being abandoned, dropped, hung up or sent to voicemail
  27. Added Admin -> Settings Containers to admin web interface to allow more easy
    configuration of back end scripts and Dispo Email sending
  28. Added agc/dispo_send_email.php script to be used with the Dispo Call URL
    option in campaigns and in-groups. See DISPO_SEND_EMAIL.txt doc for
    more information on this feature.
  29. Added code to support proprietary encryption framework for custom fields.
  30. Added new User Group options for Allowed Reports to control the Report Page
    Servers Summary and the Admin Utilities Page
  31. Added optional GPG audio recording encryption.
  32. Added option to use RECID as a recording filename variable.
    NOTE: Cannot be used as the ONLY variable for recording filename
  33. Added functionality to adjust the input field lengths in the agent screen
    and the admin modify lead pages to follow the database schema field
    lengths for the default lead fields.
  34. Added DID custom fields as webform and script variables
    (did_custom_one, did_custom_two,…, did_custom_five)
  35. Added option to hide users from appearing on real-time report. Must be
    enabled in System Settings, then for each user to be hidden.
  36. Added did_carrier_description, sorting by columns in DID list page, integer
    sort for user list page.
  37. Added logging of DNC list insertion and deletion to vicidial_dnc_log table
  38. Added script to allow filtering of existing DNC entries
  39. Changed AC-CID to be able to use areacodes from 2 to 5 digits in length
  40. Added admin web interface to allow for easy linking and display of custom
    reports that are not included in Vicidial
  41. Added Status Groups and the ability to override Campaign Statuses on a
    per-In-Group or per-List basis
  42. Added Minimum and Maximum Seconds options for all status settings. This
    allows you to prevent the use of a status by an agent if they have
    talked to a customer less than X seconds or more than Y seconds.
  43. Added the system setting USA-Canada Phone Number Dialcode Fix which will
    trigger a process that will run at the Timeclock End of Day that will
    check all phone numbers to populate the dial code, or phone code, field
    with a 1 if it is missing as well as remove a leading 1 from the phone
    number field if it is present.
  44. Added –lstn-buffer option to keepalive script to run special enhanced
    buffer version of the Listen process. Requires newer Net::Telnet perl
    module version.
  45. Added Answering Machine Message Wildcards features for campaigns. Allows for
    calls sent to a message to play a different message depending on whether
    a wildcard text string is present in a selected lead data field.
  46. Added Cached Realtime Carrier Stats option to System Settings to have the
    Carrier Log Stats generated once per minute system-wide instead of every
    time the realtime report refreshes on every screen.
  47. Added option to several reports to search the archived logs.
  48. Added script which allows for direct batch filtering of
    lists within vicidial with the DNC.COM dnc filtering service. For more
    info, see the DNC-dot-COM_integration.txt document.
  49. Added phone options to have call go to dialplan extension instead of
    voicemail if phone not answered.
  50. Added option in NVA agi script to search for a lead by phone number, log the
    lead_id of the phone call and send a per-phone URL at the start of the
    phone call.
  51. Added Chat Messaging to agent screen, with manager chat utlitity. For more
    information, read the CHAT_MESSAGING.txt doc.
  52. Added example code for a CRM Iframe agent screen skin(extras/crm_iframe)
    See the CRM_EXAMPLE_SKIN.txt doc for more information
  53. Added utility to gather and display Asterisk debug information. Includes
    a server setting and Admin Utilities report.
  54. Added campaign setting for manual_dial_timeout for manual dial agent screen
    calls only.
  55. Added Agent Allowed Chat Groups to User Groups to allow restriction of only
    agent to agent chatting by itself.
  56. Added options in In-Groups and Campaigns to allow for the agent recordings
    to be initiated by the routing process instead of at the agent screen.
    This only works for inbound and auto-dial outbound calls for in-groups
    and campaigns that are set to ALLCALLS or ALLFORCE recording.
  57. Added option to Inbound DID Group Filtering to filter by areacode.
  58. Added in-group option for On-Hook CID Number.
  59. Added available_agents and status_link button options as well as validation
    of active in-group to the chat_customer screen.
  60. Added campaign setting Manual Dial Hopper Check that will check for a lead
    in the hopper with the same phone number as any manual call being
    placed from the agent screen, and if one exists it will be deleted
    before the manual dial call is placed.
  61. Added recording access logging per user(must be enabled in System Settings)
  62. Added ability to transfer customer chats to another chat group or agent
  63. Added API Log Report to Admin Utilities page
  64. Added Alternate IVR(Call Menu) Logging options
  65. Added option to define a carrier across all active asterisk servers
  66. Added campaign option to move USERONLY scheduled callbacks to ANYONE
    callbacks after X minutes being LIVE without the agent calling them
  67. Made several changes to the admin web screen and real-time report designs
  68. Added options to define color scheme and logo for admin web screens
  69. Added new options to enable the recent changes to the UK OFCOM Drop Rate
    calculations. There is a new System Setting to enable on the system,
    and then each affected campaign must also have the new option enabled
    for it as well. Affects the predictive algorithm and the Real-time and
    Outbound Calling reports.
  70. Added phone outbound alt caller ID to allow for phone-dialed calls to use
    a separate CID number when dialing through a specific context
  71. Added display of admin change differences to last change on the change
    detail page
  72. Added the ability to copy audio store files with a new name
  73. Started process to redesign the Agent Screen, added Screen Colors
    definitions, removed san-serif fonts, changed loading/login/logout
    screens, logging of browser width/height.
  74. Changed HTML Reports to use dynamic charting Javascript elements
  75. Added campaign option to automatically manual dial next number in agent
    screen after X seconds. Must be enabled in System Settings.
  76. Added recording filename option to update filename post-call with select
    variable values, uses options in script
  77. Added ALT Multi Dispo URL option to restrict URL sending by list ID.
  78. Added Admin Bulk Tools page, linked from Admin Utilities page
  79. Added customer chat options for logo/colors and a survey link after chat is
  80. Added the User Group Hourly Report
  81. Added User List NEW Lead Limits, with User overrides. Allows you to set a
    limit on the number of NEW status leads that an agent can call on a per
    list basis per day. Also allows overall NEW limits across all lists for
    a user per day
  82. Added List Merge admin utility
  83. Added Fronter – Closer Detail Report
  84. Added option to allow agents to park 3way calls in the agent screen
  85. Added option to web lead loader to restrict leads to only those with a
    phone number of a specified length. Options for forced system-wide and
  86. Added more options to the Callback moving utilites in Admin Utilities page
  87. Added Agent Audio Soundboards

#### UPGRADING FROM 2.9 TO 2.11

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. Check system_settings, make sure you are at DB Schema Version 1378 or higher
    If not, run the instructions for 2.7 to 2.9 before this section.
  2. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.10.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.10.sql
  3. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  5. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Added User setting for Wrapup Seconds Override
  2. Added new Agent API function audio_playback to play audio files from the audio
    store in an active agent session. See AGENT_API.txt doc for more info.
  3. Added option to DIDs to allow routing of calls to a redirect extension if
    there are no agents available in a specific in-group
  4. Added option to DIDs to allow pre-filtering by a specific filter phone group
    before the standard filtering process. The call can be redirected to a
    specific DID entry if there is a match.
  5. Added Wrapup Bypass option to allow or disallow agents to skip the wrapup
    screen before the timer is finished. Also added the option to use a
    system Script as the Wrap Up Message
  6. Added $RS_droppedOFtotal options.php option for the realtime report to allow
    the drops to be calculated out of Total calls instead of just Answers
  7. Added ability to use Wrap-Up messages with calls terminated through Hotkeys
  8. Integrated all QC code into standard admin code, removing includes as well
  9. Added System Setting option to use 24-hour time for callback setting in agent
  10. Added User Group viewable report entry for Front Page System Summary
  11. Added archive log search and display in modify lead page
  12. Added campaign options to limit number of active callbacks
  13. Changed all Agent and Administrative interface text output to use a function
    instead of echo.(for dynamic other-language interfaces)
  14. Added Admin Utility to split lead lists into smaller lists
  15. Added campaign options to minimize QC audited comments without closing the
    frame, allow for the comments field to appear under all agent screen
    tabs and the dispo screen and the callback date select screen, allow
    for the audited comments to be displayed with managers in red and with
    a date/time stamp. Also, a campaign option to not display the Previous
    Callback panel in the agent screen.
  16. Added campaign option to clear the script after call disposition.
  17. Added administrative web interface for managing Languages. The language
    features are now active in the admin interface as well as in the agent
    screen. Language files are available in the “translations” directory
    in the source code, as well as on this website:
  18. Added No Agent URL option override for Lists
  19. Added CPD Unknown Action option to Campaigns
  20. Added new user option to allow administrative users to search for leads
    systemwide even in lists belonging to campaigns that the user’s User
    Group settings don’t allow them to view
  21. Added Local Call Time option for Lists to further restrict call times
    already set in the campaign.
  22. Added Manual Dial Lead Search Filter option to limit the search of manual
    dials to within one campaign’s lists.
  23. Added NAME as an agent screen Status Display variable
  24. The PAUSE and RESUME buttons in the agent screen have been turned into a
    single button named “You are paused” or “You are active” depending on
    your status. Issue #814
  25. Added new LOCK options to Manual Dial Search Checkbox to prevent the agent
    from checking or unchecking the search checkbox.
  26. Added case-sensitive user ID validation on agent login.
  27. Added option in phones and voicemail to display message counts on the
    Admin Summary screen.
  28. Added Callbacks Bulk Move admin utility. Also changed behavior of the
    removal links for callbacks from the callback hold displays for Users,
    User Groups, Lists and Campaigns.
  29. Added DYN filename prefix for non-TTS dynamic files to be used for answering
    machine message. For instance using DYN–A–user–B– for agent 1234
    would look for a file named 1234.wav in your audio store to play.

#### UPGRADING FROM 2.7 TO 2.8 (2.9 release branch)

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. Check system_settings, make sure you are at DB Schema Version 1347 or higher
    If not, run the instructions for 2.4 to 2.7 before this section.
  2. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.8.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.8.sql
  3. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  5. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Added outbound state call time holidays functionality. Only works if the
    “state” field is populated properly in your leads.
  2. Added several security changes to the agent interface, including freezing a
    user’s account for 15 minutes after 10 failed login attempts.
  3. Changing all of the admin scripts from using the PHP ereg functions to preg.
    This is a requirement for moving to PHP6 where ereg functions are
    depricated. This will also have the benefit of speeding up those scripts
    because preg is supposed to be more efficient and faster than ereg.
  4. Added several security changes to the admin interface, including freezing a
    user’s account for 15 minutes after 10 failed login attempts.
  5. Added 4 new reports to the admin interface: url log, lagged log, user group
    login and dial log reports
  6. Added new –agent-lookup flag to allow for logging of the
    IP address of the agent’s SIP or IAX phone connection. Can be enabled as
    a crontab entry to perform the lookups on each asterisk server.
  7. Added optional encrypted passwords capability within the system. If enabled,
    all user passwords must be converted to encrypted passwords. To use this
    you need to have this CPAN module installed on your web servers: cpan> install Crypt::Eksblowfish::Bcrypt To enable, first go to the Admin -> System Settings page and manually confirm that Password Encryption is DISABLED (fifth item from the top) Then, just run the following CLI script: (run in test mode first!) /usr/share/astguiclient/ --debugX --test For more information on Encrypted Passwords, read the ENCRYPTED_PASSWORDS.txt document in the docs directory
  8. If you are using the agi-phone_monitor script for agent monitoring, then
    the following dialplan lines need to be added to the same place where
    you put the original dialplan additions necessary for this feature
    to work: (it is shown in context in the 2.6 upgrade instructions below) ; quiet entry, listen-only, exit-on-dtmf conferences for VICIDIAL (listen) exten => _588600XXX,1,Dial(${TRUNKblind}/56${EXTEN:2},55) exten => _588600XXX,n,Hangup() ; barge, exit-on-dtmf conferences for VICIDIAL (barge) exten =&gt; _598600XXX,1,Dial(${TRUNKblind}/57${EXTEN:2},55) exten =&gt; _598600XXX,n,Hangup()</code></pre></li>Added Reset Lead-Called-Status for Campaigns page to Admin Utilities Added System Summary screen as default admin.php screen instead of User List Added new agent_monitor.agi script to replace the agi-phone_monitor script
    for agent monitoring. Please read the AGENT_MONITOR.txt document for
    more information on the dialplan changes necessary to use this script. Added the ability to deduplicate leads based upon statuses in the web based
    lead loader using templates and the basic web lead loader. Added dialplan variable CAMPCUST for manual dial and auto dial outbound
    calls that is set to the campaign_id of the phone call. This allows for
    the ability to put the following in your dialplan for outbound calls
    so that you can send out the campaign_id as a SIP header.
    NOTE: if you want to use this it must be placed immediately below the
    AGI call_log line of the dialplan and before the Dial line:
    exten => _91NXXNXXXXXX,n,SipAddHeader(X-campaignid: ${CAMPCUST}) Changed all PHP code to use PHP mysqli functions. This does not require
    any action or changes to enable since it is a change to the code.
    We are working on converting the administrative PHP scripts as well.
    These require MySQL 5.0 minimum to be used, but for several years that
    has been the minimum for Vicidial anyway, so that requirement shouldn't
    be a problem for existing systems running the newest code. The existing
    older mysql PHP functions are set to be marked as depricated in PHP for
    future versions. For more information on mysqli you can visit the below
    webpages: Added script to allow for transmission of
    second archival of recordings to an FTP SSL server. Added settings to the agc/options.php file to allow for forced launching of
    the agent screen from a script like the new launch.php script. The agent
    is not allowed to login by going to the vicidial.php page directly, and
    the launch.php page will open the agent screen with a read-only address
    bar and several other browser options disabled. To enable this feature,
    just set the $window_validation variable to '1' in options.php Added phone number type field/list_id updating scripts. Compatible with
    DNC.COM's daily update file services. Read the
    CELLPHONE_USA_TCPA_FCC_COMPLAINCE.txt file for more detailed information
    on this feature. Added lead search of archived leads table if present. Added QueueMetrics 13.04 support with call hold records Added system setting to view country code breakdown in list modify screen. Added campaign option to allow agents to be able to place manual dial calls
    by Lead ID. Added Advanced lead tools management, access from the Admin Utilities page Admin HELP text moved to separate help.php script Added option.php option to allow user ID click to pause code report from the
    Agent Time Detail report Added campaign options to limit time on Dead Calls, Disposition Screen
    and Pause. Added Servers option to have Asterisk automatically restarted if it crashes Added called_count logging to vicidial_log table Added logging of webserver and url used for all API calls, agent logins
    and reports Added Lists Pass Report Added Agent API pause_code function Added VMAIL_NO_INST options to send calls to voicemail with no instructions
    playing after the voicemail greeting. Also phone option has been added
    to allow no instructions to be played on direct extension calls that go
    to voicemail. Added Non-Agent API function update_user to allow updating of the major
    user fields Added Non-Agent API functions for check_phone_number and server_refresh Added Agent API functions for preview_dial_action while previewing or
    manual alt dialing a lead Added Called Counts List IDs Report Added MathZDC function to prevent division math with zero as one of the
    numbers. Added DID Filter options to allow for filtering by the INTERNAL DNC list or
    a Campaign DNC list. Also added a method to allow for URL filtering to
    direct a call to a specific system DID instead of only going to the
    Filter Action. Added Performance Comparison Report Added Max Inbound Calls options to Campaigns and Users to enforce a maximum
    number of inbound calls received per day per agent. Added campaign option to default the search existing leads checkbox on the
    manual dial screen of the agent interface, as well as reset it after
    every call Added campaign option to hide call log and call count data on the agent
    screen when viewing lead information Added User permission option for editing Custom Dialplan Entries Added logging of pause type(ADMIN, AGENT, SYSTEM, API,…) Added frozen call clearing system setting, used in admin.php(Reports page)
    and optional script Added campaign options to auto-select the ALT DIAL checkbox, and to
    automatically dial the Alt Phone or Address3 field after a set number
    of seconds Overhauled Spanish Agent and Admin translations and Dutch agent translation
    Added Dutch button images to Dutch translation

#### UPGRADING FROM 2.4 TO 2.6 (2.7 release branch)

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. Check system_settings, make sure you are at DB Schema Version 1316 or higher
    If not, run the instructions for 2.2.0 to 2.4 before this section.
  2. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.6.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.6.sql
  3. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  5. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Added the ability for an agent to place manual dial calls out as if they were
    in-group inbound calls. Also allows for no-dial calls that are not
    actually placed out the telco, but are logged as calls. For more
    information see the “In-Group Manual Dial” options in Campaign Detail
  2. Added Dial In-Group CallerID override to In-Groups Modify screen, allowing
    for the callerid to automatically be set per in-group on agent manual
    dial in-group calls
  3. Added transfer call to answering machine message with hotkey option,
    currently hard-coded to these two statuses: (LTMG or XFTAMM)
  4. Added User Group Login Report
  5. Added Safe Harbor Audio Field to campaign options which allows for a lead
    field to be used as an override safe harbor audio on a per-lead basis
  6. Added Japanese agent web interface translation
  7. Added ability to qualify callers before they go through a Call Menu by using
    a SQL fragment(like in Filters) that you define in a Call Menu. Must be
    enabled in System Settings. Calls must be passed from an outbound
    campaign or an in-group.
  8. Added ability to download the Max System Stats and display by date range.
  9. Added ‘recording’ and ‘webserver’ functions to the agent API
  10. Added add_group_alias non-agent API function
  11. Added System Settings option to disable list counts in admin web screens
  12. Added callback user transfer page, linked from Admin Utilities in Reports
  13. Added non-loading webphone options and API agent call and webphone url
  14. Added outbound call logging in vicidial_dial_log table
  15. Added user_group_status and in_group_status functions to the non-agent API.
  16. Added update_log_entry function to the non-agent API, which allows the
    updating of the status of an inbound or outbound call log entry.
  17. Added ability to set an audio store file for the voicemail greeting message
  18. Added ability to delete audio files from the audio store
  19. Added logging of svn version info in the database at server install/update
  20. Added more validation of agent sessions to prevent double-logins
  21. Added campaign option to show a “Pause After Next Call” link to the agent
    screen below the Pause/Resume buttons
  22. Added campaign option to set owner field to user if the owner field is empty
  23. Added Lead Tools web page from Admin Utilities. Allows for some basic lead
    management through the web interface.
  24. Added recording filename variable INGROUP for the In-Group ID of a call
  25. Added QC functionality contributed by PoundTeam and Affinity On-Call.
    To enable, go to Admin -> System Settings and set “QC Features Active”
    to “1”, then submit.
  26. Added QM Socket-Send functionality for custom queue_log record sending.
  27. Added inbound call time holiday functions.
  28. Added list expiration date feature
  29. Added Other Campaign DNC List campaign option
  30. Added Enhanced Disconnect logging for outside the USA, disabled by default
  31. Added a campaign feature to allow an agent to search for a lead while on an
    inbound call and have their active lead change to a search result lead
    that they select.
  32. Added inbound email to queue to agent features. To enable, you must add an
    “E” keepalive to ONLY ONE of your servers. You will also need to enable
    email in System Settings. You also need the following perl cpan modules
    install LWP::UserAgent
    install HTML::Entities
    install HTML::Strip
    install HTML::FormatText
    install HTML::TreeBuilder
    install Switch
    install Time::Local
    install MIME::Decoder
    install Mail::POP3Client
    install Mail::IMAPClient
    install Mail::Message
    install IO::Socket::SSL
    install MIME::Base64
    install MIME::QuotedPrint
    Also, the inbound email parser must be added to the crontab of ONLY ONE
    ### inbound email parser
    * * * * * /usr/share/astguiclient/
  33. Added Asterisk 1.8 support. This is in the BETA testing phase currently,
    and is not recommended for use in production at this time. If you are
    upgrading an existing system, please make note of the many conf file
    changes(extensions.conf and manager.conf) that will need to be made for
    Vicidial to function properly while interfacing with Asterisk 1.8. Also,
    make sure that the Admin -> Servers -> modify server “Asterisk Version”
    setting is set properly for the version you have installed on that
  34. Added campaign options to send answering machine detected calls to a
    Call Menu or In-Group.
  35. Added System Settings option to disable Add/Copy admin functions for level
    8 users.
  36. Added ability to use .agi scripts in Call Menu prompt. Also added
    cm_date.agi script to say date with options
  37. Converted ereg to preg in the agc agent interface PHP scripts
  38. Added agi-phone_monitor.agi script to allow monitoring of agents using only
    their user IDs or phone extensions and no web browser needed.
    You can add as an AGI to a Call Menu, or just an extension transfer:
    call menu AGI with options:
  39. [up_monitor]
    or as extension transfer to “up_monitor_exit” context and “s” extension settings for this script: 1. USER or PHONE, lookup by user id or phone extension (default is USER) 2. Y or N, log in api log (default is N) 3. BARGE or LISTEN, (default is LISTEN) For this to work you need to add these lines to your extensions.conf: (which can be added to the "System Settings -> Custom Dialplan" instead) ; quiet entry, listen-only, exit-on-dtmf conferences for VICIDIAL (listen) exten =&gt; _568600XXX,1,Set(MEETME_EXIT_CONTEXT=up_monitor_exit) exten =&gt; _568600XXX,n,Meetme(${EXTEN:2},mqX) exten =&gt; _568600XXX,n,Hangup() ; barge, exit-on-dtmf conferences for VICIDIAL (barge) exten =&gt; _578600XXX,1,Set(MEETME_EXIT_CONTEXT=up_monitor_exit) exten =&gt; _578600XXX,n,Meetme(${EXTEN:2},X) exten =&gt; _578600XXX,n,Hangup() ; quiet entry, listen-only, exit-on-dtmf conferences for VICIDIAL (listen) exten =&gt; _588600XXX,1,Dial(${TRUNKblind}/56${EXTEN:2},55) exten =&gt; _588600XXX,n,Hangup() ; barge, exit-on-dtmf conferences for VICIDIAL (barge) exten =&gt; _598600XXX,1,Dial(${TRUNKblind}/57${EXTEN:2},55) exten =&gt; _598600XXX,n,Hangup()
  40. {up_monitor_exit}

exten =&gt; h,1,AGI(agi://–HVcauses–PRI—–NODEBUG—–${HANGUPCAUSE}—–${DIALSTATUS}—–${DIALEDTIME}—–${ANSWEREDTIME}) exten =&gt; _X.,1,Set(MEETME_EXIT_CONTEXT=up_monitor_exit) exten =&gt; _X.,n,AGI(agi-phone_monitor.agi,USER—N—LISTEN—${EXTEN}) exten =&gt; _X.,n,Hangup() exten =&gt; s,1,Set(MEETME_EXIT_CONTEXT=up_monitor_exit) exten =&gt; s,n,AGI(agi-phone_monitor.agi,USER—N—LISTEN) exten =&gt; s,n,Hangup() exten =&gt; i,1,Goto(up_monitor_exit,s,1) exten =&gt; i,n,Hangup() exten =&gt; #,1,Goto(up_monitor_exit,s,1) exten =&gt; #,n,Hangup() exten =&gt; t,1,Goto(up_monitor_exit,s,1) exten =&gt; t,n,Hangup()

exten =&gt; h,1,AGI(agi://–HVcauses–PRI—–NODEBUG—–${HANGUPCAUSE}—–${DIALSTATUS}—–${DIALEDTIME}—–${ANSWEREDTIME}) exten =&gt; _X,1,Goto(up_monitor,s,1) exten =&gt; _X,n,Hangup() exten =&gt; i,1,Goto(up_monitor,s,1) exten =&gt; i,n,Hangup() exten =&gt; #,1,Goto(up_monitor,s,1) exten =&gt; #,n,Hangup() exten =&gt; t,1,Goto(up_monitor,s,1) exten =&gt; t,n,Hangup()</code></pre></li>

Added user_group as a script, form, webform, start_call_url and
dispo_call_url variable.

Added agent_status function to the non-agent API

Added method for logging SIP error codes, also display of those codes in the
agent screen. The logging goes to the vicidial_carrier_log and
vicidial_dial_log tables and includes both the SIP code and the reason
(i.e. 503 “Service Unavailable”). To get this to work, you need to patch
Asterisk with the extras/sipcausecodelog_1.4.39.1.patch file for
Asterisk 1.4, and for Asterisk 1.8 the patch is pending.

cd /usr/src/asterisk/asterisk-
patch -p1 < ./sipcausecodelog_1.4.39.1.patch
   (file to patch: channels/chan_sip.c)
make clean
make install
   (then stop and restart asterisk)

Added admin report logging to all reports on the system, and added the
“Admin Report Log Viewer” linked from the “Admin Utilities” page which
allows you to see the reports that have been run on the system.

Added option to the script to remove duplicate
callback entries for a single lead, keeping the newest one only.

Added NANPA areacode and prefix phone number validation and timezone setting
options to the admin web lead loader, the Non-Agent API and the CLI lead
loader. The NANPA prefix list will give you more accurate time zone
encoding of your USA and Canadian lead files within ViciDial. The NANPA
list is available for purchase at the web store:

Added a NOINT flag option to the Call Menu Prompt so the playback cannot be
interrupted with a key press by the caller, the NOINT should be put
directly in front of the prompt filename, but should not be a part of
the filename, it is a special flag for the system.

Added Survey No Response DROP option to send no-response calls to the
campaign drop method and added Survey Wait Seconds to allow you to set
the amount of time the person called will have to respond after the
survey message is played.

Added script to check for Asterisk update sync issues. Also
added red indicator on Reports page servers table if server falls out of

Updated and cleaned up other language builds for agent and admin.

#### UPGRADING FROM 2.2.0 TO 2.4

OPTIONAL STEPS(But highly recommended) – Backup existing system:

  1. Run this for a 1-server system or server with database on it:
    (this may take hours on large system)
    /usr/share/astguiclient/ –debugX
  2. Run this on dialer/Asterisk-only servers:
    (do not run this if you only have one server):
    /usr/share/astguiclient/ –debugX –without-db –without-web


  1. upgrade the MySQL asterisk database(you have two options):
    A. Running the upgrade file directly from Linux:
    mysql -f –database=asterisk < /path/from/root/extras/upgrade_2.4.sql B. Going into mysql and executing the upgrade sql file:
    use asterisk
    . /path/from/root/extras/upgrade_2.4.sql
  2. install new files:
    perl ./
    NOTES: If you have customized any scripts in the bin or agi folders,
    then make sure you back them up before running the script.
    This script will replace existing files in the astguiclient installation.
  3. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
    page and set each one to “Rebuild conf files = Y” and click submit.
    This will rebuild the conf files to ensure any changes are updated.
  4. On one server only, update your phone codes data:
    /usr/share/astguiclient/ –purge-table –debug


  1. Changed “After hours”, “No agent no queue” and “drop timeout reached” DROPs
    to use AFTHRS/NANQUE/TIMEOT statuses respectively
  2. Added an option to record calls that enter through a DID until they end or
    enter an in-group queue. MUST ENABLE –MIX CRONTAB ENTRY!!!
  3. Added ability to have AGENTDIRECT calls that drop go to user’s defined
    voicemail box
  4. Added ability to use a webphone added in an IFRAME in the agent screen.
    Tested with Zoiper webphone and sample code included
  5. Added vdc_script_notes.php for call notes and appointment taking, read
    comments for more information.
  6. Added Call Log View options to the Agent screen, can be enabled in the
    User Group screen or the User screen in Administration
  7. Added custom dialplan entries fields for System Settings and Servers
  8. Added ability to use security_phrase field in the vicidial_list table as a
    Custom CallerID, must enable in Campaign settings
  9. Changed voicemail auto-config to use voicemail.conf directly because include
    files are not fully supported in voicemail.conf. If you have any custom
    voicemail boxes that are NOT defined in ViciDial then you need to put
    them in a custom context above the [default] context in voicemail.conf
    in order to keep them. This change will update the ViciDial database if
    the user changes their voicemail password through their phone. If that
    user also uses that phone entry to login to vicidial.php that password
    will be changed as well
  10. Changed AGENTDIRECT selection to be triggered by clicking on AGENTS link
    instead of number-to-dial field
  11. Reformatted lead search page and added first and last name search options
  12. Added 3-WAY status to the Real-time report to show when agents are in
    consultative transfer sessions
  13. Added AGENTONLY Scheduled Callbacks display options to allow the Callbacks
    link line in the agent interface to show as red and/or blink. Also,
    added option to have callbacks count display only triggered callbacks
  14. Added carrier log display option to Real-time report to show the hangup
    causes for the last 24/6/1 hours and 15/5/1 minutes of outbound calls
  15. Added agc/deactivate_lead.php script that can change the status of a lead in
    another campaign with the same vendor_lead_code, source_id or other
    field match. See the file comments for more information
  16. Added options.php for vicidial.php to give you the ability to change the
    interface options in a separate file so that they can be preserved
    through an upgrade. See options-example.php for more information
  17. Added CallCard featureset to allow for pin-number entry before entering an
    In-Group by a customer with minute balances and a basic admin interface.
    See the CALLCARD.txt doc for more information.
  18. Added display options for agent screen Transfer-conf buttons in the User
    Group modification screen.
  19. Added ra_call_control function to agent API to allow for hangup and transfer
    of calls sent to a Remote Agent also allows for setting of a disposition
    for more information read the AGENT_API.txt doc.
  20. Added Extension Groups feature to Remote Agents section allowing calls to be
    sent to different numbers in a round-robin method when enabled on
    multi-line remote agent accounts. To enable, you must create Extension
    Group entries and enable Extension Group in the Remote Agent entry.
  21. Added agi-AGENT_route.agi script to more easily allow for agentdirect calls
    from call menus without having to create a DID entry for every agent.
    Simply put this line in the custom dialplan section of the call menu
    that you want to allow agentdirect dialing for:
    “exten => _XXXX,1,AGI(agi-AGENT_route.agi,default—AGENTDIRECT)”
    That example will only work for agents that have 4-digit IDs.
    This works well even after hours and when the agent is not available
    because you can set the call to go to a voicemail box in the selected
    in-group by using AGENTVMAIL in the voicemail field of the in-group.
  22. Add the following lines to the extensions.conf to fix bug with manual dial
    leave answering machine message(put in the default context):
    exten => _8320.,1,AGI(VD_amd.agi,${EXTEN}—–YES) exten => _8320.,2,Hangup
  23. Added ability to search logs from admin search lead page
  24. Added more login information to the User Stats page including session,
    server, phone and computer IP
  25. Added Manual Dial override option to campaigns to allow overriding of
    user options for manual dial permissions
  26. Added campaign option for alerting the agent when they are being blind
    monitored. Options include an alert, a notice and an audio alert
  27. Added inbound custom call ID display and logging feature, also added
    vicidial_log_extended which stores more useful call log info
  28. Added optional phone codecs definitions as well as system-wide defaults
    for codec definition. Default for both is blank which will keep
    whatever is set at the top of the iax.conf or sip.conf files
  29. Added option to allow user information to be blocked form the real-time
    report by user login(the user viewing the report)
  30. Added Hold Time Option Minimum option to in-groups which will prevent the
    hold time option from running until a minimum number of hold seconds.
  31. Added headers to the list export and calls export reports
  32. Added several PRESS-1 options to the Hold Time Option settings for In-Groups
  33. Added Call Time after-hours filename override option used by inbound groups
  34. Added Campaign setting for inbound queue no dial that will prohibit outbound
    auto-dialing if there are any allowed in-group calls in queue if enabled
  35. Added In-group options for setting the length of the on hold message and the
    hold time option press message as well as offering the option to have
    those two prompts be non-blocking and allow existing newer calls through
    to agents while the prompts are playing
  36. Added utility in CallCard section to generate new card IDs and view by Run.
  37. Added Agent API functions for Send DTMF, Park Customer and the Transfer
    Conference functions as well
  38. Added prompt options for in-group VIDPROMPT methods when initiated from Call
  39. Added web-configurable TTS voice option. Please make sure the Cepstral voice
    is installed before entering one.
  40. Added function for start_call_url to work with remote agents
  41. Added custom default field names for fields in the agent interface. Defined
    in the Admin System Settings
  42. Added new code to help deal with agents on poor network connections. New
    vicidial.php option is $conf_check_attempts
  43. Added Custom List Fields functions to the Admin and Agent web interfaces.
    To activate you need to enable custom fields in system settings, then
    you can go to the Lists section to add custom fields to a list. The
    fields are tied to a list, not a campaign, and they can be displayed
    in a new tab in the agent interface, and there is a new option to have
    the Get Call Launch open this custom fields tab upon a call being sent
    to the agent. Also, the Calls Export Report and the List Download
    feature include the custom fields values for the leads exported. You
    can import custom field data through the web-based lead loader in TXT
    and CSV format(you must set a list ID override and you must select
    Custom Format). You can also use the non-agent API add_lead function,
    (see the NON-AGENT_API.txt doc for more info). You can also use the
    third gen lead loader to import leads with custom files in several
    other formats.
  44. Added more options to agi-AGENT_route.agi to allow it to prompt for user IDs
    as well as set the number of digits to collect and check whether a user
    is logged into ViciDial. The script can also now be run as an AGI route
    option in CallMenus as well as in the custom dialplan.
    Look at the comments in the code for more info.
  45. Added third generation web-based lead loader capable of loading more data
    file types and optionally loading all of them with custom list fields.
    You must install the following perl modules on your web server for this
    new lead loader to work:
    cpan> install Spreadsheet::XLSX
    cpan> install Spreadsheet::Read
    To get to the new lead loader, click to:
    Lists -> Load New Leads
    Here is a list of the file formats(by file extension) that are now
    supported by the third generation web lead loader:
    TXT – tab or pipe delimited
    CSV – comma separated values
    XLS – MS Excel 2000/XP
    XLSX – MS Excel 2007+
    SXC – First Generation Spreadsheet
    ODS – OpenDocument Spreadsheet
  46. Added the ability to run selected reports from a MySQL slave server. This is
    definable in the System Settings in the admin.php interface. You must
    already have MySQL Master/Slave replication set up for this to work.
  47. Added options to include recording ID, Filename and/or Location with Call
    Export Report results
  48. Added Non-Agent API function for updating leads: update_lead
    Allows for searching by lead_id, vendor_lead_code and phone_number
    as well as the ability to insert a new lead if no results found.
    Works with custom fields as well.
    For more information, look in the docs/NON-AGENT_API.txt doc
  49. Added Wait Time options to in-groups. This is different from the Estimated
    Hold Time options because this is based only on the customer wait time.
    Also, second and third options were added for both allow the offering of
    a press 1, 2 and 3 option in the wait/hold time option features.
  50. Added timer action methods HANGUP, EXTENSION, CALLMENU and IN_GROUP. These
    allow you to hangup or transfer the call at a set number of seconds
    from start time or triggered from an outside process.
  51. Added Allowable Reports option in User Groups for user_level 7 and higher
    users to restrict viewable reports. Also enforced the Allowed
    Campaigns option in User Group across admin.php and reports
  52. Changed the “Admin” link in admin.php to go to a links page instead of a
    listing of Phones, also forced level 7 users to the reports links page
    if they try going anywhere in admin.php
  53. Renamed “In-Groups” header in admin.php to “Inbound” to reflect that it is
    not just for In-groups, but includes DIDs and Call Menus as well
  54. Added Filter Phone Groups to allow calls coming into DIDs to be filtered
    and sent to a different route if the caller ID number matches one in
    the selected Filter Phone Group, or the search can be done by a web GET
    to a URL that you define.
  55. Added method to clean caller ID number when calls come into DIDs, either by
    stripping specific digits from the front of a number if they are there
    or taking only the right X numbers, i.e. R10 will take only the 10
    digits on the right of a number, and L1 will remove only a 1 from the
    left side of the number.
  56. Added ability to download DNC numbers from the internal and campaign-
    specific DNC lists, as well as the Filter Phone Groups
  57. Added validation for Remote Agents to ensure that the User Start is a valid
    User in the system, also added validation that Remote Agents do not
    overlap their number of lines into another Remote Agent
  58. Added ability to override the System Settings webphone URL per User Group
  59. Added Calculate Estimated Hold Seconds setting which can delay the
    Calculation and optionally the announcement of Estimated Hold Time
    for X seconds.
  60. Added new beta script for faster checking of leave-3way conferences,, read the comments before using.
  61. Added Transfer Presets to Campaigns allowing for unlimited dial presets for
    agents to use in the transfer-conf frame of the agent interface. Also,
    real-time and outbound report reporting have been added to show call
    counts for these presets. Presets can optionally have their numbers
    hidden from agents allowing agents only to select a preset name to
    transfer or conference a call to. You must Enable Transfer Presets in a
    campaign before you can define them in the Presets sub-menu.
  62. Added ability to hide the “Number to dial” field in the Transfer-conf frame
    of the agent interface. This is a Campaign-level setting.
  63. Added Manual Dial Prefix to allow for a different dial path for manual dial
    calls placed through the agent interface.
  64. Added did_id, did_extension, did_pattern, did_description, closecallid,
    xfercallid and agent_log_id as webform and script variables in the agent
  65. Added webphone options for System Key and Dialpad, may not be compatible
    with all webphones.
  66. Allow the changing of the queue priority of an inbound call while the call
    is in queue.
  67. Changed the example iax.conf and sip.conf to default to context=trunkinbound
    to prevent unauthenticated calls on insecure phone accounts
  68. Added password strength grading for users, phones and servers. Added ability
    to force a user password change on the next admin login. Added password
    default settings to System Settings and added a first login setup screen
  69. Changed application limit for lead_id from 9 digits to 10 digits. This does
    not affect the database limit of lead_id: 4294967295
  70. Added customer 3way hangup logging options to campaigns which will log if
    and how far into the 3-way call a customer has hung-up, as well as if
    the agent initiated the call after the customer hung up. There is also
    an option to end the 3-way call and send the agent to the disposition
    screen if the customer hangs up during the 3-way call.
  71. Added ability to view Inbound Report by selected DIDs instead of by
    in-groups. Link added to Reports page.
  72. Added dispo_move_list.php script which can be used in the Dispo Call URL
    option for a campaign or in-group. This script can be used to move a
    lead into a different list_id after the agent disposition depending on
    the disposition that is selected. Optionally, the lead can also be reset
    so that it can be dialed back immediately. See the code comments for
    more information.
  73. Added the Lists Campaign Statuses Report which is a list inventory report,
    not a calling report. This report will show statistics for all of the
    lists in the selected campaigns.
  74. Added ability to use Custom List Fields in Web Forms, Scripts and Dispo
    Call URL entries used by the agent interface.
  75. Added “Add Lead URL” feature to in-groups. Works like Dispo Call URL except
    it will send a web get out as soon as a lead is created by the inbound
    process. There is a more limited set of variables available for use with
    this option, see the admin.php help for more details
  76. Changed the PARK CUSTOMER option in campaigns to use a Music-on-Hold context
    instead of a difficult-to-configure filename and extension as before
  77. Added new IVR PARK CUSTOMER feature to campaigns allowing an agent to park
    a customer to an AGI script as an IVR and have the customer enter in
    digits unassisted and then be redirected back to the agent who parked
    them when they are finished. Optional in-group redirect if customer
    does not enter valid input. See example park_call_IVR_example.agi script
  78. Added In-Group options for Estimated Hold Time Minimum, which can replace
    the “15 seconds” minimum accouncement with an announcement of your
  79. Added a campaign option for Manual Preview Dial, to enable or disable that
    manual dial option, as well as allowing or disallowing for the SKIP
    lead option.
  80. Added two new recording filename variable options: VENDORLEADCODE, LEADID
  81. Added the ViciDial Web Dial Firefox web browser plugin, that allows right-
    click selection dialing of phone numbers on web pages to a logged-in
    ViciDial Agent session. See “extras/firefox_plugin” for more info.
  82. Added ability to change users’ in-group settings from the in-group
    modification screen in bulk.
  83. Added Agent Average time stats option to the real-time screen. Must enable
    realtime_agent_time_stats option in campaign screen.
  84. Added customer park time counter to the agent screen when customer is on
    park. Also, added logging of parked calls to park_log table
  85. Added ADDMEMBER queue_log logging option to System Settings, and added
    CALLERONHOLD entries to queue_log when customer is on park.
  86. Added admin no-cache and auto-refresh of modify screens to admin interface.
    These are configurable in the System Settings
  87. Added option for cross-server phone dialplan extensions in System Settings.
  88. Added campaign feature to automatically adjust the hopper level to the
    dialing rate and the number of active agents, also added a trim feature
    to make sure the hopper is not filled too much
  89. Added the ability to filter manual dial calls to adhere to the call time
    scheme selected for the campaign. Does not work with State Call Times.
    Must be enabled in the Campaign Detail settings.
  90. Added the ability to queue multiple manual dial calls for a specific logged-
    in agent using the Agent API. Feature must be enabled in the Campaign
    Detail settings.
  91. Added ability to modify scheduled callback dates and comments in the Admin
    Modify Lead screen.
  92. Added List override options for webform fields
  93. Added script to purge all vicidial_callbacks records that are inactive or
    are tied to deleted leads,
    add to the crontab like this:
    # cleanup of the scheduled callback records
    25 0 * * * /usr/share/astguiclient/ –purge-non-cb -q
  94. Added did_log_export and recording_lookup functions to the non-agent API
  95. Added option to display statuses within the active lists of a campaign in
    the campaign modification screen. Also includes called and not called
  96. Added rewritten AJAX/Javascript driven real-time report, able to support
  97. Added the ability to hide fields in the agent interface by entering
    —HIDE— into the System Settings label option for the field
  98. Added preprocess leads in script to filter leads and generate standard
    format lead files before being imported
  99. Added the ability to have call times go beyond midnight for inbound calls.
  100. Added capability for agent interface to have webphone as a thin top bar
  101. Added hopper loader randomization option in Campaign Detail screen, which
    allows for the results to be randomized inside of the sorted results as
    sorted by the List Order option
  102. Added add_user and add_phone non-agent API functions
  103. Changed vicidial.php HTML formatting to be XHTML compliant
  104. Added vdc_script_dispo_example.php script which can be customized to
    require specific fields be filled in before submitting, as well as
    limiting this restriction to only specific dispositions. You can also
    specify dispositions to be selectable that are set to non-selectable.
    You use this script in an IFRAME for the campaign. It must be
    customized for your specific business rules.
  105. Added the ability to use custom statuses for scheduled callbacks. These
    are configurable with the Scheduled Callbacks flag in the System
    Statuses and Campaign Statuses administrative screens.
  106. Added Secondary List Order which allows for further sorting of leads to be
    dialed by a secondary sorting method
  107. Added Default Campaign setting for the My Callback agent interface option
    so that the checkbox can be pre-selected or not on every call
  108. Added the campaign option for per-call call notes in the agent interface.
    If the User Group also has Call Log enabled, the agent can also see
    the call notes from previous calls.
  109. Added the add-a-new-lead link to the admin interface
  110. Added ability for an agent to search for a lead in the agent interface
    while paused. This feature can be enabled per campaign and per user.
    Searches can optionally be restricted to campaign lists or only one
    list. All search queries are logged.
  111. Added options to restrict agent lead search to the owner field equal to
    the user, user group or selected territories for the agent.
  112. Added option for phone load balanced logins server twin checking on
    systems that have servers installed in pairs
  113. Changed scheduled callbacks display in the agent interface to show all
    callback and lead information, including call history and call notes,
    without having to dial the lead.
  114. Added on-hook agent phone feature. This feature allows inbound calls from
    customers to ring on an on-hook agent phone, but not be transferred to
    that agent until the agent’s phone is answered. If the call times out
    then the call will go on to the next agent. This is defined in the
    Phones record and allows the agent using the vicidial.php agent screen
    to not have to stay on the phone at all times when they are logged in.
    You will need to add the following lines to the default context in your
    extensions.conf file:
    ; these are used for the ring_all function in VICIDIAL
    exten => _8331.,1,Playback(sip-silence) exten => _8331.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
    exten => _8331.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN}) exten => _8331.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
    exten => _8331*.,n,Hangup
  115. Added ring_all Next Agent Call option for in-groups. This works with on-
    hook agent phones to allow all available agents to have their phones
    ring at the same time, with the first agent to pick up their phone
    receiving the call. It is not recommended to use this on high-volume
    systems or systems with many agents available.
  116. Added DEFER options to the Scheduled Callbacks Alert campaign feature.
    These allow you to stop the blinking of the alert in the agent screen
    after you have viewed the callbacks, but if the number of callbacks
    changes the red and/or blink will start again.
  117. Added add_list and update_list functions to the Non-Agent API, allowing
    you to add, modify and delete lists, as well as reset leads in a list,
    change a list to active or inactive, change the campaign of a list and
    delete the leads inside of a list.
  118. Added Campaign option to auto-pause agents when they go into several
    pre-call functions like Manual Dial, Lead Search, Callbacks Check, etc.
    Also added an option to auto-resume the agent when leaving those
  119. Changed almost all of the browser alerts to HTML alerts. These are the
    messages that tell you for example that you cannot do this when paused.
    The reason for the change is that browser alerts are blocking and will
    halt executiong of javascript on the agent workstation. This change
    should require no alterations to any configurations.
  120. Added recording of Remote Agents calls per recording settings in campaigns.
    If recording is set to ALLCALLS or ALLFORCE then a recording will be
    initiated for the call upon routing to the Remote Agent and will be tied
    to the R/ user and the lead_id. Also works with on-hook enabled. User-
    level recording settings for the start user of the remote agent will
    also be followed.
  121. Added MULTI_LEAD option for Auto-Alt-Dialing. Using MULTI_LEAD allows you
    to use a separate lead for each number on a customer account that all
    share a common vendor_lead_code, and the type of phone number for each
    is defined with a label in the Owner field. This option will disable
    some options on the Modify Campaign screen and show a link to the
    Multi-Alt Settings page which allows you to set which phone number types
    , defined by the label of each lead, will be dialed and in what order.
    This will create a special lead filter and will alter the Rank field of
    all of the leads inside the lists set to this campaign in order to call
    them in the order you have specified.
  122. Added option to use the owner field to define a time zone abbreviation code
    Works across web/api/cli lead loading methods. There is also an option
    in the time zone updating script to use this method.
  123. Added ability to use external_dial Agent API function with a defined
    lead_id and optional alt_dial setting
  124. Added feature to give an alert on manual dial campaigns if the phone number
    area code and the postal code are in different time zones, or if either
    of them are outside of the local call time for the campaign. Viewable in
    preview mode as well as lead info viewing from the callbacks list, the
    call log and search results in the agent interface.
  125. Added utility to synchronize users, remote agents, dids, call menus,
    in-groups and campaigns with entries in QM:
  126. Added Custom 3-Way Button Transfer feature which allows for 3-way calls to
    be placed using one of several lead fields or campaign presets, as well
    as the customer optionally being put on park, and the transfer – conf
    frame being brought up, all at the click of one button on the main agent
  127. Added the agc/phone_only.php script, a web-based web-phone-only client
    application that allows full phone usage without needing to login as an
  128. Added option to Lists to allow you to choose in the List Modification
    screen the method of time zone adjustment that happens nightly on a per
    list basis. COUNTRY_AND_AREA_CODE is the default, and will use the
    country code and area code of the phone number to determine the time
    zone of the lead. POSTAL_CODE will use the postal code if available to
    determine the time zone of the lead. NANPA_PREFIX works only in the USA
    and will use the area code and prefix of the phone number to determine
    the time zone of the lead, but this is not enabled by default in the
    system, so please be sure you have the NANPA prefix data loaded onto
    your system before selecting this option. OWNER_TIME_ZONE_CODE will use
    a standard time zone abbreviation loaded into the owner field of the
    lead to determine the time zone, in the USA examples are AST, EST, CST,
    MST, PST, AKST, HST. This feature does NOT affect the time zone used at
    the moment leads are loaded, that needs to be selected when you are
    loading leads. This feature must be enabled in the crontab for the GMT
    adjust script:
    /usr/share/astguiclient/ –list-settings
  129. Added Available Only Tally Threshold campaign option which allows you to
    set the number of agents below which Available Only Tally will be
    temporarily enabled
  130. Added Auto Dial Level Threshold campaign option which allows you to set a
    minimum number agents that the predictive algorithm will work at. If the
    number of agents falls below the number that you have set, then the
    dial level will go to 1.0 until more agents log in or go into the
    selected state
  131. Change Dial Level Difference Target to work properly with all RATIO and
    ADAPT dial method outbound campaigns. Added a Method option to restrict
    this feature to only calculation of dial level or to affect the calls
    dialed on each dialing engine.
  132. Added ability to have outbound auto-dial campaigns drop to an audio prompt
    or a call menu. Outbound IVR Report added. Added optional logging of
    call menu caller key presses. Lead ID can now be preserved on calls
    coming from auto-dial or in-groups that go through call menus and back
    into an in-group. Call Menu transfer also works from an Outbound Survey.
  133. Added new agent interface alert where manual dial calls will not be allowed
    if the disposition process has not completed. Usually a rare problem on
    systems with networking issues.
  134. Added Callback Days Limit campaign option to allow scheduled callbacks to
    be scheduled only a set number of days from today.
  135. Added ability to disable the Disposition screen on the agent interface.
  136. Added options to define conf file and copy web language
    translation files.
  137. Added Export Leads Report similar to Export Calls Report, but a lead is
    only exported once and with the current status.
  138. Added Agent Screen Labels sub-section of the Admin functions. Allows for
    each campaign to use a different set of labels for the fields on the
    default agent screen.
  139. Added ability to define the agent screen status fields shown to the agent:
    Call ID, Lead ID and List ID
  140. Added HIDDEN and READONLY field types for custom list fields.
  141. Added Outbound Campaign Test Call feature to allow you to place a call from
    the Campaign Detail screen that will go out as if it were an auto-dial
    call. Must be enabled in System Settings.
  142. Added ability to check for USA and Canada valid prefix and areacodes when
    loading leads into the web/cli/api lead loaders
  143. Added ability to use AGENTEXT in AGENTDIRECT in-groups as a way to send
    dropped, no-agent-no-queue and other transferred calls to a specific
    dialplan number per-user defined in the User Custom Five field.
  144. Added last_inbound_call_time and last_inbound_call_finish Next Agent Call
    routing options to in-groups.
  145. Added CSV download option to almost all reports.
  146. Added manual dial agent skip lead logging to the user stats page
  147. Added HIDEBLOB field type for custom list fields
  148. Added options to set the voicemail zone and extra voicemail options for
    each voicemail box in phones and extra voicemail boxes. Also added
    default voicemail zone and timezone settings in the system settings.
    ** **** NOTE **** You might want to add the new zones in the new
    ** voicemail.conf.sample file to your voicemail.conf file
    You must delete the BUILD voicemail file for this feature to work:
    rm -f /etc/asterisk/BUILDvoicemail-vicidial.conf
  149. Added ability to chose the type of callerid sent for inbound ring-agent
    calls in the in-group: GENERIC, INGROUP, CUSTOMER PHONE and a couple
    of combinations of those.
  150. Added NA Call URL feature to campaigns and in-groups. This works like
    dispo call url, but it works only for non-agent handled calls, like
    dropped calls, No Answers, Busy, etc…
  151. Changed MULTI_LEAD Auto-Alt-Dial to use the Auto-Alt-Dial Statuses as set
    in the campaign automatically. If you are using MULTI_LEAD you may need
    to add statuses like DROP, PDROP and others to your campaign’s auto-alt
    dial statuses so that the other leads tied by vendor_lead_code in the
    campaign’s lists are not deactivated.
  152. Added noanswer logging feature to System Settings, will log only auto-dial
    calls that are not answered to a separate table
  153. Added new Team Performance Detail report to the Reports page. This is a
    fairly detailed and database-intensive report that summarizes several
    user-grouped statistics
  154. Added ability to use static audio from dynamic fields in Survey and
    Answering machine messages when using Cepstral TTS
  155. Added the Campaign Status List Report which shows calls broken down by
    status within each list_id for a campaign.
  156. Added update_phone, add_phone_alias, update_phone_alias functions

How to – Optimize your database using the MySQL tuning tool

MySQL tuning

How to – Optimize your database using the MySQL tuning tool

This article will go over how to optimize your database using the mysql-tuning tool included in your extras directory. The great thing about this tool is you can keep using it. You can use it after your initial install all the way through your finished using ViciDial.

MySQL tuning

Step 1 – Change your location to the extras directory

First we need to change our location to the extras directory for astguiclient with the commands below:

cd /usr/src/astguiclient/trunk/extras

Step 2 – Give executable permissions

The file we need to use is and by default it’s not executable, so we need to give it that permission. You can do this simply by typing:

chmod +x

Step 3 – Run the tuner

Now you can run the tuning program by typing:


MySQL tuning

If it tells you that you have an unsupported version of MySQL, copy and paste the code below into a file called


# vim: ts=8
#                                                                       #
#       MySQL performance tuning primer script                          #
#       Writen by: Matthew Montgomery                                   #
#       Report bugs to:  #
#       Inspired by: MySQLARd (        #
#       Version: 1.6-r1         Released: 2011-08-06                    #
#       Licenced under GPLv2                                            #
#                                                                       #

#                                                                       #
#       Usage: ./ [ mode ]                              #
#                                                                       #
#       Available Modes:                                                #
#               all :           perform all checks (default)            #
#               prompt :        prompt for login credintials and socket #
#                               and execution mode                      #
#               mem, memory :   run checks for tunable options which    #
#                               effect memory usage                     #
#               disk, file :    run checks for options which effect     #
#                               i/o performance or file handle limits   #
#               innodb :        run InnoDB checks /* to be improved */  #
#               misc :          run checks for that don't categorise    #
#                               well Slow Queries, Binary logs,         #
#                               Used Connections and Worker Threads     #
#                                                                       #
# Set this socket variable ONLY if you have multiple instances running  #
# or we are unable to find your socket, and you don't want to to be     #
# prompted for input each time you run this script.                     #
#                                                                       #

export black='\033[0m'
export boldblack='\033[1;0m'
export red='\033[31m'
export boldred='\033[1;31m'
export green='\033[32m'
export boldgreen='\033[1;32m'
export yellow='\033[33m'
export boldyellow='\033[1;33m'
export blue='\033[34m'
export boldblue='\033[1;34m'
export magenta='\033[35m'
export boldmagenta='\033[1;35m'
export cyan='\033[36m'
export boldcyan='\033[1;36m'
export white='\033[37m'
export boldwhite='\033[1;37m'

cecho ()

## -- Function to easliy print colored text -- ##

        # Color-echo.
        # Argument $1 = message
        # Argument $2 = color
local default_msg="No message passed."

message=${1:-$default_msg}      # Defaults to default message.

#change it for fun
#We use pure names
color=${2:-black}               # Defaults to black, if not specified.

case $color in
                 printf "$black" ;;
                 printf "$boldblack" ;;
                 printf "$red" ;;
                 printf "$boldred" ;;
                 printf "$green" ;;
                 printf "$boldgreen" ;;
                 printf "$yellow" ;;
                 printf "$boldyellow" ;;
                 printf "$blue" ;;
                 printf "$boldblue" ;;
                 printf "$magenta" ;;
                 printf "$boldmagenta" ;;
                 printf "$cyan" ;;
                 printf "$boldcyan" ;;
                 printf "$white" ;;
                 printf "$boldwhite" ;;
  printf "%s\n"  "$message"
  tput sgr0                     # Reset to normal.
  printf "$black"


cechon ()

## -- Function to easliy print colored text -- ##

        # Color-echo.
        # Argument $1 = message
        # Argument $2 = color
local default_msg="No message passed."
                                # Doesn't really need to be a local variable.

message=${1:-$default_msg}      # Defaults to default message.

#change it for fun
#We use pure names
color=${2:-black}               # Defaults to black, if not specified.

case $color in
                printf "$black" ;;
                printf "$boldblack" ;;
                printf "$red" ;;
                printf "$boldred" ;;
                printf "$green" ;;
                printf "$boldgreen" ;;
                printf "$yellow" ;;
                printf "$boldyellow" ;;
                printf "$blue" ;;
                printf "$boldblue" ;;
                printf "$magenta" ;;
                printf "$boldmagenta" ;;
                printf "$cyan" ;;
                printf "$boldcyan" ;;
                printf "$white" ;;
                printf "$boldwhite" ;;
  printf "%s"  "$message"
  tput sgr0                     # Reset to normal.
  printf "$black"


print_banner () {

## -- Banner -- ##

cecho "      - By: Matthew Montgomery -" black


## -- Find the location of the mysql.sock file -- ##

check_for_socket () {
        if [ -z "$socket" ] ; then
                # Use ~/my.cnf version
                if [ -f ~/.my.cnf ] ; then
                        cnf_socket=$(grep ^socket ~/.my.cnf | awk -F \= '{ print $2 }' | head -1)
                if [ -S "$cnf_socket" ] ; then
                elif [ -S /var/lib/mysql/mysql.sock ] ; then
                elif [ -S /var/run/mysqld/mysqld.sock ] ; then
                elif [ -S /tmp/mysql.sock ] ; then
                        if [ -S "$ps_socket" ] ; then
        if [ -S "$socket" ] ; then
                echo UP > /dev/null
                cecho "No valid socket file \"$socket\" found!" boldred
                cecho "The mysqld process is not running or it is installed in a custom location." red
                cecho "If you are sure mysqld is running, execute script in \"prompt\" mode or set " red
                cecho "the socket= variable at the top of this script" red
                exit 1

check_for_plesk_passwords () {

## -- Check for the existance of plesk and login using it's credentials -- ##

        if [ -f /etc/psa/.psa.shadow ] ; then
                mysql="mysql -S $socket -u admin -p$(cat /etc/psa/.psa.shadow)"
                mysqladmin="mysqladmin -S $socket -u admin -p$(cat /etc/psa/.psa.shadow)"
                # mysql="mysql -S $socket"
                # mysqladmin="mysqladmin -S $socket"

check_mysql_login () {

## -- Test for running mysql -- ##

        is_up=$($mysqladmin ping 2>&1)
        if [ "$is_up" = "mysqld is alive" ] ; then
                echo UP > /dev/null
                # echo $is_up
        elif [ "$is_up" != "mysqld is alive" ] ; then
                printf "\n"
                cecho "Using login values from ~/.my.cnf"
                cecho "- INITIAL LOGIN ATTEMPT FAILED -" boldred
                if [ -z $prompted ] ; then
                        return 1

                cecho "Unknow exit status" red
                exit -1

final_login_attempt () {
        is_up=$($mysqladmin ping 2>&1)
        if [ "$is_up" = "mysqld is alive" ] ; then
                echo UP > /dev/null
        elif [ "$is_up" != "mysqld is alive" ] ; then
                cecho "- FINAL LOGIN ATTEMPT FAILED -" boldred
                cecho "Unable to log into socket: $socket" boldred
                exit 1

second_login_failed () {

## -- create a ~/.my.cnf and exit when all else fails -- ##

        cecho "Could not auto detect login info!"
        cecho "Found potential sockets: $found_socks"
        cecho "Using: $socket" red
        read -p "Would you like to provide a different socket?: [y/N] " REPLY
                case $REPLY in
                        yes | y | Y | YES)
                        read -p "Socket: " socket
        read -p "Do you have your login handy ? [y/N] : " REPLY
        case $REPLY in
                yes | y | Y | YES)
                read -p "User: " user
                read -rp "Password: " pass
                if [ -z $pass ] ; then
                export mysql="$mysql -S$socket -u$user"
                export mysqladmin="$mysqladmin -S$socket -u$user"
                export mysql="$mysql -S$socket -u$user -p$pass"
                export mysqladmin="$mysqladmin -S$socket -u$user -p$pass"
                cecho "Please create a valid login to MySQL"
                cecho "Or, set correct values for  'user=' and 'password=' in ~/.my.cnf"
        cecho " "
        read -p "Would you like me to create a ~/.my.cnf file for you? [y/N] : " REPLY
        case $REPLY in
                yes | y | Y | YES)
                if [ ! -f ~/.my.cnf ] ; then
                        umask 077
                        printf "[client]\nuser=$user\npassword=$pass\nsocket=$socket" > ~/.my.cnf
                        if [ "$answer1" != 'yes' ] ; then
                                exit 1
                                return 0
                        printf "\n"
                        cecho "~/.my.cnf already exists!" boldred
                        printf "\n"
                        read -p "Replace ? [y/N] : " REPLY
                        if [ "$REPLY" = 'y' ] || [ "$REPLY" = 'Y' ] ; then
                        printf "[client]\nuser=$user\npassword=$pass\socket=$socket" > ~/.my.cnf
                                if [ "$answer1" != 'yes' ] ; then
                                        exit 1
                                        return 0
                                cecho "Please set the 'user=' and 'password=' and 'socket=' values in ~/.my.cnf"
                                exit 1
                if [ "$answer1" != 'yes' ] ; then
                        exit 1
                        return 0

find_webmin_passwords () {

## -- populate the .my.cnf file using values harvested from Webmin -- ##

        cecho "Testing for stored webmin passwords:"
        if [ -f /etc/webmin/mysql/config ] ; then
                user=$(grep ^login= /etc/webmin/mysql/config | cut -d "=" -f 2)
                pass=$(grep ^pass= /etc/webmin/mysql/config | cut -d "=" -f 2)
                if [  $user ] && [ $pass ] && [ ! -f ~/.my.cnf  ] ; then
                        cecho "Setting login info as User: $user Password: $pass"
                        touch ~/.my.cnf
                        chmod 600 ~/.my.cnf
                        printf "[client]\nuser=$user\npassword=$pass" > ~/.my.cnf
                        cecho "Retrying login"
                        is_up=$($mysqladmin ping 2>&1)
                        if [ "$is_up" = "mysqld is alive"  ] ; then
                                echo UP > /dev/null
        cecho " None Found" boldred

#                                                                       #
#  Function to pull MySQL status variable                               #
#                                                                       #
#  Call using :                                                         #
#       mysql_status \'Mysql_status_variable\' bash_dest_variable       #
#                                                                       #

mysql_status () {
        local status=$($mysql -Bse "show /*!50000 global */ status like $1" | awk '{ print $2 }')
        export "$2"=$status

#                                                                       #
#  Function to pull MySQL server runtime variable                       #
#                                                                       #
#  Call using :                                                         #
#       mysql_variable \'Mysql_server_variable\' bash_dest_variable     #
#       - OR -                                                          #
#       mysql_variableTSV \'Mysql_server_variable\' bash_dest_variable  #
#                                                                       #

mysql_variable () {
        local variable=$($mysql -Bse "show /*!50000 global */ variables like $1" | awk '{ print $2 }')
        export "$2"=$variable
mysql_variableTSV () {
        local variable=$($mysql -Bse "show /*!50000 global */ variables like $1" | awk -F \t '{ print $2 }')
        export "$2"=$variable

float2int () {
        local variable=$(echo "$1 / 1" | bc -l)
        export "$2"=$variable

divide () {

# -- Divide two intigers -- #

        usage="$0 dividend divisor '$variable' scale"
        if [ $1 -ge 1 ] ; then
                cecho "Invalid Dividend" red
                echo $usage
                exit 1
        if [ $2 -ge 1 ] ; then
                cecho "Invalid Divisor" red
                echo $usage
                exit 1
        if [ ! -n $3 ] ; then
                cecho "Invalid variable name" red
                echo $usage
                exit 1
        if [ -z $4 ] ; then
        elif [ $4 -ge 0 ] ; then
                cecho "Invalid scale" red
                echo $usage
                exit 1
        export $3=$(echo "scale=$scale; $dividend / $divisor" | bc -l)

human_readable () {

#                                                                       #
#  Convert a value in to human readable size and populate a variable    #
#  with the result.                                                     #
#                                                                       #
#  Call using:                                                          #
#       human_readable $value 'variable name' [ places of precision]    #
#                                                                       #

        ## value=$1
        ## variable=$2

        if [ $1 -ge 1073741824 ] ; then
                if [ -z $3 ] ; then
                divide $1 1073741824 "$2" $scale
        elif [ $1 -ge 1048576 ] ; then
                if [ -z $3 ] ; then
                divide $1 1048576 "$2" $scale
        elif [ $1 -ge 1024 ] ; then
                if [ -z $3 ] ; then
                divide $1 1024 "$2" $scale
                export "$2"=$1
        # let "$2"=$HR

human_readable_time () {

#                                                                      #
#       Function to produce human readable time                        #
#                                                                      #

        usage="$0 seconds 'variable'"
        if [ -z $1 ] || [ -z $2 ] ; then
                cecho $usage red
                exit 1
        days=$(echo "scale=0 ; $1 / 86400" | bc -l)
        remainder=$(echo "scale=0 ; $1 % 86400" | bc -l)
        hours=$(echo "scale=0 ; $remainder / 3600" | bc -l)
        remainder=$(echo "scale=0 ; $remainder % 3600" | bc -l)
        minutes=$(echo "scale=0 ; $remainder / 60" | bc -l)
        seconds=$(echo "scale=0 ; $remainder % 60" | bc -l)
        export $2="$days days $hours hrs $minutes min $seconds sec"

check_mysql_version () {

## -- Print Version Info -- ##

        mysql_variable \'version\' mysql_version
        mysql_variable \'version_compile_machine\' mysql_version_compile_machine

if [ "$mysql_version_num" -lt 050000 ]; then
        cecho "MySQL Version $mysql_version $mysql_version_compile_machine is EOL please upgrade to MySQL 4.1 or later" boldred
        cecho "MySQL Version $mysql_version $mysql_version_compile_machine"


post_uptime_warning () {

#                                                                       #
#  Present a reminder that mysql must run for a couple of days to       #
#  build up good numbers in server status variables before these tuning #
#  suggestions should be used.                                          #
#                                                                       #

        mysql_status \'Uptime\' uptime
        mysql_status \'Threads_connected\' threads
        human_readable_time $uptime uptimeHR

        cecho "Uptime = $uptimeHR"
        cecho "Avg. qps = $queries_per_sec"
        cecho "Total Questions = $questions"
        cecho "Threads Connected = $threads"

        if [ $uptime -gt 172800 ] ; then
                cecho "Server has been running for over 48hrs."
                cecho "It should be safe to follow these recommendations"
                cechon "Warning: " boldred
                cecho "Server has not been running for at least 48hrs." boldred
                cecho "It may not be safe to use these recommendations" boldred

        echo ""
        cecho "To find out more information on how each of these" red
        cecho "runtime variables effects performance visit:" red
        if [ "$major_version" = '3.23' ] || [ "$major_version" = '4.0' ] || [ "$major_version" = '4.1' ] ; then
        cecho "" boldblue
        elif [ "$major_version" = '5.0' ] || [ "$mysql_version_num" -gt '050100' ]; then
        cecho "$major_version/en/server-system-variables.html" boldblue
        cecho "UNSUPPORTED MYSQL VERSION" boldred
        exit 1
        cecho "Visit" boldblue
        cecho "for info about MySQL's Enterprise Monitoring and Advisory Service" boldblue

check_slow_queries () {

## -- Slow Queries -- ##

        cecho "SLOW QUERIES" boldblue

        mysql_status \'Slow_queries\' slow_queries
        mysql_variable \'long_query_time\' long_query_time
        mysql_variable \'log%queries\' log_slow_queries

        if [ -e /etc/my.cnf ] ; then
                if [ -z $log_slow_queries ] ; then
                        log_slow_queries=$(grep log-slow-queries /etc/my.cnf)

        if [ "$log_slow_queries" = 'ON' ] ; then
                cecho "The slow query log is enabled."
        elif [ "$log_slow_queries" = 'OFF' ] ; then
                cechon "The slow query log is "
                cechon "NOT" boldred
                cecho " enabled."
        elif [ -z $log_slow_queries ] ; then
                cechon "The slow query log is "
                cechon "NOT" boldred
                cecho " enabled."
                cecho "Error: $log_slow_queries" boldred
        cecho "Current long_query_time = $long_query_time sec."
        cechon "You have "
        cechon "$slow_queries" boldred
        cechon " out of "
        cechon "$questions" boldred
        cecho " that take longer than $long_query_time sec. to complete"

        float2int long_query_time long_query_timeInt

        if [ $long_query_timeInt -gt $prefered_query_time ] ; then
                cecho "Your long_query_time may be too high, I typically set this under $prefered_query_time sec." red
                cecho "Your long_query_time seems to be fine" green


check_binary_log () {

## -- Binary Log -- ##

        cecho "BINARY UPDATE LOG" boldblue

        mysql_variable \'log_bin\' log_bin
        mysql_variable \'max_binlog_size\' max_binlog_size
        mysql_variable \'expire_logs_days\' expire_logs_days
        mysql_variable \'sync_binlog\' sync_binlog
        #  mysql_variable \'max_binlog_cache_size\' max_binlog_cache_size

        if [ "$log_bin" = 'ON' ] ; then
                cecho "The binary update log is enabled"
                if [ -z "$max_binlog_size" ] ; then
                        cecho "The max_binlog_size is not set. The binary log will rotate when it reaches 1GB." red
                if [ "$expire_logs_days" -eq 0 ] ; then
                        cecho "The expire_logs_days is not set." boldred
                        cechon "The mysqld will retain the entire binary log until " red
                        cecho "RESET MASTER or PURGE MASTER LOGS commands are run manually" red
                        cecho "Setting expire_logs_days will allow you to remove old binary logs automatically"  yellow
                        cecho "See$major_version/en/purge-master-logs.html" yellow
                if [ "$sync_binlog" = 0 ] ; then
                        cecho "Binlog sync is not enabled, you could loose binlog records during a server crash" red
                cechon "The binary update log is "
                cechon "NOT " boldred
                cecho "enabled."
                cecho "You will not be able to do point in time recovery" red
                cecho "See$major_version/en/point-in-time-recovery.html" yellow

check_used_connections () {

## -- Used Connections -- ##

        mysql_variable \'max_connections\' max_connections
        mysql_status \'Max_used_connections\' max_used_connections
        mysql_status \'Threads_connected\' threads_connected


        cecho "MAX CONNECTIONS" boldblue
        cecho "Current max_connections = $max_connections"
        cecho "Current threads_connected = $threads_connected"
        cecho "Historic max_used_connections = $max_used_connections"
        cechon "The number of used connections is "
        if [ $connections_ratio -ge 85 ] ; then
        elif [ $connections_ratio -le 10 ] ; then
        # cechon "$max_used_connections " $txt_color
        # cechon "which is "
        cechon "$connections_ratio% " $txt_color
        cecho "of the configured maximum."

        if [ $error -eq 1 ] ; then
                cecho "You should raise max_connections" $txt_color
        elif [ $error -eq 2 ] ; then
                cecho "You are using less than 10% of your configured max_connections." $txt_color
                cecho "Lowering max_connections could help to avoid an over-allocation of memory" $txt_color
                cecho "See \"MEMORY USAGE\" section to make sure you are not over-allocating" $txt_color
                cecho "Your max_connections variable seems to be fine." $txt_color
        unset txt_color

check_threads() {

## -- Worker Threads -- ##

        cecho "WORKER THREADS" boldblue

        mysql_status \'Threads_created\' threads_created1
        sleep 1
        mysql_status \'Threads_created\' threads_created2

        mysql_status \'Threads_cached\' threads_cached
        mysql_status \'Uptime\' uptime
        mysql_variable \'thread_cache_size\' thread_cache_size


        cecho "Current thread_cache_size = $thread_cache_size"
        cecho "Current threads_cached = $threads_cached"
        cecho "Current threads_per_sec = $current_threads_per_sec"
        cecho "Historic threads_per_sec = $historic_threads_per_sec"

        if [ $historic_threads_per_sec -ge 2 ] && [ $threads_cached -le 1 ] ; then
                cecho "Threads created per/sec are overrunning threads cached" red
                cecho "You should raise thread_cache_size" red
        elif [ $current_threads_per_sec -ge 2 ] ; then
                cecho "Threads created per/sec are overrunning threads cached" red
                cecho "You should raise thread_cache_size" red
                cecho "Your thread_cache_size is fine" green

check_key_buffer_size () {

## -- Key buffer Size -- ##

        cecho "KEY BUFFER" boldblue

        mysql_status \'Key_read_requests\' key_read_requests
        mysql_status \'Key_reads\' key_reads
        mysql_status \'Key_blocks_used\' key_blocks_used
        mysql_status \'Key_blocks_unused\' key_blocks_unused
        mysql_variable \'key_cache_block_size\' key_cache_block_size
        mysql_variable \'key_buffer_size\' key_buffer_size
        mysql_variable \'datadir\' datadir
        mysql_variable \'version_compile_machine\' mysql_version_compile_machine
        myisam_indexes=$($mysql -Bse "/*!50000 SELECT IFNULL(SUM(INDEX_LENGTH),0) from information_schema.TABLES where ENGINE='MyISAM' */")

        if [ -z $myisam_indexes ] ; then
                myisam_indexes=$(find $datadir -name '*.MYI' -exec du $duflags '{}' \; 2>&1 | awk '{ s += $1 } END { printf("%.0f\n", s )}')

        if [ $key_reads -eq 0 ] ; then
                cecho "No key reads?!" boldred
                cecho "Seriously look into using some indexes" red
                key_buffer_free=$(echo "$key_blocks_unused * $key_cache_block_size / $key_buffer_size * 100" | bc -l )
                key_buffer_freeRND=$(echo "scale=0; $key_buffer_free / 1" | bc -l)
                if [ ! -z $key_blocks_unused ] ; then
                        key_buffer_free=$(echo "$key_blocks_unused * $key_cache_block_size / $key_buffer_size * 100" | bc -l )
                        key_buffer_freeRND=$(echo "scale=0; $key_buffer_free / 1" | bc -l)

        human_readable $myisam_indexes myisam_indexesHR
        cecho "Current MyISAM index space = $myisam_indexesHR $unit"

        human_readable  $key_buffer_size key_buffer_sizeHR
        cecho "Current key_buffer_size = $key_buffer_sizeHR $unit"
        cecho "Key cache miss rate is 1 : $key_cache_miss_rate"
        cecho "Key buffer free ratio = $key_buffer_freeRND %"

        if [ "$major_version" = '5.1' ] && [ $mysql_version_num -lt 050123 ] ; then
                if [ $key_buffer_size -ge 4294967296 ] && ( echo "x86_64 ppc64 ia64 sparc64 i686" | grep -q $mysql_version_compile_machine ) ; then
                        cecho "Using key_buffer_size > 4GB will cause instability in versions prior to 5.1.23 " boldred
                        cecho "See Bug#5731, Bug#29419, Bug#29446" boldred
        if [ "$major_version" = '5.0' ] && [ $mysql_version_num -lt 050052 ] ; then
                if [ $key_buffer_size -ge 4294967296 ] && ( echo "x86_64 ppc64 ia64 sparc64 i686" | grep -q $mysql_version_compile_machine ) ; then
                        cecho "Using key_buffer_size > 4GB will cause instability in versions prior to 5.0.52 " boldred
                        cecho "See Bug#5731, Bug#29419, Bug#29446" boldred
        if [ "$major_version" = '4.1' -o "$major_version" = '4.0' ] && [ $key_buffer_size -ge 4294967296 ] && ( echo "x86_64 ppc64 ia64 sparc64 i686" | grep -q $mysql_version_compile_machine ) ; then
                cecho "Using key_buffer_size > 4GB will cause instability in versions prior to 5.0.52 " boldred
                cecho "Reduce key_buffer_size to a safe value" boldred
                cecho "See Bug#5731, Bug#29419, Bug#29446" boldred

        if [ $key_cache_miss_rate -le 100 ] && [ $key_cache_miss_rate -gt 0 ] && [ $key_buffer_freeRND -le 20 ]; then
                cecho "You could increase key_buffer_size" boldred
                cecho "It is safe to raise this up to 1/4 of total system memory;"
                cecho "assuming this is a dedicated database server."
        elif [ $key_buffer_freeRND -le 20 ] && [ $key_buffer_size -le $myisam_indexes ] ; then
                cecho "You could increase key_buffer_size" boldred
                cecho "It is safe to raise this up to 1/4 of total system memory;"
                cecho "assuming this is a dedicated database server."
        elif [ $key_cache_miss_rate -ge 10000 ] || [ $key_buffer_freeRND -le 50  ] ; then
                cecho "Your key_buffer_size seems to be too high." red
                cecho "Perhaps you can use these resources elsewhere" red
                cecho "Your key_buffer_size seems to be fine" green

check_query_cache () {

## -- Query Cache -- ##

        cecho "QUERY CACHE" boldblue

        mysql_variable \'version\' mysql_version
        mysql_variable \'query_cache_size\' query_cache_size
        mysql_variable \'query_cache_limit\' query_cache_limit
        mysql_variable \'query_cache_min_res_unit\' query_cache_min_res_unit
        mysql_status \'Qcache_free_memory\' qcache_free_memory
        mysql_status \'Qcache_total_blocks\' qcache_total_blocks
        mysql_status \'Qcache_free_blocks\' qcache_free_blocks
        mysql_status \'Qcache_lowmem_prunes\' qcache_lowmem_prunes

        if [ -z $query_cache_size ] ; then
                cecho "You are using MySQL $mysql_version, no query cache is supported." red
                cecho "I recommend an upgrade to MySQL 4.1 or better" red
        elif [ $query_cache_size -eq 0 ] ; then
                cecho "Query cache is supported but not enabled" red
                cecho "Perhaps you should set the query_cache_size" red
                qcache_mem_fill_ratio=$(echo "scale=2; $qcache_used_memory * 100 / $query_cache_size" | bc -l)
                qcache_mem_fill_ratioHR=$(echo "scale=0; $qcache_mem_fill_ratio / 1" | bc -l)

                cecho "Query cache is enabled" green
                human_readable $query_cache_size query_cache_sizeHR
                cecho "Current query_cache_size = $query_cache_sizeHR $unit"
                human_readable $qcache_used_memory qcache_used_memoryHR
                cecho "Current query_cache_used = $qcache_used_memoryHR $unit"
                human_readable $query_cache_limit query_cache_limitHR
                cecho "Current query_cache_limit = $query_cache_limitHR $unit"
                cecho "Current Query cache Memory fill ratio = $qcache_mem_fill_ratio %"
                if [ -z $query_cache_min_res_unit ] ; then
                        cecho "No query_cache_min_res_unit is defined.  Using MySQL < 4.1 cache fragmentation can be inpredictable" %yellow
                        human_readable $query_cache_min_res_unit query_cache_min_res_unitHR
                        cecho "Current query_cache_min_res_unit = $query_cache_min_res_unitHR $unit"
                if [ $qcache_free_blocks -gt 2 ] && [ $qcache_total_blocks -gt 0 ] ; then
                        qcache_percent_fragmented=$(echo "scale=2; $qcache_free_blocks * 100 / $qcache_total_blocks" | bc -l)
                        qcache_percent_fragmentedHR=$(echo "scale=0; $qcache_percent_fragmented / 1" | bc -l)
                        if [ $qcache_percent_fragmentedHR -gt 20 ] ; then
                                cecho "Query Cache is $qcache_percent_fragmentedHR % fragmented" red
                                cecho "Run \"FLUSH QUERY CACHE\" periodically to defragment the query cache memory" red
                                cecho "If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation." red

                if [ $qcache_mem_fill_ratioHR -le 25 ] ; then
                        cecho "Your query_cache_size seems to be too high." red
                        cecho "Perhaps you can use these resources elsewhere" red
                if [ $qcache_lowmem_prunes -ge 50 ] && [ $qcache_mem_fill_ratioHR -ge 80 ]; then
                        cechon "However, "
                        cechon "$qcache_lowmem_prunes " boldred
                        cecho "queries have been removed from the query cache due to lack of memory"
                        cecho "Perhaps you should raise query_cache_size" boldred
                cecho "MySQL won't cache query results that are larger than query_cache_limit in size" yellow


check_sort_operations () {

## -- Sort Operations -- ##

        cecho "SORT OPERATIONS" boldblue

        mysql_status \'Sort_merge_passes\' sort_merge_passes
        mysql_status \'Sort_scan\' sort_scan
        mysql_status \'Sort_range\' sort_range
        mysql_variable \'sort_buffer%\' sort_buffer_size
        mysql_variable \'read_rnd_buffer_size\' read_rnd_buffer_size

        if [ -z $read_rnd_buffer_size ] ; then
                mysql_variable \'record_buffer\' read_rnd_buffer_size

        ## Correct for rounding error in mysqld where 512K != 524288 ##

        human_readable $sort_buffer_size sort_buffer_sizeHR
        cecho "Current sort_buffer_size = $sort_buffer_sizeHR $unit"

        human_readable $read_rnd_buffer_size read_rnd_buffer_sizeHR
        cechon "Current "
        if [ "$major_version" = '3.23' ] ; then
                cechon "record_rnd_buffer "
                cechon "read_rnd_buffer_size "
        cecho "= $read_rnd_buffer_sizeHR $unit"

        if [ $total_sorts -eq 0 ] ; then
                cecho "No sort operations have been performed"
        if [ $sort_merge_passes -ne 0 ] ; then

        if [ $passes_per_sort -ge 2 ] ; then
                cechon "On average "
                cechon "$passes_per_sort " boldred
                cecho "sort merge passes are made per sort operation"
                cecho "You should raise your sort_buffer_size"
                cechon "You should also raise your "
                if [ "$major_version" = '3.23' ] ; then
                        cecho "record_rnd_buffer_size"
                        cecho "read_rnd_buffer_size"
                cecho "Sort buffer seems to be fine" green

check_join_operations () {

## -- Joins -- ##

        cecho "JOINS" boldblue

        mysql_status \'Select_full_join\' select_full_join
        mysql_status \'Select_range_check\' select_range_check
        mysql_variable \'join_buffer%\' join_buffer_size

        ## Some 4K is dropped from join_buffer_size adding it back to make sane ##
        ## handling of human-readable conversion ##


        human_readable $join_buffer_size join_buffer_sizeHR 2

        cecho "Current join_buffer_size = $join_buffer_sizeHR $unit"
        cecho "You have had $select_full_join queries where a join could not use an index properly"

        if [ $select_range_check -eq 0 ] && [ $select_full_join -eq 0 ] ; then
                cecho "Your joins seem to be using indexes properly" green
        if [ $select_full_join -gt 0 ] ; then
        if [ $select_range_check -gt 0 ] ; then
                cecho "You have had $select_range_check joins without keys that check for key usage after each row" red

        ## For Debuging ##
        # print_error='true'
        if [ $join_buffer_size -ge 4194304 ] ; then
                cecho "join_buffer_size >= 4 M" boldred
                cecho "This is not advised" boldred

        if [ $print_error ] ; then
                if [ "$major_version" = '3.23' ] || [ "$major_version" = '4.0' ] ; then
                        cecho "You should enable \"log-long-format\" "
                elif [ "$mysql_version_num" -gt 040100 ]; then
                        cecho "You should enable \"log-queries-not-using-indexes\""
                cecho "Then look for non indexed joins in the slow query log."
                if [ $raise_buffer ] ; then
                cecho "If you are unable to optimize your queries you may want to increase your"
                cecho "join_buffer_size to accommodate larger joins in one pass."
                printf "\n"
                cecho "Note! This script will still suggest raising the join_buffer_size when" boldred
                cecho "ANY joins not using indexes are found." boldred

        # XXX Add better tests for join_buffer_size pending mysql bug #15088  XXX #

check_tmp_tables () {

## -- Temp Tables -- ##

        cecho "TEMP TABLES" boldblue

        mysql_status \'Created_tmp_tables\' created_tmp_tables
        mysql_status \'Created_tmp_disk_tables\' created_tmp_disk_tables
        mysql_variable \'tmp_table_size\' tmp_table_size
        mysql_variable \'max_heap_table_size\' max_heap_table_size

        if [ $created_tmp_tables -eq 0 ] ; then
        human_readable $max_heap_table_size max_heap_table_sizeHR
        cecho "Current max_heap_table_size = $max_heap_table_sizeHR $unit"

        human_readable $tmp_table_size tmp_table_sizeHR
        cecho "Current tmp_table_size = $tmp_table_sizeHR $unit"

        cecho "Of $created_tmp_tables temp tables, $tmp_disk_tables% were created on disk"
        if [ $tmp_table_size -gt $max_heap_table_size ] ; then
                cecho "Effective in-memory tmp_table_size is limited to max_heap_table_size." yellow
        if [ $tmp_disk_tables -ge 25 ] ; then
                cecho "Perhaps you should increase your tmp_table_size and/or max_heap_table_size" boldred
                cecho "to reduce the number of disk-based temporary tables" boldred
                cecho "Note! BLOB and TEXT columns are not allow in memory tables." yellow
                cecho "If you are using these columns raising these values might not impact your " yellow
                cecho  "ratio of on disk temp tables." yellow
                cecho "Created disk tmp tables ratio seems fine" green

check_open_files () {

## -- Open Files Limit -- ##
        cecho "OPEN FILES LIMIT" boldblue

        mysql_variable \'open_files_limit\' open_files_limit
        mysql_status   \'Open_files\' open_files

        if [ -z $open_files_limit ] || [ $open_files_limit -eq 0 ] ; then
                open_files_limit=$(ulimit -n)
        cecho "Current open_files_limit = $open_files_limit files"


        cecho "The open_files_limit should typically be set to at least 2x-3x" yellow
        cecho "that of table_cache if you have heavy MyISAM usage." yellow
        if [ $open_files_ratio -ge 75 ] ; then
                cecho "You currently have open more than 75% of your open_files_limit" boldred
                if [ $cant_override -eq 1 ] ; then
                        cecho "You should set a higer value for ulimit -u in the mysql startup script then restart mysqld" boldred
                        cecho "MySQL 3.23 users : This is just a guess based upon the current shell's ulimit -u value" yellow
                elif [ $cant_override -eq 0 ] ; then
                        cecho "You should set a higher value for open_files_limit in my.cnf" boldred
                        cecho "ERROR can't determine if mysqld override of ulimit is allowed" boldred
                        exit 1
                cecho "Your open_files_limit value seems to be fine" green


check_table_cache () {

## -- Table Cache -- ##

        cecho "TABLE CACHE" boldblue

        mysql_variable \'datadir\' datadir
        mysql_variable \'table_cache\' table_cache

        ## /* MySQL +5.1 version of table_cache */ ##
        mysql_variable \'table_open_cache\' table_open_cache
        mysql_variable \'table_definition_cache\' table_definition_cache

        mysql_status \'Open_tables\' open_tables
        mysql_status \'Opened_tables\' opened_tables
        mysql_status \'Open_table_definitions\' open_table_definitions

        table_count=$($mysql -Bse "/*!50000 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' */")

        if [ -z "$table_count" ] ; then
                if [ "$UID" != "$socket_owner" ] && [ "$UID" != "0" ] ; then
                        cecho "You are not '$socket_owner' or 'root'" red
                        cecho "I am unable to determine the table_count!" red
                        table_count=$(find $datadir 2>&1 | grep -c .frm$)
        if [ $table_open_cache ] ; then

        if [ $opened_tables -ne 0 ] && [ $table_cache -ne 0 ] ; then
        elif [ $opened_tables -eq 0 ] && [ $table_cache -ne 0 ] ; then
                cecho "ERROR no table_cache ?!" boldred
                exit 1
        if [ $table_cache ] && [ ! $table_open_cache ] ; then
                cecho "Current table_cache value = $table_cache tables"
        if [ $table_open_cache ] ; then
                cecho "Current table_open_cache = $table_open_cache tables"
                cecho "Current table_definition_cache = $table_definition_cache tables"
        if [ $table_count ] ; then
        cecho "You have a total of $table_count tables"

        if  [ $table_cache_fill -lt 95 ] ; then
                cechon "You have "
                cechon "$open_tables " green
                cecho "open tables."
                cecho "The table_cache value seems to be fine" green
        elif [ $table_cache_hit_rate -le 85 -o  $table_cache_fill -ge 95 ]; then
                cechon "You have "
                cechon "$open_tables " boldred
                cecho "open tables."
                cechon "Current table_cache hit rate is "
                cecho "$table_cache_hit_rate%" boldred
                cechon ", while "
                cechon "$table_cache_fill% " boldred
                cecho "of your table cache is in use"
                cecho "You should probably increase your table_cache" red
                cechon "Current table_cache hit rate is "
                cechon "$table_cache_hit_rate%" green
                cechon ", while "
                cechon "$table_cache_fill% " green
                cecho "of your table cache is in use"
                cecho "The table cache value seems to be fine" green
        if [ $table_definition_cache ] && [ $table_definition_cache -le $table_count ] && [ $table_count -ge 100 ] ; then
                cecho "You should probably increase your table_definition_cache value." red

check_table_locking () {

## -- Table Locking -- ##

        cecho "TABLE LOCKING" boldblue

        mysql_status \'Table_locks_waited\' table_locks_waited
        mysql_status \'Table_locks_immediate\' table_locks_immediate
        mysql_variable \'concurrent_insert\' concurrent_insert
        mysql_variable \'low_priority_updates\' low_priority_updates
        if [ "$concurrent_insert" = 'ON' ]; then
        elif [ "$concurrent_insert" = 'OFF' ]; then

        cechon "Current Lock Wait ratio = "
        if [ $table_locks_waited -gt 0 ]; then
                cecho "1 : $immediate_locks_miss_rate" red
                immediate_locks_miss_rate=99999 # perfect
                cecho "0 : $questions"
        if [ $immediate_locks_miss_rate -lt 5000 ] ; then
                cecho "You may benefit from selective use of InnoDB."
                if [ "$low_priority_updates" = 'OFF' ] ; then
                cecho "If you have long running SELECT's against MyISAM tables and perform"
                cecho "frequent updates consider setting 'low_priority_updates=1'"
                if [ "$mysql_version_num" -gt 050000 ] && [ "$mysql_version_num" -lt 050500 ]; then
                        if [ $concurrent_insert -le 1 ] ; then
                        cecho "If you have a high concurrency of inserts on Dynamic row-length tables"
                        cecho "consider setting 'concurrent_insert=2'."
                elif [ "$mysql_version_num" -gt 050500 ] ; then
                        if [ "$concurrent_insert" = 'AUTO' ] || [ "$concurrent_insert" = 'NEVER' ] ; then
                        cecho "If you have a high concurrency of inserts on Dynamic row-length tables"
                        cecho "consider setting 'concurrent_insert=ALWAYS'."
                cecho "Your table locking seems to be fine" green

check_table_scans () {

## -- Table Scans -- ##

        cecho "TABLE SCANS" boldblue

        mysql_status \'Com_select\' com_select
        mysql_status \'Handler_read_rnd_next\' read_rnd_next
        mysql_variable \'read_buffer_size\' read_buffer_size

        if [ -z $read_buffer_size ] ; then
                mysql_variable \'record_buffer\' read_buffer_size

        human_readable $read_buffer_size read_buffer_sizeHR
        cecho "Current read_buffer_size = $read_buffer_sizeHR $unit"

        if [ $com_select -gt 0 ] ; then
                cecho "Current table scan ratio = $full_table_scans : 1"
                if [ $full_table_scans -ge 4000 ] && [ $read_buffer_size -le 2097152 ] ; then
                        cecho "You have a high ratio of sequential access requests to SELECTs" red
                        cechon "You may benefit from raising " red
                        if [ "$major_version" = '3.23' ] ; then
                                cechon "record_buffer " red
                                cechon "read_buffer_size " red
                        cecho "and/or improving your use of indexes." red
                elif [ $read_buffer_size -gt 8388608 ] ; then
                        cechon "read_buffer_size is over 8 MB " red
                        cecho "there is probably no need for such a large read_buffer" red

                        cecho "read_buffer_size seems to be fine" green
                cecho "read_buffer_size seems to be fine" green

check_innodb_status () {

## -- InnoDB -- ##

        ## See

        if [ "$mysql_version_num" -lt 050603 ] ; then
        mysql_variable \'have_innodb\' have_innodb
        if [ "$mysql_version_num" -lt 050500 ] && [ "$have_innodb" = "YES" ] ; then
        if [ "$mysql_version_num" -ge 050500 ] && [ "$mysql_version_num" -lt 050512 ] ; then
        mysql_variable \'ignore_builtin_innodb\' ignore_builtin_innodb
                if [ "$ignore_builtin_innodb" = "ON" ] || [ $have_innodb = "NO" ] ; then
        elif [ "$major_version"  = '5.5' ] && [ "$mysql_version_num" -ge 050512 ] ; then
        mysql_variable \'ignore_builtin_innodb\' ignore_builtin_innodb
                if [ "$ignore_builtin_innodb" = "ON" ] ; then
        elif [ "$mysql_version_num" -ge 050600 ] && [ "$mysql_version_num" -lt 050603 ] ; then
        mysql_variable \'ignore_builtin_innodb\' ignore_builtin_innodb
                if [ "$ignore_builtin_innodb" = "ON" ] || [ $have_innodb = "NO" ] ; then
        elif [ "$major_version" = '5.6' ] && [ "$mysql_version_num" -ge 050603 ] ; then
        mysql_variable \'ignore_builtin_innodb\' ignore_builtin_innodb
                if [ "$ignore_builtin_innodb" = "ON" ] ; then
        if [ "$innodb_enabled" = 1 ] ; then
                mysql_variable \'innodb_buffer_pool_size\' innodb_buffer_pool_size
                mysql_variable \'innodb_additional_mem_pool_size\' innodb_additional_mem_pool_size
                mysql_variable \'innodb_fast_shutdown\' innodb_fast_shutdown
                mysql_variable \'innodb_flush_log_at_trx_commit\' innodb_flush_log_at_trx_commit
                mysql_variable \'innodb_locks_unsafe_for_binlog\' innodb_locks_unsafe_for_binlog
                mysql_variable \'innodb_log_buffer_size\' innodb_log_buffer_size
                mysql_variable \'innodb_log_file_size\' innodb_log_file_size
                mysql_variable \'innodb_log_files_in_group\' innodb_log_files_in_group
                mysql_variable \'innodb_safe_binlog\' innodb_safe_binlog
                mysql_variable \'innodb_thread_concurrency\' innodb_thread_concurrency

                cecho "INNODB STATUS" boldblue
                innodb_indexes=$($mysql -Bse "/*!50000 SELECT IFNULL(SUM(INDEX_LENGTH),0) from information_schema.TABLES where ENGINE='InnoDB' */")
                innodb_data=$($mysql -Bse "/*!50000 SELECT IFNULL(SUM(DATA_LENGTH),0) from information_schema.TABLES where ENGINE='InnoDB' */")

                if [ ! -z "$innodb_indexes" ] ; then

                mysql_status \'Innodb_buffer_pool_pages_data\' innodb_buffer_pool_pages_data
                mysql_status \'Innodb_buffer_pool_pages_misc\' innodb_buffer_pool_pages_misc
                mysql_status \'Innodb_buffer_pool_pages_free\' innodb_buffer_pool_pages_free
                mysql_status \'Innodb_buffer_pool_pages_total\' innodb_buffer_pool_pages_total

                mysql_status \'Innodb_buffer_pool_read_ahead_seq\' innodb_buffer_pool_read_ahead_seq
                mysql_status \'Innodb_buffer_pool_read_requests\' innodb_buffer_pool_read_requests

                mysql_status \'Innodb_os_log_pending_fsyncs\' innodb_os_log_pending_fsyncs
                mysql_status \'Innodb_os_log_pending_writes\'   innodb_os_log_pending_writes
                mysql_status \'Innodb_log_waits\' innodb_log_waits

                mysql_status \'Innodb_row_lock_time\' innodb_row_lock_time
                mysql_status \'Innodb_row_lock_waits\' innodb_row_lock_waits

                human_readable $innodb_indexes innodb_indexesHR
                cecho "Current InnoDB index space = $innodb_indexesHR $unit"
                human_readable $innodb_data innodb_dataHR
                cecho "Current InnoDB data space = $innodb_dataHR $unit"
                cecho "Current InnoDB buffer pool free = "$percent_innodb_buffer_pool_free" %"

                cecho "Cannot parse InnoDB stats prior to 5.0.x" red
                $mysql -s -e "SHOW /*!50000 ENGINE */ INNODB STATUS\G"

                human_readable $innodb_buffer_pool_size innodb_buffer_pool_sizeHR
                cecho "Current innodb_buffer_pool_size = $innodb_buffer_pool_sizeHR $unit"
                cecho "Depending on how much space your innodb indexes take up it may be safe"
                cecho "to increase this value to up to 2 / 3 of total system memory"
                cecho "No InnoDB Support Enabled!" boldred

total_memory_used () {

## -- Total Memory Usage -- ##
        cecho "MEMORY USAGE" boldblue

        mysql_variable \'read_buffer_size\' read_buffer_size
        mysql_variable \'read_rnd_buffer_size\' read_rnd_buffer_size
        mysql_variable \'sort_buffer_size\' sort_buffer_size
        mysql_variable \'thread_stack\' thread_stack
        mysql_variable \'max_connections\' max_connections
        mysql_variable \'join_buffer_size\' join_buffer_size
        mysql_variable \'tmp_table_size\' tmp_table_size
        mysql_variable \'max_heap_table_size\' max_heap_table_size
        mysql_variable \'log_bin\' log_bin
        mysql_status \'Max_used_connections\' max_used_connections

        if [ "$major_version" = "3.23" ] ; then
                mysql_variable \'record_buffer\' read_buffer_size
                mysql_variable \'record_rnd_buffer\' read_rnd_buffer_size
                mysql_variable \'sort_buffer\' sort_buffer_size

        if [ "$log_bin" = "ON" ] ; then
                mysql_variable \'binlog_cache_size\' binlog_cache_size

        if [ $max_heap_table_size -le $tmp_table_size ] ; then

        per_thread_buffers=$(echo "($read_buffer_size+$read_rnd_buffer_size+$sort_buffer_size+$thread_stack+$join_buffer_size+$binlog_cache_size)*$max_connections" | bc -l)
        per_thread_max_buffers=$(echo "($read_buffer_size+$read_rnd_buffer_size+$sort_buffer_size+$thread_stack+$join_buffer_size+$binlog_cache_size)*$max_used_connections" | bc -l)

        mysql_variable \'innodb_buffer_pool_size\' innodb_buffer_pool_size
        if [ -z $innodb_buffer_pool_size ] ; then

        mysql_variable \'innodb_additional_mem_pool_size\' innodb_additional_mem_pool_size
        if [ -z $innodb_additional_mem_pool_size ] ; then

        mysql_variable \'innodb_log_buffer_size\' innodb_log_buffer_size
        if [ -z $innodb_log_buffer_size ] ; then

        mysql_variable \'key_buffer_size\' key_buffer_size

        mysql_variable \'query_cache_size\' query_cache_size
        if [ -z $query_cache_size ] ; then

        global_buffers=$(echo "$innodb_buffer_pool_size+$innodb_additional_mem_pool_size+$innodb_log_buffer_size+$key_buffer_size+$query_cache_size" | bc -l)

        max_memory=$(echo "$global_buffers+$per_thread_max_buffers" | bc -l)
        total_memory=$(echo "$global_buffers+$per_thread_buffers" | bc -l)

        pct_of_sys_mem=$(echo "scale=0; $total_memory*100/$physical_memory" | bc -l)

        if [ $pct_of_sys_mem -gt 90 ] ; then

        human_readable $max_memory max_memoryHR
        cecho "Max Memory Ever Allocated : $max_memoryHR $unit" $txt_color
        human_readable $per_thread_buffers per_thread_buffersHR
        cecho "Configured Max Per-thread Buffers : $per_thread_buffersHR $unit" $txt_color
        human_readable $global_buffers global_buffersHR
        cecho "Configured Max Global Buffers : $global_buffersHR $unit" $txt_color
        human_readable $total_memory total_memoryHR
        cecho "Configured Max Memory Limit : $total_memoryHR $unit" $txt_color
#       human_readable $effective_tmp_table_size effective_tmp_table_sizeHR
#       cecho "Plus $effective_tmp_table_sizeHR $unit per temporary table created"
        human_readable $physical_memory physical_memoryHR
        cecho "Physical Memory : $physical_memoryHR $unit" $txt_color
        if [ $error -eq 1 ] ; then
                printf "\n"
                cecho "Max memory limit exceeds 90% of physical memory" $txt_color
                cecho "Max memory limit seem to be within acceptable norms" green
        unset txt_color

## Required Functions  ##

login_validation () {
        check_for_socket                # determine the socket location -- 1st login
        check_for_plesk_passwords       # determine the login method -- 2nd login
        check_mysql_login               # determine if mysql is accepting login -- 3rd login
        export major_version=$($mysql -Bse "SELECT SUBSTRING_INDEX(VERSION(), '.', +2)")
#       export mysql_version_num=$($mysql -Bse "SELECT LEFT(REPLACE(SUBSTRING_INDEX(VERSION(), '-', +1), '.', ''),4)" )
        export mysql_version_num=$($mysql -Bse "SELECT VERSION()" |
                awk -F \. '{ printf "%02d", $1; printf "%02d", $2; printf "%02d", $3 }')


shared_info () {
        export major_version=$($mysql -Bse "SELECT SUBSTRING_INDEX(VERSION(), '.', +2)")
        # export mysql_version_num=$($mysql -Bse "SELECT LEFT(REPLACE(SUBSTRING_INDEX(VERSION(), '-', +1), '.', ''),4)" )
        export mysql_version_num=$($mysql -Bse "SELECT VERSION()" |
                awk -F \. '{ printf "%02d", $1; printf "%02d", $2; printf "%02d", $3 }')
        mysql_status \'Questions\' questions
#       socket_owner=$(find -L $socket -printf '%u\n')
        socket_owner=$(ls -nH $socket | awk '{ print $3 }')

get_system_info () {

    export OS=$(uname)

    # Get information for various UNIXes
    if [ "$OS" = 'Darwin' ]; then
        ps_socket=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }' | head -1)
        found_socks=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }')
        export physical_memory=$(sysctl -n hw.memsize)
        export duflags=''
    elif [ "$OS" = 'FreeBSD' ] || [ "$OS" = 'OpenBSD' ]; then
        ## On FreeBSD must be root to locate sockets.
        ps_socket=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }' | head -1)
        found_socks=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }')
        export physical_memory=$(sysctl -n hw.realmem)
        export duflags=''
    elif [ "$OS" = 'Linux' ] ; then
        ## Includes SWAP
        ## export physical_memory=$(free -b | grep -v buffers |  awk '{ s += $2 } END { printf("%.0f\n", s ) }')
        ps_socket=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }' | head -1)
        found_socks=$(netstat -ln | awk '/mysql(.*)?\.sock/ { print $9 }')
        export physical_memory=$(awk '/^MemTotal/ { printf("%.0f", $2*1024 ) }' < /proc/meminfo)
        export duflags='-b'
    elif [ "$OS" = 'SunOS' ] ; then
        ps_socket=$(netstat -an | awk '/mysql(.*)?.sock/ { print $5 }' | head -1)
        found_socks=$(netstat -an | awk '/mysql(.*)?.sock/ { print $5 }')
        export physical_memory=$(prtconf | awk '/^Memory\ size:/ { print $3*1048576 }')
    if [ -z $(which bc) ] ; then
        echo "Error: Command line calculator 'bc' not found!"

## Optional Components Groups ##

banner_info () {
        print_banner            ; echo
        check_mysql_version     ; echo
        post_uptime_warning     ; echo

misc () {
        check_slow_queries      ; echo
        check_binary_log        ; echo
        check_threads           ; echo
        check_used_connections  ; echo
        check_innodb_status     ; echo

memory () {
        total_memory_used       ; echo
        check_key_buffer_size   ; echo
        check_query_cache       ; echo
        check_sort_operations   ; echo
        check_join_operations   ; echo

file () {
        check_open_files        ; echo
        check_table_cache       ; echo
        check_tmp_tables        ; echo
        check_table_scans       ; echo
        check_table_locking     ; echo

all () {

prompt () {
        read -p "Username [anonymous] : " user
        read -rp "Password [<none>] : " pass
        cecho " "
        read -p "Socket [ /var/lib/mysql/mysql.sock ] : " socket
        if [ -z $socket ] ; then
                export socket='/var/lib/mysql/mysql.sock'

        if [ -z $pass ] ; then
        export mysql="mysql -S $socket -u$user"
        export mysqladmin="mysqladmin -S $socket -u$user"
        export mysql="mysql -S $socket -u$user -p$pass"
        export mysqladmin="mysqladmin -S $socket -u$user -p$pass"


        if [ $? = 1 ] ; then
                exit 1
        read -p "Mode to test - banner, file, misc, mem, innodb, [all] : " REPLY
        if [ -z $REPLY ] ; then
        case $REPLY in
                banner | BANNER | header | HEADER | head | HEAD)
                misc | MISC | miscelaneous )
                mem | memory |  MEM | MEMORY )
                file | FILE | disk | DISK )
                innodb | INNODB )
                all | ALL )
                cecho " "
                * )
                cecho "Invalid Mode!  Valid options are 'banner', 'misc', 'memory', 'file', 'innodb' or 'all'" boldred
                exit 1

## Address environmental differences ##
# echo $ps_socket

if [ -z "$1" ] ; then
elif [ "$1" = "prompt" ] || [ "$1" = "PROMPT" ] ; then
elif [ "$1" != "prompt" ] || [ "$1" != "PROMPT" ] ; then

case $mode in
        all | ALL )
        cecho " "
        mem | memory |  MEM | MEMORY )
        cecho " "
        file | FILE | disk | DISK )
        cecho " "
        banner | BANNER | header | HEADER | head | HEAD )
        misc | MISC | miscelaneous )
        cecho " "
        innodb | INNODB )
        check_innodb_status ; echo
        prompt | PROMPT )
        cecho "usage: $0 [ all | banner | file | innodb | memory | misc | prompt ]" boldred
        exit 1

Now make it executable by typing: chmod +x and run it by typing: ./

Step 4 – Update your settings accordingly

Now change your my.cnf file with the changes shown in the tuner.

That’s it, I hope this helped

Chris aka carpenox

Should Your Business Switch to Cloud PBX?

Should Your Business Switch to Cloud PBX?

  • A cloud-hosted PBX system is a cost-effective business phone system option.
  • Cloud-hosted systems offer a wide selection of valuable features and consistent service.
  • If you do not have a reliable internet connection, a cloud PBX system might not be right for your business.
  • This article is for business owners who are considering changing their phone system to a cloud PBX option and are looking to learn more about this kind of system.

Cloud-hosted PBX phone systems have become increasingly popular in recent years. The ability to add a robust phone system with all of the features and tools you need, without having to install or maintain any equipment, is particularly appealing to many small businesses. However, for some businesses, having a phone system that is totally dependent on the strength of an internet connection is not ideal. Before deciding whether a cloud PBX system is right for your business, it is important to understand exactly what a cloud PBX system is, how it operates, and the pros and cons.

What is cloud PBX?

A private branch exchange (PBX) system is a business-grade telephone network that enables communication both within and outside your organization. A business phone system is different from residential or cell services in that it has additional service offerings, which typically include call conferencing, extension dialing, business-hour settings to route off-hour calls, customer waiting queues and hold music.

Cloud PBX, also known as hosted PBX or virtual PBX, is an IP-based PBX solution that’s provided and accessed completely through the internet. Instead of hosting software on a server the way digital systems do, cloud PBX hosts all software and data in the cloud.

Key Takeaway:

A cloud PBX system is a business phone solution powered by an internet connection. All of the software and data are hosted in the cloud. Cloud PBX systems offer valuable features, like automated attendants, call queues, extension dialing and conference calling.

Digital vs. cloud PBX

Cloud phone systems are an offshoot of digital – or on-premises – PBX systems. These systems offer the same level of functionality but differ in where the equipment is located and how it is maintained. The cost structures of the two systems also set them apart. On-premises phone systems have PBX equipment housed in large hardware units that must be stored on-site. On-premise systems can be very costly because of their size and requirements for a special storage facility. Companies are also on the hook for expensive regular maintenance, since the machines are complex and require professional attention.

Digital PBX phone systems are monitored using a PBX switchboard. The switchboard processes the connections between telephones to facilitate a call and controls many business-grade phone system features.

Cloud PBX takes all the functionality of a digital system and moves it into a virtual space, eliminating the need for hardware and other equipment, which saves you money on installation and maintenance. Hosted PBX systems have become popular largely because they are easier to use and provide all of the functions of a digital PBX platform (and more) without requiring clunky, costly equipment.

Key Takeaway:

A digital PBX phone system is an on-site solution, which means all of the equipment is stored on servers inside your business. A cloud PBX system doesn’t require physical equipment. All of the equipment is stored in the cloud, making it a much more flexible option.

How does cloud PBX work?

Cloud PBX is an internet phone system in which the provider is responsible for both housing the PBX equipment and providing your phone services. Your desk phone plugs into a router, and any calls, signaling and features are handled through a server at the provider’s physical location.

graphic of colorful text bubbles filled with icons

The PBX is responsible for routing incoming calls, enabling call transfers to other extensions and running all of your phone system’s communications features, such as call waiting and voicemail. Your system can be managed using a call flow, which is a collection of features and rules you assign to a given phone number.

Key Takeaway:

In a cloud PBX system, all software and data are stored in the cloud. The PBX equipment facilitates all of the phone services and allows for features such as call waiting and voicemail.

How to use a call flow

A call flow helps you manage how your calls are routed. A call flow configuration lets you control when, where and how calls come in through your main business phone lines. This means you can set certain business hours for receiving calls, see the location of the caller or control who receives the call. The call flow interface varies by provider, but most offer similar customization options for your hosted PBX solution.

For example, you can specify which phones you or your employees are using, in what order those phones should ring (parallel or in a sequence) and what the rules of call handling will be if no one answers.

Key Takeaway:

Call flow is essentially how calls made to your business phone line are managed. You can control where, when and how calls are handled with your system.

What are the benefits of cloud PBX?

Low cost

The greatest benefit of a hosted cloud PBX system is its low cost. Because a hosted PBX system is provided as a service, you do not have to purchase any physical equipment; the only equipment you may need are VoIP-enabled desktop phones.

However, you also have the option of routing all calls to employee mobile phones. The lack of equipment also helps you save on installation and maintenance costs. All of your services and features are fully hosted in the cloud and maintained by your provider, which means that the cost of your phone service covers regular updates and maintenance. Most providers offer online portals through which you can manage your phone lines, updates and maintenance needs.

A hosted PBX solution also gives you significant control over how much you pay, since you pay only for the features and phone lines you need. Additionally, most cloud-hosted business phone systems offer unlimited domestic calling, which ensures employees can use the phone as long as they want, without ever having to worry about racking up added fees.

Features and flexibility

Cloud-based PBX systems offer significant benefits in terms of features and flexibility. As the world moves increasingly to flexible and nontraditional working environments, it has become a large business priority to be reachable anywhere and anytime. A hosted solution allows you to conduct business calls via your smartphone or computer as long as you have an internet connection, so if you’re thinking about moving your business to a new location, you won’t have to worry about lugging any equipment (except for the phones).

Your employees can customize their phone settings to whatever works best for them, such as having their calls routed to both their desk phone and their computer, or to their desk phone and mobile phone.

Cloud PBX also provides features such as texting, voicemail transcription, call recording and integration with vendor services. Features vary among systems, so you should explore what features you think your business will need and shop around to see what features each vendor includes and which ones you must purchase as add-ons.

Here are some additional useful features many cloud-hosted PBX systems offer:

  • Online management: Administrators can make changes to the phone system, such as adding users, assigning phone numbers, creating ring groups, and reviewing call reports and monthly statements from an online portal. Employees can log in to the portal to check their voicemail, see the company directory and set up call-forwarding routes.
  • Ring groups: A ring group is used to organize your employees into groups by what they do or their department. For example, the sales team may have its own ring group so that when a client calls to speak with a representative, everyone in that ring group is notified.
  • Voicemail-to-email: This feature lets you send audio files or transcriptions of voicemail messages to an employee’s inbox.
  • Call queue: Call queues help manage your influx of calls by placing callers in a line or on hold until an employee is available to take the call.
  • Unlimited calling: This allows employees to make as many domestic calls as they need for no additional cost.
  • Video/web conferencing: Users canhost video meetings that allow for screen sharing, which lets users view and discuss documents or presentations. Although call capacity varies among providers, some allow you to have up to 1,000 people on a call.
  • Instant messaging: This feature allows users to send online messages to co-workers.
  • Text messaging: Employees can send text messages from their business lines instead of from their personal phone numbers.
  • Auto-attendant: Auto-attendants are basically virtual receptionists that answer calls and transfer callers to the appropriate employees. For example, a caller might hear an auto-attendant say, “Press 1 for sales, press 2 for customer service or press 0 to speak with an operator.”
  • Extension dialing: Instead of punching in an employee’s entire phone number, employees can dial a few numbers to connect with co-workers.
  • Conference calling: You can host calls with hundreds, or sometimes thousands, of participants at one time.

Reliable service

For many businesses, phone communication is the backbone of their day-to-day activities, so reliable service is a must. A traditional landline system uses copper cabling to transfer phone calls, and these cables are vulnerable to natural disasters, vandalism, and general wear and tear, all of which can mean extended outages of your phone service.

Cloud PBX systems use the internet, which means your phone service is as strong as your internet connection. Because all of your information is in the cloud, your system should experience little or no downtime in the event of an issue. Geographic redundancy, which is when the provider has several servers in different physical locations, is one of the most common reliability measures of these systems. Each server contains identical information, so if one fails, another can take its place almost instantly. 

Key Takeaway:

Cloud PBX systems are cheaper and more flexible than on-site and traditional landline systems. Cloud PBX solutions also offer several valuable features, like unlimited calling, call queues and automated attendants.

What are the cons of a hosted PBX system?

Although hosted PBX service seems to be the most popular option in the current market, a hosted PBX provider may not be the right option for your business.

If you don’t have access to high-speed internet, have a poor internet connection or cannot properly secure your connection, cloud PBX may bring you more frustration than it’s worth. The system is entirely dependent on the internet and will not function properly without a strong connection, so if your internet service provider is unreliable or frequently drops your internet service, hosted PBX is not a fit for you.

Additionally, because they are internet-based, cloud PBX solutions are more susceptible to security breaches than digital systems are. When speaking to vendors, be sure to ask about their security measures and how they protect your data. You should make sure they have both physical and network security, SIP trunk endpoint security, toll fraud monitoring and detection, and a dedicated monitoring system that alerts you to any suspicious activity.

Key Takeaway:

With cloud-hosted PBX systems, call quality depends on the internet connection, so if it’s poor, your calls will be, too. This system is also more vulnerable to security breaches.

Popular cloud PBX providers

Finding the right cloud PBX system for your business is key to giving your clients and employees exactly what they need. Here are some popular options and what they offer:

RingCentral: RingCentral offers four subscription tiers that range from $29.99 to $59.99 per user per month. Before you get started, RingCentral provides you with an implementation specialist, who helps you choose new numbers, transfer over current numbers and decide how many phones you will need. The company’s calling features include call forwarding, call recording, call screening, call logs, message alerts and answering rules. Other popular tools are auto-receptionists, presence tools, multilevel interactive voice response systems, hold music, voicemail, voicemail to email, and visual voicemail. Conference calls can hold up to 1,000 participants. RingCentral also offers a mobile app for iOS and Android devices.

Ooma Office: Ooma’s pricing is based on whether you choose an IP PBX, an analog phone option or both. Regardless of the phone type, Ooma’s starting price is $19.95 per user per month. However, if you want to use analog phones, you will need to install some of Ooma’s on-premises equipment. This PBX system also offers dial-by-name calling, a virtual receptionist and virtual phone numbers for employees who work outside the office.

CyburDial: This cloud hosted PBX gives you the option to have a custom dialer solution built per your requirements and needs. You can have it built for less money than 1 monthly payment to it’s competitions. Prices for a system you will own start at $250 which includes the dialer system, webphones and an IP whitelist firewall. If you would like to stick to paying monthly fees per user, prices start at $15. Full CRM integrations, API functions and over 4500 features to choose from well give you the most robust system available.

8×8: This cloud-hosted VoIP unified communication system ranges from $12 to $115 per user per month. The service has an uptime of 99.999%, which means it’s down for only a few minutes each year. 8×8 offers three-way calling, call forwarding, call waiting, call transferring, online voicemail, an automated attendant, ring groups and caller ID. It also has integrations with popular programs such as G Suite, Office 365 and Salesforce.

GoToConnect: GoToConnect starts at $19.95 per user per month. This system provides advanced ring strategies, pre-call announcements, unlimited call queues, wait time announcements, video conferencing, personal meeting rooms and screen sharing.

Key Takeaway:

There are many PBX systems for business owners to choose from, but a few quality programs you should check out include GoToConnect, 8×8, CyburDial, Ooma Office and RingCentral.

i hope this has helped some if you.

Chris aka carpenox

What Is a Cloud PBX?

Data center

What Is a Cloud PBX?

A cloud-based private branch exchange (PBX) is a modern way for companies to communicate and route calls via the internet. Learn what to look for in a cloud PBX system.

In the evolving world of business phone systems, a cloud-based private branch exchange (PBX) is a modern way for companies to communicate and route calls via the internet. Cloud PBX systems often replace costly on-premises PBX hardware that uses traditional telephone equipment and phone service providers to handle voice communications. 

Cloud PBX is often used interchangeably with hosted PBX because a third party manages the equipment; however, there are significant differences. Cloud-based phone systems are typically implemented for their cost-savings potential and advanced calling features, including auto-attendants, call routing, mobile device support, voicemail to email, free local numbers, call recording and post-call notes.

If you’re considering a cloud PBX for your business, here’s what you need to know.


Cloud PBX is a type of business phone system often used interchangeably with terms such as “hosted PBX,” “IP PBX” and “virtual PBX.”

How does cloud PBX work?

Unlike a traditional telephone system, which uses copper landlines to transmit voice data, cloud PBX uses your business broadband connection to make communication possible. With cloud or hosted systems, voice data from your device is transformed into encrypted data packets that are sent through your internet service provider’s network to establish a connection and maintain the call. 

Your service provider owns and manages all major equipment in a cloud PBX system. You are responsible for providing an internet-connected device or IP phone to connect to the internet.

Cloud PBX vs. on-premises PBX

For business owners, one of the most significant differences between cloud PBX and on-premises PBX is the hardware’s location. On-premises PBX systems require onsite hardware and IT maintenance that comes at the business’s expense. However, there are several other notable differences between these two phone systems to consider.

Cloud PBXOn-premises PBX
Data is stored and managed in the cloud with no onsite hardware required.You own and manage your onsite telecom hardware and data.
You can use IP phones and internet-connected devices to make and receive calls anywhere.You can use traditional desk phones to make and receive calls from a fixed location.
It integrates with popular business software and tools for unified communications.It integrates with CRMs, online tools and can als control facility access control devices.
It’s perfectly suited for companies with remote teams.Can help both on site and remote workers.
There are minimal to no upfront or maintenance costs other than installation.There are minimal up front costs other than installation.
There are monthly subscription fees in perpetuity for each user.There’s the potential for lower monthly long-term costs as a result of owning your equipment.

Virtual PBX vs. cloud PBX

Virtual and cloud PBX systems are similar because neither needs the onsite hardware that on-premises systems require. A virtual PBX is implemented to route incoming calls using interactive voice response (IVR) or auto-attendants. 

This widely used technology lets callers interact with prerecorded messages through their dial pad to choose where the call should be routed. For example, if you’re calling your internet service provider, you might choose from billing and technical support options. This feature is also available with cloud PBX systems. 

Virtual PBX systems are typically used at small businesses that don’t spend much time on the phone and don’t want to pay for a complete business phone system. Cloud PBX solutions can be found in companies of all sizes and industries where telephone communications and video conferencing are essential for conducting business.

Bottom Line

When choosing a business phone system, note that a virtual PBX is a component of a cloud PBX system.

Pros and cons of cloud PBX

The benefits and cost-saving potential of cloud PBX generally outweigh its disadvantages. However, cloud PBX phone systems are not perfect for every business in every location.


  • It has low upfront costs.
  • There’s no equipment to maintain.
  • It provides flexibility for remote workers.
  • It has a wide range of useful features and tools.
  • It typically includes voice, video, chat and SMS communications.
  • It integrates with other popular business applications, including CRM software.


  • Your call quality is only as good as your internet connection.
  • Your employees may need training on advanced features.
  • Network routers may need fine-tuning to support cloud telephony.
  • You’ll need an annual or monthly service plan that’s most likely priced per user.

What to look for in a cloud PBX provider

Most cloud PBX providers offer similar monthly and annual pricing structures, advertised uptimes that exceed 99.9%, and a wide range of integrations that can incorporate your new phone system into other software applications and tools your company uses daily. 

With so much similarity between providers, shoppers should focus on the features they would utilize the most with a cloud-based phone system and make sure the move to cloud PBX doesn’t negatively impact the way their employees work.


A cloud PBX system offers remote workers greater flexibility, which can boost remote work productivity.

Here are some important factors to consider:

  1. Integrations: Integrations are a great place to start when you’re exploring cloud-based phone system providers. Most businesses are locked into several popular software applications, making it worthwhile to focus your search on the cloud PBX providers that will fit seamlessly into your existing toolset. Otherwise, your seemingly cost-effective phone solution may lead to additional expenses if you need to migrate to a different CRM system, for example.
  2. Price: Price is the second area to examine. Large companies should take the time to call a few cloud-based phone service providers to inquire about discounted pricing with an enterprise plan. Generally speaking, you’ll be able to find a lower rate by committing to an annual service plan instead of a recurring monthly payment. It’s worth noting that fees are typically charged per user.
  1. Flexibility: Plan flexibility is another essential aspect to consider. Not everyone in your business likely needs the same features in a phone system. Many businesses that are building a sales team or using remote customer service agents may need higher-priced advanced calling features. On the other hand, in-office support staff may need only the most basic, entry-level calling features.
  2. Support: Customer support can be critical, depending on your team’s experience with cloud-based software. Many cloud PBX providers offer 24/7 support with every subscription plan; however, some companies may limit support hours with their lower-cost and entry-level plans.
  3. Hardware: Hardware such as IP desk phones, conference phones, and headsets may not be necessary for all cloud PBX users, but if you’re going to purchase a significant number of devices, you may be able to find a better deal through your phone service provider. Companies such as Nextiva offer dozens of hardware options with discounted pricing available. 


Existing businesses looking to switch to a cloud PBX phone system should prioritize integrations with the software applications they use daily, including the best CRM software.

Cloud PBX providers to consider

Our editorial team spent weeks reviewing the industry’s best business phone systems. We considered the most popular providers and identified 11 of the best options for businesses of all sizes. 

For your convenience, we’ve summarized four of our favorite business phone system providers that offer some form of cloud PBX service. It’s worth noting that many of these providers use the terms “VoIP,” “cloud PBX,” “hosted PBX” and “virtual phone systems” interchangeably. 

Pricing for this category is typically based on the number of monthly users, with discounts available for longer contract terms and larger companies with more than 20 users.


Dialpad is an advanced cloud PBX phone system that uses voice intelligence technology to help teams stay connected and transform business conversations into actionable data to increase efficiency and sales. 

Here are a few notable Dialpad features: 

  • Unlimited calling
  • Local number support in more than 50 countries
  • Ring groups
  • CRM integrations
  • 24/7 customer support
  • Desk phone support
  • Number porting
  • Automatic post-call notes
  • Speech coaching

Pricing: Dialpad costs $15 to $25 per monthly user, with custom pricing for enterprise plans available for “business communications” products. New customers should take advantage of the 14-day free trial to get a better feel for Dialpad’s suite of features and tools. 

Read our full Dialpad review for more information.


GoToConnect’s hosted PBX helps businesses migrate from a legacy phone system to a modern communications suite with more control and an expansive set of administration tools.

These are some notable features of the GoToConnect Standard plan: 

  • Easy number porting
  • Variety of free phone number options
  • Smart call routing
  • Hot desking 
  • Unlimited auto-attendants, ring groups, extensions, dial plans and music queues 

These are some of GoToConnect’s advanced features: 

  • Call analytics
  • “Listen, whisper and barge” feature (available to supervisors) 

Pricing: GoToConnect’s three plans range from $24 to $39 per monthly user.


Nextiva is a reliable and modern business phone service that connects billions of conversations each year with reported uptimes of 99.999%. 

Notably, all Nextiva Business Communication plans provide 24/7 live customer support and advanced VoIP features, including these:

  • Auto-attendants
  • Voicemail to email
  • Toll-free numbers
  • Online fax capabilities
  • Unlimited domestic calling 

Pricing: Nextiva costs $17.95 to $52.95 per monthly user when paid annually for large teams. Nextiva bases the pricing for its four subscription tiers on the number of users, with savings of around 25% for companies with more than 99 users. G

You’ll find seven-day trials and free demos for each of Nextiva’s Business Communication plans. You can also purchase or lease VoIP devices and save with manufacturer rebates and discounts.

Read our full Nextiva review for more information.


RingCentral was one of the early cloud PBX innovators, helping to lower costs, increase ROI, connect remote workers, and provide the flexibility to help businesses scale as needed. Note that RingCentral uses the terms “virtual PBX,” “hosted PBX,” “cloud PBX” and “IP PBX” interchangeably.

These are some of its standard features:

  • 1,000 toll-free minutes
  • Unlimited calls to the U.S. and Canada
  • Voicemail transcription
  • Call reports
  • 24/7 support
  • Auto-attendants
  • Professional implementation

Add-ons include high-volume SMS and room licenses as well as additional toll-free, international, and vanity numbers.

Pricing: RingCentral costs $19.99 to $49.99 per monthly user for midsize companies when paid annually (a savings of up to 33%). Like many business phone system providers, RingCentral bases its product pricing for its four MVP tiers on the number of users. However, its entry-level Essentials plan is available only for businesses with 20 or fewer subscribers. 

Whatever subscription tier you’re interested in trying, we recommend taking advantage of the free trial for five users and two desktop phones to get a feel for RingCentral’s interface and capabilities. 

Cloud PBX FAQs

How much does a cloud PBX system cost?

Cloud PBX systems typically cost $20 to $60 per monthly user, depending on the features and services. Many hosted PBX providers offer discounts based on the number of users as well as contract length. 

Because these phone systems run on most internet-connected devices, there’s often no need to purchase anything other than inexpensive headsets to take calls. However, companies that prefer traditional telephones can purchase IP phones that look and function like desk phones, but they’re connected via Ethernet cable instead of a phone line.

Is cloud PBX a VoIP?

What are the benefits of a cloud PBX system?

A cloud PBX system is an affordable way to provide advanced telephone features to in-office and remote employees. It can improve communication across an organization and track interactions to improve customer experiences. It can also help increase performance with real-time call analysis, post-call summaries, and detailed caller identification to help provide personalized and professional service over the phone.

If you want to make phone calls over the internet and increase…

Hopefully this article has helped you understand what your of system you’ll have and all the options available that come with it.

-Chris aka carpenox