Asterisk is not recording calls that are fetched from park. Here is my call flow.
- A calls to Asterisk Server(AS)
- Call is picked up by extension B
- B does an attended transfer by dialling *2200 (200 is my default parking lot)
- C dials 1 to fetch the parked call
- C dials *1 to record the call.
In the asterisk log i found that asterisk tries to record to an invalid file with no filename, just an extension(.wav). It executed 2 files - /var/lib/asterisk/agi-bin/parkfetch.agi and /var/lib/asterisk/bin/one_touch_record.php. one_touch_record.php generates filename from data read from channel, like year, date, mixmonitor folder etc, but as there was no valid filename in the log, these should be null here.
$mixMonDir = getVariable($channel, "MIXMON_DIR");So i inspected the parkfetch.agi were i found that these channel vars are copied only if REC_STATUS is "RECORDING" and in this case REC_STATUS is "INITIALIZED". So i added an OR clause ie i changed if ($rec_status == "RECORDING") to if ($rec_status == "RECORDING" || $rec_status=="INITIALIZED")
$year = getVariable($channel, "YEAR");
$month = getVariable($channel, "MONTH");
$day = getVariable($channel, "DAY");
$mixMonFormat = getVariable($channel, "MIXMON_FORMAT");
$mixMonPost = getVariable($channel, "MIXMON_POST");
$astman->mixmonitor($channel, "{$mixMonDir}{$year}/{$month}/{$day}/{$callFileName}.{$mixMonFormat}", "a", $mixMonPost, rand());
if ($channel)And it worked. Now when I pressed *1 after fetching call from park, it is getting recorded. Hope dev team finds and fix this bug. I was using Asterisk 11.2.1.
{
$rec_status = get_var("IMPORT($channel,REC_STATUS)");
$agi->set_variable('REC_STATUS', $rec_status);
if ($rec_status == "RECORDING" || $rec_status=="INITIALIZED") {
foreach (array('MIXMON_DIR', 'YEAR', 'MONTH', 'DAY', 'CALLFILENAME', 'MIXMON_FORMAT', 'MIXMON_POST', 'MON_FMT') as $v) {
$agi->set_variable($v, get_var("IMPORT($channel,$v)"));
}
}
}
No comments:
Post a Comment