Inbound Call Routing to "the" outbound agent - Solved
Posted: Tue Aug 06, 2013 6:34 pm
Problem: Single Campaign outbound agent calls type of dialing is "Manual_inbound" Owner only dialing. All the settings are good to go for Outbound. Works great. The problem is on the inbound call with CIDLOOKUP as the In-Group Call Handle Method, the record is found no problem. But we want to route it back to the agent that made the outbound call.
The agents are using a shared AC-CID for outbound so a DID for each agent inbound is not really an option here.
With all the inbound routing options I'm having trouble sorting out how I can get this inbound call back to the agent that made the outbound call...??
Any Ideas?
Asterisk 1.4.44-vici built by abuild @ build09 on a i686 running Linux on 2012-12-17
VERSION: 2.6-395a
BUILD: 130221-1736
© 2013 ViciDial Group
The Preferred Solution:
1. Create an ingroup for each agent - make appropriate no agent no queueing
2. Create an ingroup for failover if the agent is not in the group
3. Write a simple php get variable page with matching mysql to do the lookup
4. Put the extension at the bottom of extensions.conf
5. DID Route calls to this extension and context
6. This will look up the record using the callerid of the party calling in and find the last user to have spoke with this caller
Example php and exten below:
[custom context name]
exten => 8889,1,answer()
exten => 8889,n,NoOp(Testing web integration)
exten => 8889,n,NoOp(Phone number is ${CALLERID(num)})
exten => 8889,n,Set(user=${CURL(http://x.x.x.x/agentlookup.php?phone=${CALLERID(num)})})
exten => 8889,n,GotoIf($["${user}" != ""]?route1)
exten => 8889,n,GotoIf($["${user}" = ""]?route2)
exten => 8889,n(route1),AGI(agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----${user}-----77777777777-----${CALLERID(num)}-----park----------999----------)
exten => 8889,n(route2),AGI(agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----InboundAll-----77777777777-----${CALLERID(num)}-----park----------999----------)
exten => 8889,n,Hangup()
***** Found a better way *****
Route to the Agent direct group. The last variable references the AgentDirect to route to.
agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----AGENTDIRECT-----77777777777-----${CALLERID(num)}-----park----------999---------------${user})
End ***** Found a better way *****
/////agentlookup.php/////
<?php
// Grab Variables from the call
$phone=$_GET['phone'];
// echo "For testing the phone number is $phone";
// Look for Agent that should get the call
$link = $mysql = mysql_connect('x.x.x.x', 'username', 'pass', 'DBNAME') or die(mysql_error());
mysql_select_db('msgasterisk', $mysql);
$result = mysql_query("select last_local_call_time,user from vicidial_list where phone_number = $phone order by last_local_call_time desc limit 0,1;");
$row1 = mysql_fetch_array ( $result );
echo $row1['user'];
?>
The agents are using a shared AC-CID for outbound so a DID for each agent inbound is not really an option here.
With all the inbound routing options I'm having trouble sorting out how I can get this inbound call back to the agent that made the outbound call...??
Any Ideas?
Asterisk 1.4.44-vici built by abuild @ build09 on a i686 running Linux on 2012-12-17
VERSION: 2.6-395a
BUILD: 130221-1736
© 2013 ViciDial Group
The Preferred Solution:
1. Create an ingroup for each agent - make appropriate no agent no queueing
2. Create an ingroup for failover if the agent is not in the group
3. Write a simple php get variable page with matching mysql to do the lookup
4. Put the extension at the bottom of extensions.conf
5. DID Route calls to this extension and context
6. This will look up the record using the callerid of the party calling in and find the last user to have spoke with this caller
Example php and exten below:
[custom context name]
exten => 8889,1,answer()
exten => 8889,n,NoOp(Testing web integration)
exten => 8889,n,NoOp(Phone number is ${CALLERID(num)})
exten => 8889,n,Set(user=${CURL(http://x.x.x.x/agentlookup.php?phone=${CALLERID(num)})})
exten => 8889,n,GotoIf($["${user}" != ""]?route1)
exten => 8889,n,GotoIf($["${user}" = ""]?route2)
exten => 8889,n(route1),AGI(agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----${user}-----77777777777-----${CALLERID(num)}-----park----------999----------)
exten => 8889,n(route2),AGI(agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----InboundAll-----77777777777-----${CALLERID(num)}-----park----------999----------)
exten => 8889,n,Hangup()
***** Found a better way *****
Route to the Agent direct group. The last variable references the AgentDirect to route to.
agi-VDAD_ALL_inbound.agi,CIDLOOKUP-----SO-----AGENTDIRECT-----77777777777-----${CALLERID(num)}-----park----------999---------------${user})
End ***** Found a better way *****
/////agentlookup.php/////
<?php
// Grab Variables from the call
$phone=$_GET['phone'];
// echo "For testing the phone number is $phone";
// Look for Agent that should get the call
$link = $mysql = mysql_connect('x.x.x.x', 'username', 'pass', 'DBNAME') or die(mysql_error());
mysql_select_db('msgasterisk', $mysql);
$result = mysql_query("select last_local_call_time,user from vicidial_list where phone_number = $phone order by last_local_call_time desc limit 0,1;");
$row1 = mysql_fetch_array ( $result );
echo $row1['user'];
?>