Example #1
0
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;
	}
}
Example #2
0
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;
}
Example #3
0
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()));
}
Example #4
0
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);
   }
}