# Dialer Tips

## [Are Your Calls Marked as Spam?](/content/are-your-calls-marked-as-spam/index.html)

If you have noticed that your calls have been marked as spam or have been blocked by major mobile carriers such as AT&T, T-mobile or Verizon, please register your caller IDs on the following resource websites: Hiya (AT&T) 1st Orion (T-Mobile, Sprint) T-Mobile Call Reporting TNS (Verizon, U.S. Cellular) Other, less important, but helpful resources:

## [How to export callbacks from ViCiDial](/content/how-to-export-callbacks-from-vicidial/index.html)

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

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

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

## [How to reduce dialer database size by deleting logs](/content/how-to-reduce-dialer-database-size-by-deleting-logs/index.html)

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:

```bash
du -kh /var/lib/mysql
```

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

```bash
du -kh /var/lib/mysql/asterisk
```

## [Finding files larger than … in Linux](/content/finding-files-larger-than-in-linux/index.html)

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:

```bash
find / -size +500M
```

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

```bash
find / -type f -size +500M -exec du -h {}
```

## [Searching for a string in Asterisk](/content/searching-for-a-string-in-asterisk/index.html)

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.:

```bash
asterisk -rvvvvv | egrep -i "string"
```

Example (showing only congestion notices / errors)

```bash
asterisk -rvvvvv | egrep -i "congested"
```

## [Deleting recordings older than X days](/content/deleting-recordings-older-than-x-days/index.html)

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

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

## [How to export leads with certain disposition only from ViCiDial / GoAutoDial using PHPMyAdmin](/content/how-to-export-leads-with-certain-disposition-only-from-vicidial-goautodial-using-phpmyadmin/index.html)

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:

```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

## [How to export all leads from specific certain cities from the entire database / dialer](/content/how-to-export-all-leads-from-specific-certain-cities-from-the-entire-database-dialer/index.html)

Just run the following from your MySQL / MariaDB console:

```sql
SELECT first_name,last_name,address1,city,postal_code,phone_number FROM vicidial_list WHERE list_id in (select list_id from vicidial_lists) and city in ('X','Y','Z') INTO OUTFILE '/tmp/cities.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY 'n'
```

## [Installing Fail2Ban on a CentOS server](/content/install-fail2ban-centos/index.html)

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

## [Resetting only specific call statuses within a specific campaign](/content/resetting-only-specific-call-statuses-within-a-specific-campaign/index.html)

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:

```bash
mysql -ucron -p1234
use asterisk
```

Afterwards, run the following command (Example –
