Lot of our clients using vTiger have complained about the default Comments time format (X days ago and similar).

To use a more standard timestamp, please edit the /modules/Vtiger/helpers/util.php file.

Comment out the original $dateTime fiunction and enter the following instead for imperial:


public static function formatdatediffinstrings($datetime) {

// http://www.php.net/manual/en/datetime.diff.php#101029

$dateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($dateTime);

return date("m-d-Y h:i:s a", strtotime($dateTime));


... or following for metric formats:


public static function formatdatediffinstrings($datetime) {

// http://www.php.net/manual/en/datetime.diff.php#101029

$dateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($dateTime);

 return date("d-m-Y H:i:s", strtotime($dateTime));

When creating a fields, following changes are needed in database:

  • vtiger_field table - change typeofdata from the current value whatever it might be to I~O
  • vtiger_field table - change uitype from the current value to 10
  • vtiger_fieldmodulerel table - create a new row containing the original fieldid from the vtiger_field table, module where the data is located, module where the data should be looked up from, leaving the last two columns blank. Example:
    2075, Leads, Accounts, NULL, NULL


In order to export all callbacks (CBHOLD) from the entire dialer, please log into the MySQL and run the following query:

SELECT * FROM `vicidial_list` WHERE `status`='CBHOLD' INTO OUTFILE '/var/www/html/vicidial/cbholds.zip' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'

After that, navigate to http://your-dialer-addres/vicidial/cbholds.zip, download and rename the file from .ZIP to .CSV.

If you wish to search for a certain string in Asterisk only (Example: only show carrier congestion), launch the Asterisk CLI along with the grep command, i.e.:

asterisk -rvvvvv | egrep -i "string"

Example (showing only congestion notices / errors)

asterisk -rvvvvv | egrep -i "congested"

Fresh installs of self-hosted vTiger 7 come with a bug where leads and opportunities are not visible for any newly created roles unless the user is given admin privileges.

Please run the following queries after making a backup of your database:



CREATE TABLE IF NOT EXISTS `vtiger_cv2group` (

`cvid` int(25) NOT NULL,

`groupid` int(25) NOT NULL,

KEY `vtiger_cv2group_ibfk_1` (`cvid`),

KEY `vtiger_groups_ibfk_1` (`groupid`)




CREATE TABLE IF NOT EXISTS `vtiger_cv2role` (

`cvid` int(25) NOT NULL,

`roleid` varchar(50) NOT NULL





`cvid` int(25) NOT NULL,

`rsid` varchar(255) NOT NULL




CREATE TABLE IF NOT EXISTS `vtiger_cv2users` (

`cvid` int(25) NOT NULL,

`userid` int(25) NOT NULL,

KEY `vtiger_cv2users_ibfk_1` (`cvid`),

KEY `vtiger_users_ibfk_1` (`userid`)


To remove recordings older than X days (i.e. 3 days), SSH into your dialer and run the following campaign:

find /var/spool/asterisk/monitorDONE/MP3 -type f -mtime +3 -exec rm {} \;

find /var/spool/asterisk/monitorDONE/ORIG -type f -mtime +3 -exec rm {} \;

IncrediblePBX (beefed up FreePBX) is our favorite PBX distro. The version 13 by ingenious Ward Mundy is even better than it's predecessors but it does have some drawbacks. 

Regardless of if the installation is done 'from scratch' or from the ISO, many users report problems with no audio when iptables is running.

Solution is quite simple:

  1. Edit the iptables file: nano /etc/sysconfig/iptables
  2. Enter the following line (with most ISO installs it's already there but it is commented out): -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT



Sometimes, admin would like to change / reset only specific dial statuses within only specific campaign - i.e. Reset all NA, NI, NP and similar statuses while keeping others (like DNC, SALE etc.) intact.

To do so, log SSH in and open mysql:

mysql -ucron -p1234

use asterisk

Afterwards, run the following command (Example - reset all statuses for all lists in campaign ID 4000 except for leads, callbacks and DNC):

update vicidial_list set status='NEW' where list_id in (select list_id from vicidial_lists where campaign_id='4000') and status not in ('DNC','DNCL','CALLBK','CBHOLD','SALE');

Small, clean database will always perform better than a huge one.

In order to see what is the total size of all the databases in the dialer, log in via SSH and run the following command:

du -kh /var/lib/mysql

To check the size of the asterisk database only, you can run:

du -kh /var/lib/mysql/asterisk

To delete logs, run the command below:

TRUNCATE `vicidial_user_log`;TRUNCATE `vicidial_monitor_log`;TRUNCATE `vicidial_log_extended_archive`;TRUNCATE `vicidial_log_extended`;TRUNCATE `vicidial_log_archive`;TRUNCATE `vicidial_log`;TRUNCATE `vicidial_email_log`;TRUNCATE `vicidial_email_list`;TRUNCATE `vicidial_did_log`;TRUNCATE `vicidial_dial_log`;TRUNCATE `vicidial_cpd_log`;TRUNCATE `vicidial_closer_log_archive`;TRUNCATE `vicidial_closer_log`;TRUNCATE `vicidial_carrier_log_archive`;TRUNCATE `vicidial_carrier_log`;TRUNCATE `vicidial_api_log_archive`;TRUNCATE `vicidial_api_log`;TRUNCATE `vicidial_agent_skip_log`;TRUNCATE `vicidial_agent_log_archive`;TRUNCATE `vicidial_agent_log`;TRUNCATE `vicidial_admin_log`;TRUNCATE `user_call_log`;TRUNCATE `recording_log`;TRUNCATE `park_log`;TRUNCATE `call_log_archive`;TRUNCATE `call_log`;TRUNCATE `callcard_log`;

Warning: You will not be able to recover the logs afterwards, meaning, all of your call logs will be permanently deleted after this.

To export only leads with a specific disposition (in this example SALE) from only certain campaigns (in this example 1000, 2000), please log in to PHPMyAdmin and run the following SQL:

select * from vicidial_list where status="SALE" and list_id in (select list_id from vicidial_lists where campaign_id=1000 or campaign_id=2000)

Click on the Export button on the bottom and select the desired format (CSV, SQL...)

Creating a suppression list can be very useful when ordering new data / lists from data providers, helping you avoid purchasing duplicates.

To create a suppression list, login via SSH and run the following commands:

mysql -uroot -p
When prompted, enter your password. The default for GoAutoDial is vicidalnow, ViciBox - blank.

use asterisk;

SELECT distinct phone_number INTO OUTFILE '/var/www/html/vicidial/suppression.zip' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'   LINES TERMINATED BY '\r\n'  FROM vicidial_list;

If you would like to create a suppression list for a single campaign only (in this example, campaign 1234, pelase run the following query instead:

SELECT distinct phone_number INTO OUTFILE '/var/www/html/vicidial/suppression.zip' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'   LINES TERMINATED BY '\r\n' FROM vicidial_list WHERE list_id in (SELECT list_id from vicidial_lists WHERE campaign_id=1234);

When the command has finished, open your browser and navigate to http://your-dialer-ip/vicidial/suppression.zip and download the file.

Rename the file from .zip to .csv.

In order to locate any files larger than a certain size, please run the following command. The below example searches for all files larger than 500MB.

find / -size +500M

To display more details and sort the items in the list by size, run the following:

find / -type f -size +500M -exec du -h {} \; | sort -n

GoAutoDial CE 3.3 monitoring and barge function do not work out of the box. To fix this, log in via SSH and run the following commands:

For CentOs distros:

yum install glibc.i686 -y

For Ubuntu distros:

apt-get install libc6-i386

Then run:

usr/share/astguiclient/ip_replay/relay_control start


*Please note that epel5 distros cannot be updated anymore as they are EOL.

To simultaneously update all of the username and phone passwords in ViCiDial, please log in to your MySQL (or PhpMyAdmin, if available) and run the following SQL statements:

UPDATE phones set pass='Your_Password',conf_secret='Your_Password' where user_level=1;

UPDATE vicidial_users set pass='Your_Password',phone_pass='Your_Password' where user_level=1;

If you are running a predictive dialer (or any kind of Asterisk server) or a web hosting server, you have probably experienced often hacker/lamer brute force attempts. These attacks can be easily blocked by implementing optimal server configuration, using a good Firewall (i.e. SonicWall, PfSense, Tomato) etc. A very useful method of blocking brute force attacks is installing Fail2Ban, which will block the attacker from accessing your server through SSH, Asterisk... for a specified period of time after a number of unsuccessful login attempts.

The following guide explains installation of Fail2Ban service on a CentOS server.


1. Install

If you haven't done it already, download the EPEL repository:

# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm


When the repository has been downloaded, install fail2ban:

# yum install fail2ban


2. Configure

Editing the main config file (jail.conf) is not something you should do. Create a local copy of the jail file:

# cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local


Setup your preferences by editing the jail.local file:

# nano /etc/fail2ban/jail.local


You will find the Asterisk section around the middle. Make sure that you whitelist your own external IP address and to keep the in place. We strongly suggest setting the bantime to a much higher value (i.e. one week - 604800 seconds)


3. Restart Fail2Ban

Restart Fail2Ban:

# sudo service fail2ban restart




4. Adding a lamer IP address to IPTABLES

# iptables -A INPUT -s 123.456.789.012 -j DROP & iptables-save

Some list vendors will often sell low-quality dialer lists with a lot of missing information. As an example, here is a command to delete all records with missing Last Name field within the list '123'. You can permutate last with first or any other column:

DELETE from vicidial_list WHERE list_id='123' AND last_name='';

To run a similar query which would delete all records with a certain string in the Last Name field within the same list, use the following SQL:

DELETE from vicidial_list where list_id='123' and (last_name LIKE '%is_name%' OR first_name LIKE '%STRING_HERE%');

When experiencing database problems, most often manifested by an outbound dialing issue or a time syncronization issue, try running the following command from your SSH client:

mysqlcheck -u cron -p 1234 --auto-repair --check --optimize --all-databases

You can also use the root MySQL credentials. Make sure to restart the asterisk service just in case:

service asterisk restart


pkill -9 asterisk asterisk -vgc

To remove a valid IP address from the iptables, log in via SSH and enter the following commands:

iptables-save > tmp_file

nano tmp_file


Remove / delete the line containing the valid IP address

iptables-restore < tmp_file & iptables-save


To block an IP (example 111.222.333.444), please use the following command:

iptables -A INPUT -s 111.222.333.444 -j DROP & iptables-save

Imagine using your ViCiDial dialer without the need to install, configure and constantly deal with softphones such as Zoiper, X-lite, Eyebeam and similar.

As a custom service, OneCentVoIP can integrate a WebRTC phone within your agent UI, enabling audio (and even video, screen sharing) stream within the browser and UI itself, eliminating the need for installation and setup of any softphone software.

Contact us today for more information.