Refactor the way we track events. Testing needed, please. Lots of bugs to be found, for sure.

This commit is contained in:
Joao Mesquita
2010-04-05 03:03:06 -03:00
parent a763ddff81
commit 1b919f2c6f
9 changed files with 293 additions and 233 deletions

View File

@@ -32,18 +32,7 @@
#include <fshost.h>
Call::Call()
{
}
Call::Call(int call_id, QString cid_name, QString cid_number, fscomm_call_direction_t direction, QString uuid) :
_call_id(call_id),
_cid_name(cid_name),
_cid_number(cid_number),
_direction(direction),
_uuid (uuid)
{
_isActive = false;
}
{}
switch_status_t Call::toggleRecord(bool startRecord)
{
@@ -56,14 +45,14 @@ switch_status_t Call::toggleRecord(bool startRecord)
_recording_filename = QString("%1/.fscomm/recordings/%2_%3.wav").arg(
conf_dir.absolutePath(),
QDateTime::currentDateTime().toString("yyyyMMddhhmmss"),
_cid_number);
status = g_FSHost.sendCmd("uuid_record", QString("%1 start %2").arg(_uuid, _recording_filename).toAscii().data(),&result);
getCidNumber());
status = g_FSHost.sendCmd("uuid_record", QString("%1 start %2").arg(getUuid(), _recording_filename).toAscii().data(),&result);
}
else
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stopping call recording on call [%s]\n",
_uuid.toAscii().data());
status = g_FSHost.sendCmd("uuid_record", QString("%1 stop %2").arg(_uuid, _recording_filename).toAscii().data(),&result);
getUuid().toAscii().data());
status = g_FSHost.sendCmd("uuid_record", QString("%1 stop %2").arg(getUuid(), _recording_filename).toAscii().data(),&result);
}
return status;
@@ -74,7 +63,7 @@ void Call::sendDTMF(QString digit)
QString result;
QString dtmf_string = QString("dtmf %1").arg(digit);
if (g_FSHost.sendCmd("pa", dtmf_string.toAscii(), &result) == SWITCH_STATUS_FALSE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not send DTMF digit %s on call[%s]", digit.toAscii().data(), _uuid.toAscii().data());
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not send DTMF digit %s on call[%s]", digit.toAscii().data(), getUuid().toAscii().data());
QMessageBox::critical(0, QWidget::tr("DTMF Error"), QWidget::tr("There was an error sending DTMF, please report this bug."), QMessageBox::Ok);
}
}