提交 77934260 authored 作者: João Mesquita's avatar João Mesquita

Fix segv when switching from a call that was previously hungup.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16432 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0ecda2f0
......@@ -49,6 +49,7 @@ class Call {
public:
Call();
Call(int call_id, QString cid_name, QString cid_number, fscomm_call_direction_t direction, QString uuid);
/*~Call() { qDebug() << "I am being freed uuid: " << _uuid; }*/
QString getCidName(void) { return _cid_name; }
QString getCidNumber(void) { return _cid_number; }
int getCallID(void) { return _call_id; }
......
......@@ -162,6 +162,15 @@ switch_status_t FSHost::processAlegEvent(switch_event_t * event, QString uuid)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
QSharedPointer<Call> call = _active_calls.value(uuid);
if (call.isNull())
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "We don't have a call object for A leg on event %s.\n", switch_event_name(event->event_id));
qDebug() << _active_calls.keys();
printEventHeaders(event);
return SWITCH_STATUS_FALSE;
}
/* Inbound call */
if (call.data()->getDirection() == FSCOMM_CALL_DIRECTION_INBOUND)
{
......@@ -226,6 +235,15 @@ switch_status_t FSHost::processBlegEvent(switch_event_t * event, QString buuid)
QString uuid = _bleg_uuids.value(buuid);
switch_status_t status = SWITCH_STATUS_SUCCESS;
QSharedPointer<Call> call = _active_calls.value(uuid);
if (call.isNull())
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "We don't have a call object for B leg on event %s.\n", switch_event_name(event->event_id));
qDebug() << _active_calls.keys();
printEventHeaders(event);
return SWITCH_STATUS_FALSE;
}
/* Inbound call */
if (call.data()->getDirection() == FSCOMM_CALL_DIRECTION_INBOUND)
{
......
......@@ -211,7 +211,9 @@ void MainWindow::callTableDoubleClick(QTableWidgetItem *item)
return;
}
ui->hangupBtn->setEnabled(true);
lastCall.data()->setActive(false);
/* Last call was hungup and we are switching */
if (!lastCall.isNull())
lastCall.data()->setActive(false);
call.data()->setActive(true);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论