Email sending after Call

Discussions about new features or changes in existing features

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

Email sending after Call

Postby weber43 » Tue Dec 13, 2011 7:25 pm

Is it possible to send a email after the call is end (Dispossion)?
weber43
 
Posts: 1
Joined: Tue Dec 13, 2011 7:23 pm

Postby williamconley » Sun Dec 18, 2011 12:25 pm

1) Welcome to the party!

2) when you post, please post your entire configuration including (but not limited to) your installation method and vicidial version with build.

this IS a requirement for posting along with reading the stickies (at the top of each forum) and the manager's manual (available on EFLO.net, both free and paid versions)

You should also post: Asterisk version, telephony hardware (model number is helpful here), cluster information if you have one, and whether any other software is installed in the box. If your installation method is "from scratch" you must post your operating system and should also post the .iso version from which you installed your original operating system.

If this is a "Cloud" or "Virtual" server, please note the technology involved along with the version of that techology (ie: VMware Server Version 2.0.2). If it is not, merely stating the Motherboard model # and CPU would be helpful.

Similar to This:

Vicibox X.X from .iso | Vicidial X.X.X-XXX Build XXXXXX-XXXX | Asterisk X.X.X | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel DG35EC | Core2Quad Q6600

3) Depends on your version! (Which you did not post.) If you have the appropriate version the "End Call URL" in the Campaign Modify screen will allow execution of a script that can do ... anything.
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby brett05 » Sat Jul 21, 2012 8:27 pm

yes very good idea if in each dispostion for sales vicidial can send a mail auto
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby Acidshock » Tue Aug 21, 2012 5:52 pm

This is already doable. Use the DispoCall URL and pass the info onto a php script which generates an email:

Dispo Call URL - This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. This URL can NOT be a relative path. Default is blank.
VERSION: 2.6-375a | BUILD: 120831-1523 | Asterisk:1.4.39.2-vici | Redux 3.1.15
Acidshock
 
Posts: 260
Joined: Wed Mar 03, 2010 3:19 pm

Re: Email sending after Call

Postby lconsult » Mon Aug 27, 2012 3:55 am

Is Dispo Call URL available for outbound campaigns? In Version 2.4-309a Build 120307-0248, I don't see any outbound information.

Also, is there information on the format to add system and custom form variables to the URL so that those values are added to the URL before it is executed?

Thanks!
lconsult
 
Posts: 1
Joined: Mon Aug 27, 2012 3:47 am

Re: Email sending after Call

Postby Acidshock » Fri Jan 18, 2013 10:47 am

A couple people PM'd me asking for examples so here is a modified and very much simplified version of a script I use. I put the url for it in the DispoCall URL option under the campaign. The URL looks like this:
Code: Select all
http://test.com/myscript.php?dispo=--A--dispo--B--&recording_filename=--A--recording_filename--B--&lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&pass=--A--pass--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&rank=--A--rank--B--&owner=--A--owner--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--

Code: Select all

<?php
error_reporting(E_ALL);
 ini_set('display_errors','On');
    //Written by Drew Gilkey. 2/24/2012
    //Syntax:
    //Lead Disposition emailer
    //Description:
    //Emails information provided from VICIDIAL based on disposition.
    //VICIDIAL is a Open Source Asterisk Based call center solution. Visit them on http://www.vicidial.org
    //License:
    //AGPLv2
     
    set_time_limit(0);
    date_default_timezone_set('America/Los_Angeles');

  function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
    $owner_email = $emailtouse;
    $headers = 'From:' . $emailtouse;
    $subject = 'Agent: ' . $agent . ' ' . $location;
    $messageBody = "";
   
    $messageBody .= 'Agent: ' . $agent  . ' ' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Lead: ' . $lead . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Phone Number: ' . $phone . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Where was the action made: ' . $location . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Customer: ' . $customer . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
   
   

    try{
        if(!mail($owner_email, $subject, $messageBody, $headers)){
            throw new Exception($error_message);
        }else{
            echo $success_message;
        }
    }catch(Exception $e){
        echo $e->getMessage() ."\n";
    }
}


    $user_id = $_REQUEST['user'];
   // $location = $WEB_SERVER . $WEB_PATH .
    $status = $_REQUEST['dispo'];
    $lead_id = $_REQUEST['lead_id'];
    $phone_number = $_REQUEST['phone_number'];
    $filename = $_REQUEST['recording_filename'];
    $customername = $_REQUEST['first_name'] . " " . $_REQUEST['last_name'];

    if($status == "SOLD")
    {
        emailinfo($_REQUEST['user'], "CallCenter1", $lead_id, $phone_number, $customername , " ", " ", " ", "testemail@destination.com");
        //You can also add code here to do something else like store the lead information into another database or table.
    }


?>

VERSION: 2.6-375a | BUILD: 120831-1523 | Asterisk:1.4.39.2-vici | Redux 3.1.15
Acidshock
 
Posts: 260
Joined: Wed Mar 03, 2010 3:19 pm

Re: Email sending after Call

Postby brett05 » Fri Jan 18, 2013 3:55 pm

thankkkkkkkkkkkkkkkkkkkkkkkkkkks
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby williamconley » Fri Jan 18, 2013 5:54 pm

Acidshock wrote:A couple people PM'd me asking for examples so here is a modified and very much simplified version of a script I use. I put the url for it in the DispoCall URL option under the campaign. The URL looks like this:
...

That, sir, was a beautiful post. Very cool. :)
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby brett05 » Sat Jan 19, 2013 7:05 am

i have try it but he don't send any mail ??

do you have a idea
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby brett05 » Sat Jan 19, 2013 7:08 am

it's working sorry
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby brett05 » Sat Jan 19, 2013 8:44 am

Code: Select all
 function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
    $owner_email = $emailtouse;
    $headers = 'From:' . $emailtouse;
    $subject = 'Agent: ' . $agent . ' ' . $location;
    $messageBody = "";
   
    $messageBody .= 'Agent: ' . $agent  . ' ' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Lead: ' . $lead . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Phone Number: ' . $phone . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Where was the action made: ' . $location . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Customer: ' . $customer . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Additional information: ' . $addinfo . "" . "\n";


this will only sent agent name ,lead number , phone number, action made , customer and i want other messageBody as campaign name address, city etc..
ant one have a idea please
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby Acidshock » Sat Jan 19, 2013 1:05 pm

Quick and dirty way is to just add the info into the messageBody..

Code: Select all
function emailinfo($agent, $location, $lead, $phone, $customer, $addinfo = "NA", $error_message = "Log was not sent" , $success_message = "Log was sent",$emailtouse = "test@test.com" )
{
    $owner_email = $emailtouse;
    $headers = 'From:' . $emailtouse;
    $subject = 'Agent: ' . $agent . ' ' . $location;
    $messageBody = "";
   
    $messageBody .= 'Agent: ' . $agent  . ' ' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Lead: ' . $lead . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Phone Number: ' . $phone . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Where was the action made: ' . $location . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Customer: ' . $customer . '' . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Additional information: ' . $addinfo . "" . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Campaign: ' . $_REQUEST['campaign'] . "" . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'Address: ' . $_REQUEST['address1'] . "" . "\n";
    $messageBody .= '' . "\n";
    $messageBody .= 'City: ' . $_REQUEST['city'] . "" . "\n";



In the example above I simply add the variables that were passed to the script directly into the function. If you look at the URL you see &campaign=... Well that is the variable. So Simply use $_REQUEST['campaign'] to pull that information. You can follow the pattern above to format the message body.
VERSION: 2.6-375a | BUILD: 120831-1523 | Asterisk:1.4.39.2-vici | Redux 3.1.15
Acidshock
 
Posts: 260
Joined: Wed Mar 03, 2010 3:19 pm

Re: Email sending after Call

Postby brett05 » Sat Jan 19, 2013 1:27 pm

i have try request variable before but with no result
really thank
i finaly question please ? it"s there a solution to send the record of status as attachement in mail ; not sendind the filename
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby Acidshock » Sun Jan 20, 2013 1:35 am

What type of attachment?
VERSION: 2.6-375a | BUILD: 120831-1523 | Asterisk:1.4.39.2-vici | Redux 3.1.15
Acidshock
 
Posts: 260
Joined: Wed Mar 03, 2010 3:19 pm

Re: Email sending after Call

Postby brett05 » Sun Jan 20, 2013 6:53 am

exemple the email script he will sent in each time the diso with lead information to the mail destination
it is possible to send with this information the recording wav or mp3 of the lead dispo as attachement mail
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby Acidshock » Mon Jan 21, 2013 7:27 pm

Do you need the actual mp3/wav attached or is a URL ok? Actual attachment is possible but you would have to have some background processes to catch the recording after conversion/compression. You wouldnt want to send a wav file for a 2 hour call via email.
VERSION: 2.6-375a | BUILD: 120831-1523 | Asterisk:1.4.39.2-vici | Redux 3.1.15
Acidshock
 
Posts: 260
Joined: Wed Mar 03, 2010 3:19 pm

Re: Email sending after Call

Postby brett05 » Mon Jan 21, 2013 8:14 pm

HI url call it's not ok
--A--recording_filename--B&--A--recording_id--B it"s show as recording_filename recording_id he not show the url of recording i think this is a bug in call dispo url because in webform it's working
but i welcom your solution to test it about to have some background processes to catch the recording after conversion/compression.;..

thnaks
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby williamconley » Mon Jan 21, 2013 8:20 pm

recording may not be available during dispo. you may need to build in a delay to the sending script in some fashion. remember that this file must be mixed and compressed before it lands in its final destination (and possibly even ftpd!)
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby brett05 » Tue Jan 22, 2013 7:49 am

yes i confrme the same thing but i think this is possible
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby williamconley » Tue Jan 22, 2013 9:37 pm

you could either build a delay into the request ... so the script would sit there for XX minutes hoping the recording is available when it "fires" (lazy!)

or you could create a DB entry which is then checked by another process every 10 minutes and checked for availability of the recordings and sends those that are available. (slow and more involved)
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby brett05 » Wed Jan 23, 2013 2:02 pm

Why recording_filename and talk_time if I insert them with dispo call URL it show no information but it's working in webform or script
Any solution to show the call recording filename and the time and date of the call
Thanks
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby williamconley » Wed Jan 23, 2013 10:53 pm

possibly because the web form or script may pull the data from a different place ... or perhaps they are wrong. how can the webform have the talk time if the call is not yet over? Seems a little odd to me ... 8-)
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby gardo » Wed Jan 23, 2013 11:18 pm

A cron job doing all those can do the trick. Send the email with the sales recording attached to it. 15 minute interval can be a good starting point. By default the recordings are mixed (and FTPed) every 5 minutes.
GoAutoDial v3.0 RC1a is out! Featuring the all-new GOadmin and GOreports applications.
Download it here: http://goautodial.org.
gardo
 
Posts: 1682
Joined: Fri Sep 15, 2006 10:24 am
Location: Manila, 1004

Re: Email sending after Call

Postby brett05 » Thu Jan 24, 2013 9:04 am

Re: Email sending after Call
by gardo » Thu Jan 24, 2013 4:18 am

A cron job doing all those can do the trick. Send the email with the sales recording attached to it. 15 minute interval can be a good starting point. By default the recordings are mixed (and FTPed) every 5 minutes.


do you have a script used before or try it ?
Jasperreports & Queuemetrics & SugarCRM integration - Customization and Add-ons
Freepbx||Billing||Centos||Opensuse||Debian||Centos||Fedora||Sangoma||Diguim
brett05
 
Posts: 569
Joined: Sun May 24, 2009 5:48 pm
Location: tunisia

Re: Email sending after Call

Postby williamconley » Fri Jan 25, 2013 11:09 am

the main script is already listed here. to make it a cronjob requires a little modification to select the appropriate leads and supply the data to the rest of the already built script.
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby roll72 » Tue Mar 05, 2013 6:31 pm

Hello,

I'm been using Call Dispo URL as mentionned below for automatic survey campaign (using 8366 ). My purpose is to receive an email each time somebody is pressing a number after the voice message. But unfortunatly it is not working. Does the Call Dispo is working only with manual campaign and humain agent and not Survey campaign ?

my dispo Call URL :
VARhttp://xxx.xxx.xxx.xxx:82/sms2mailII ... umber--B--

I tested my remote URL by hand and from my vicidial server using a wget, and all is working correctly. I checked all the logs I can found to see if there is any clue but nothing.

I tested as well the following ULR as Dispo Call URL and I couldn't find any generated logs.
VARhttp://myvicidialip/agc/vdc_call_url ... dispo--B--

Does someone got similar issue ?

My vicidial is as follow :
VERSION: 2.2.1-237
BUILD: 100510-2015
roll72
 
Posts: 72
Joined: Wed Jun 10, 2009 12:32 pm

Re: Email sending after Call

Postby williamconley » Tue Mar 05, 2013 7:13 pm

dispo call url only works when the call is dispo'd by an agent. later versions have a "no agent url". consider upgrading :)
Vicidial Installation - SugarCRM integration - Customization and Add-ons
We Bring It All Together.
www.PoundTeam.com
williamconley
 
Posts: 12552
Joined: Wed Oct 31, 2007 4:17 pm
Location: Auburn, NY (Upstate)

Re: Email sending after Call

Postby roll72 » Wed Mar 06, 2013 2:07 am

Thanks for your quick answer.

I'm checking now the forum for the update.
roll72
 
Posts: 72
Joined: Wed Jun 10, 2009 12:32 pm


Return to Features

Who is online

Users browsing this forum: No registered users and 2 guests