We are using the vici auto dialer platform and need a custom agi script created for it.
Vicidial allows you to press 1 and then connect to a live agent, or an extension. I figure the best way to connect them with an agent in their local area instead of a live agent is to create an extension that runs an Asterisk AGI script to complete the following: play audio file and then collect DTMF input of 5 digit zip code. The script then looks up the zip in database and transfers the caller to an external phone # retrieved from the database results. The input parameters control how the AGI script works after it has retrieved 1 or more records and is detailed below. See page 1 usarep table as reference for zipcode database.
An example work flow is as follows:
a) Caller answers and hears message “press 1 now to speak with your local cable”
b) Caller presses 1
c) Wav file is played back “please enter your 5 digit zip code to locate your installer”
d) Caller enters 11204
e) The system looks up 11204 in the usarep table to find the phone number and name of the representative.
a. If there are no reps found then it will execute a php script (already created) that grabs the rep info from a website and returns it in a long string delimited by pipelines. Our system needs to submit the zip code collected from the caller in the format of http://address/[url removed, login to view]?query=11204 and this script will return to the browser “11204|8155551212|Donald|8155551213|ron”. We need to grab this information and use it to present the information, the same as if were found in the database
b. There are 2 reps found.
f) Wav file is played back “2”. wav file is played back “rep found”. Wav file is played back “press”. Wav file is played back “1”. “wav file is played back “for”
g) Cespral text to speech pronounces the” rep name” for the first record found
h) Wav file is played back “press”. Wav file is played back “2”. “wav file is played back “for”
i) Cespral text to speech pronounces the” reps name” for the second record found
j) Caller presses 1
k) Wav file is played back “please wait a moment while you are connected to the office of”
l) Cespral text to speech pronounces the” reps name” for the first record found
m) The system transfers the call to the phone number of the first record found, connecting the ringing line.
Zip Zip code is looked up NNNNN
Type What results are we retrieving E = return results from database that are English speaking
S = return results from database that are Spanish speaking
B = return both
Mode How to handle the results that are retrieved 1 = connect to the first result
2 = equally balance transfers to all results
3 = prompt caller to choose from results with touch tone menu with text to speech of the named options and then connect to their selection.
Input Parameters for ZipCode Call Transfer AGI script / dial plan:
Announce Should we Cespral text to speech the name of the person they are being connected to (RepName) before initiating the transfer such as “now connecting you to NAME”? 0 = no 1 = yes
Log Do you want to keep track of the number of inquiries that are made against a zip code by inserting a new event record into the log table every time there is a query and also updating the geo table? 0 = no 1 = yes
CampaignID The LocalCampaign ID that this request is being performed for, used primarily for logging stats 101
ForceZip This feature allows us to bypass asking the caller for their zip code and instead forces one for the campaign. 11204
see attachment for clearer instructions