forked from signalwire/freeswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.cpp
More file actions
32 lines (28 loc) · 759 Bytes
/
Copy pathaccount.cpp
File metadata and controls
32 lines (28 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <QtGui>
#include "account.h"
#include "fscomm.h"
Account::Account(QString name) :
_name(name)
{
_statusCode = QString();
_statusPhrase = QString();
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;
settings.endGroup();
break;
}
settings.endGroup();
}
}
QString Account::getStateName()
{
if (_statusPhrase.isEmpty())
return fscomm_gw_state_names[_state];
return QString("%1 - %2").arg(fscomm_gw_state_names[_state], _statusPhrase);
}