Manual Dial by Lead_ID instead of Phone_Number

Discussions about development of VICIDIAL and astGUIclient

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

Manual Dial by Lead_ID instead of Phone_Number

Postby williamconley » Sun Apr 17, 2011 11:23 pm

Does the api.php external_dial system have a method to dial by specifying a lead_id directly? (or is there another function that can substitute?)

I think this is our last block to push out an Alpha of the QC. I don't want to push it out with the capability to pull the *WRONG* lead from the same campaign after a lookup (unless no such function exists yet, in which case we'll have to build one!)

Our version of the QC will be a wget of an install script, then will be maintained by direct SVN control in the qc folder inside the vicidial folder (at least during Alpha and then Beta, after that it'll likely change to something akin to the method in use by Vicidial).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20253
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby mflorell » Mon Apr 18, 2011 9:03 am

That is not currently a feature, but I'm sure it could be added.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby Acidshock » Fri Apr 29, 2011 4:19 pm

Could duplicate the external_dial, and put this at the top of the if statement.


Code: Select all
    $value = ereg_replace("[^0-9]","",$value);
    if(strlen($value)>1)
    {
        $stmt = "SELECT `phone_number` FROM `vicidial_list` WHERE `lead_id`='" . $value . "';";
        $rslt=mysql_query($stmt, $link);
        $row=mysql_fetch_row($rslt);   
        $value=$row[0];
    }
     
Acidshock
 
Posts: 430
Joined: Wed Mar 03, 2010 3:19 pm

Postby williamconley » Fri Apr 29, 2011 5:08 pm

Essentially, this is a duplication of what the external dial already does.

the goal isn't to "find" the lead_id (already have the lead id and the phone number).

Value is expected to be a phone number. But it is not linked to a lead id, the system looks up the phone number to get a lead id and may come up with the WRONG lead_id if there are two records with the same phone number.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20253
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby Acidshock » Fri Apr 29, 2011 8:36 pm

Maybe I am misunderstanding the question but wouldnt that bit of code do that. You could supply the lead ID, it will look up the lead ID and grab the phone number for that lead.
Acidshock
 
Posts: 430
Joined: Wed Mar 03, 2010 3:19 pm

Postby williamconley » Fri Apr 29, 2011 8:49 pm

You took ONE lead_id and changed it to a phone number, but that phone number is in No Way linked to the lead_id from which it came.

When it looks up the phone number, and it finds 5 matches in the lists available to this campaign ... it'll take the first one it finds and call it a day. What if the lead_id *I* wanted it to find was the 3rd match? (the lead_id with the SALE and all the recordings on it already ..., not some other one ...).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20253
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby Acidshock » Fri Apr 29, 2011 9:02 pm

Just trying to make sure I am not misunderstanding how Vicidial is processing things but from my understanding the lead_id field is unique and should not be duplicated in the vicidial_list table. If the same lead were loaded from two lists it would have a different lead_id for the each record. The method in which the SQL is being used is also pulling only the record with that exact id too. If Vici is doing something else and I am misunderstanding I would love to know since I enjoy making improvements to it.


Code: Select all
################################################################################
### BEGIN - external_dial - place a manual dial phone call
################################################################################
if ($function == 'external_dial_by_lead')
    {
    $value = ereg_replace("[^0-9]","",$value);
    if(strlen($value)>1)
    {
        $stmt = "SELECT `phone_number` FROM `vicidial_list` WHERE `lead_id`='" . $value . "';";
        $rslt=mysql_query($stmt, $link);
        $row=mysql_fetch_row($rslt);   
        $value=$row[0];
    }
       
    if ( (strlen($value)<2) or ( (strlen($agent_user)<2) and (strlen($alt_user)<2) ) or (strlen($search)<2) or (strlen($preview)<2) or (strlen($focus)<2) )
        {
        $result = 'ERROR';
        $result_reason = "external_dial not valid";
        $data = "$phone_code|$search|$preview|$focus";
        echo "$result: $result_reason - $value|$data|$agent_user|$alt_user\n";
        api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
        }

<code continues but cut off early for easy reading.>
Acidshock
 
Posts: 430
Joined: Wed Mar 03, 2010 3:19 pm

Postby williamconley » Fri Apr 29, 2011 9:21 pm

Yep. Lead ID is unique. But external dial doesn't use Lead ID to get to the lead, it uses phone number.

YOU used lead ID to get a phone number. Then you passed the phone number back to the external dial function.

It now has a phone number (that is NOT connected to a lead id). The uniqueness of the lead_id was useful to get the phone number (you definitely got the right lead!). But then you pass the Phone Number to the rest of the script which does ANOTHER LOOKUP. (It does not "Just make the call", it looks up the lead! Again! If it does not look it up, it CREATES a NEW lead, but one way or another we are NOT guaranteed to get the SAME lead_id that you used to get that phone number to begin with.

Think of it like this, you are on a roundabout with 327 exits. You know that you want exit 219 and you tell the driver 219. The driver turns at 219, remembers that the road was BLUE at the intersection. The next day, while you're sleeping, he makes the turn without asking you ... by turning at the BLUE intersection. Is it the SAME intersection? What if there are two blue ones?

the point is that when you pass the phone number to the rest of the script, it is going to look it up again. And it will not be using any criteria other than the phone number in the available lists. You've already "used and discarded" the lead_id value ... and it has nowhere to store it and use it. Easily fixed, but not done already (and will have to thread through to the end to make it happen).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20253
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby mflorell » Sat Apr 30, 2011 10:33 am

I just committed to SVN/trunk the ability to use external_dial Agent API function with a defined lead_id and optional alt_dial setting.

Docs have been updated:
http://vicidial.org/docs/AGENT_API.txt

The change affects the api.php and vicidial.php scripts
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Sat Apr 30, 2011 10:45 am

You just made my day. 8)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20253
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Development

Who is online

Users browsing this forum: No registered users and 15 guests