mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Remove QObject inheritance from Account and add event for account removal.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16412 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -326,8 +326,7 @@ void FSHost::generalEventHandler(switch_event_t *event)
|
||||
QSharedPointer<Account> acc;
|
||||
if (!_accounts.contains(gw))
|
||||
{
|
||||
Account * accPtr = new Account();
|
||||
accPtr->setName(gw);
|
||||
Account * accPtr = new Account(gw);
|
||||
acc = QSharedPointer<Account>(accPtr);
|
||||
_accounts.insert(gw, acc);
|
||||
emit newAccount(acc);
|
||||
@@ -364,6 +363,11 @@ void FSHost::generalEventHandler(switch_event_t *event)
|
||||
emit accountStateChange(acc);
|
||||
}
|
||||
}
|
||||
else if (strcmp(event->subclass_name, "fscomm::acc_removed") == 0)
|
||||
{
|
||||
QSharedPointer<Account> acc = _accounts.take(switch_event_get_header_nil(event, "acc_name"));
|
||||
emit delAccount(acc);
|
||||
}
|
||||
else
|
||||
{
|
||||
printEventHeaders(event);
|
||||
@@ -388,6 +392,16 @@ switch_status_t FSHost::sendCmd(const char *cmd, const char *args, QString *res)
|
||||
return status;
|
||||
}
|
||||
|
||||
QSharedPointer<Account> FSHost::getAccountByUUID(QString uuid)
|
||||
{
|
||||
foreach(QSharedPointer<Account> acc, _accounts.values())
|
||||
{
|
||||
if (acc.data()->getUUID() == uuid)
|
||||
return acc;
|
||||
}
|
||||
return QSharedPointer<Account>();
|
||||
}
|
||||
|
||||
QSharedPointer<Call> FSHost::getCurrentActiveCall()
|
||||
{
|
||||
foreach(QSharedPointer<Call> call, _active_calls.values())
|
||||
|
Reference in New Issue
Block a user