Max Attempts Disposition

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Max Attempts Disposition

Postby karlb » Tue Jun 04, 2013 4:56 pm

Hello,

In working with Vici, one of the features I could not find (but needed) was the ability to set a disposition to a record once it reached it's call count limit.

I wrote a script to do this and I have seen other inquire about this, so I thought I would share. Hopefully it could be helpful to some.

The script will look for all list_ids associated with a campaign and then find that campaigns call count limit. The query only picks up on campaigns where this is actually set (Other than 0) Any record that it matches that has a callable status, will be updated to the MAX status.

To make this work, you should set a system status for MAX (Maximum Attempts). I set this in my cron to run at night after calling is done.

It could probably be edited to lookup system variable such as DB Server IP and login to be streamlined for any Vici install, but those will need to be edited to fit your installation as well.

Run as PHP Shell:

Code: Select all
<?php

//Connect to DB Server
mysql_connect("localhost", "dbusername", "dbpassword")or die("cannot connect");
mysql_select_db("asterisk")or die("cannot select DB");

//Find list_id's and their associated call count limits.

$result=mysql_query("SELECT vicidial_campaigns.campaign_id, vicidial_campaigns.call_count_limit, vicidial_lists.list_id FROM vicidial_campaigns,vicidial_lists WHERE vicidial_lists.campaign_id = vicidial_campaigns.campaign_id AND call_count_limit > 0");
while($query_data = mysql_fetch_row($result)){

   //Disposition off max attempts.
   $update=mysql_query("UPDATE vicidial_list SET status = 'MAX' WHERE status IN ('NA', 'ERI', 'DROP', 'IVRXFR', 'B', 'AB', 'AA', 'A', 'CALLBK', 'NEW', 'PDROP', 'LRERR', 'PU', 'CBHOLD', 'CPDREJ', 'CPDUK', 'CPDNA', 'CPDERR', 'CPDB', 'CPDATB', 'CPDSUA') and called_count >='$query_data[1]' and list_id = '$query_data[2]'");
}

?>


Questions / comments welcome!

Karl Babcock
karlb
 
Posts: 37
Joined: Fri Dec 28, 2012 1:03 pm
Location: Chicago, IL

Re: Max Attempts Disposition

Postby mflorell » Wed Jun 05, 2013 5:24 am

Thank you very much for posting! Could you also add this to the Issue Tracker please?
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Max Attempts Disposition

Postby karlb » Wed Jun 05, 2013 10:42 pm

Done. #674.
karlb
 
Posts: 37
Joined: Fri Dec 28, 2012 1:03 pm
Location: Chicago, IL


Return to Features

Who is online

Users browsing this forum: No registered users and 88 guests