I think I have figured out how to capture the date/time that the agent was connected to the caller. I'd like to have some feedback on my solution and if I'm missing anything. I'm fairly new to the OSDial infrastructure.
In the agi-OSDagent_conf.agi file I added the following lines after the $AGI->answer() method. I also added a column to the osdial_closer_log table called agent_connect_time.
my $connect_time = $osdial->get_datetime();
my $unique_id = $AGI->{uniqueid};
#$osdial->agi_output("Uniqueid: $unique_id");
my $sql = "UPDATE osdial_closer_log SET agent_connect_time='$connect_time' WHERE uniqueid='$unique_id';";
$osdial->agi_output($sql);
my $agent_connect_time = $osdial->sql_query($sql);
This seems to be capturing date datetime stamp in side the table. I should now be able to find the difference in this time and the answer time to calculate the time the caller sat on hold waiting for an agent to answer his/her call.
Thanks for any feedback you might be able to provide.