2010-01-20 00:11:40 -05:00
|
|
|
#include <QtGui>
|
2010-01-18 23:03:34 -05:00
|
|
|
#include "account.h"
|
2010-07-03 12:37:32 -04:00
|
|
|
#include "fscomm.h"
|
2010-01-18 23:03:34 -05:00
|
|
|
|
2010-01-20 00:11:40 -05:00
|
|
|
Account::Account(QString name) :
|
|
|
|
_name(name)
|
2010-01-18 23:03:34 -05:00
|
|
|
{
|
2010-01-24 15:18:24 -05:00
|
|
|
_statusCode = QString();
|
|
|
|
_statusPhrase = QString();
|
|
|
|
|
2010-01-20 00:11:40 -05:00
|
|
|
QSettings settings;
|
|
|
|
settings.beginGroup("FreeSWITCH/conf/sofia.conf/profiles/profile/gateways");
|
|
|
|
foreach(QString g, settings.childGroups())
|
|
|
|
{
|
|
|
|
settings.beginGroup(g);
|
|
|
|
if(settings.value("gateway/attrs/name").toString() == name)
|
|
|
|
{
|
|
|
|
_uuid = g;
|
2010-01-24 15:18:24 -05:00
|
|
|
settings.endGroup();
|
2010-01-20 00:11:40 -05:00
|
|
|
break;
|
|
|
|
}
|
2010-01-24 15:18:24 -05:00
|
|
|
settings.endGroup();
|
2010-01-20 00:11:40 -05:00
|
|
|
}
|
2010-01-18 23:03:34 -05:00
|
|
|
}
|
2010-01-24 15:18:24 -05:00
|
|
|
|
|
|
|
QString Account::getStateName()
|
|
|
|
{
|
|
|
|
if (_statusPhrase.isEmpty())
|
|
|
|
return fscomm_gw_state_names[_state];
|
|
|
|
|
|
|
|
return QString("%1 - %2").arg(fscomm_gw_state_names[_state], _statusPhrase);
|
|
|
|
}
|