void NetworkService::connectionsCallback(shared_ptr<IConnection> connection, ConnectionsManager::ConnectionEvent e) { switch(e) { case ConnectionsManager::connectionAdded: onConnectionAdded(connection); break; case ConnectionsManager::connectionRemoved: onConnectionRemoved(connection); break; default: OS_ASSERTFALSE(); break; } }
OsStatus XCpCall::extractConnection(XSipConnection **pSipConnection) { if (isShutDown()) { OsLock lock(m_memberMutex); if (m_pSipConnection && pSipConnection) { UtlString sSipCallId; m_pSipConnection->getSipCallId(sSipCallId); onConnectionRemoved(sSipCallId); *pSipConnection = m_pSipConnection; m_pSipConnection = NULL; return OS_SUCCESS; } } return OS_FAILED; }
NetworkManager::Connection::Connection(const QString &path, QObject *parent) : QObject(parent) , d_ptr(new ConnectionPrivate(path)) { Q_D(Connection); qDBusRegisterMetaType<NMVariantMapMap>(); QDBusReply<NMVariantMapMap> reply = d->iface.GetSettings(); if (reply.isValid()) { d->updateSettings(reply.value()); } else { d->updateSettings(); } d->path = path; //nmDebug() << m_connection; connect(&d->iface, SIGNAL(Updated()), this, SLOT(onConnectionUpdated())); connect(&d->iface, SIGNAL(Removed()), this, SLOT(onConnectionRemoved())); }
void XCpCall::destroySipConnection(const SipDialog& sSipDialog) { UtlString sSipCallId; { // check that we really have connection with given sip dialog OsLock lock(m_memberMutex); if (m_pSipConnection && m_pSipConnection->compareSipDialog(sSipDialog) != SipDialog::DIALOG_MISMATCH) { // dialog matches sSipDialog.getCallId(sSipCallId); m_pSipConnection->acquireExclusive(); delete m_pSipConnection; m_pSipConnection = NULL; } } if (!sSipCallId.isNull()) { // we destroyed some connection, notify call stack onConnectionRemoved(sSipCallId); } }