3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
6 Based on Telepathy-SNOM with copyright notice below.
10 * Telepathy SNOM VoIP phone connection manager
11 * Copyright (C) 2006 by basyskom GmbH
12 * @author Tobias Hunger <info@basyskom.de>
14 * This library is free software; you can redisQObject::tribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License version 2.1 as published by the Free Software Foundation.
18 * This library is disQObject::tributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the
25 * Free Software Foundation, Inc.,
26 * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA
32 #include <QtCore/QCoreApplication>
33 #include <QtCore/QDebug>
35 #include <QtDBus/QDBusConnection>
36 #include <QtDBus/QDBusMetaType>
37 #include <QtDBus/QDBusInterface>
42 #include "connectionmanager.h"
43 #include "basetypes.h"
44 #include "connectionmanagertypes.h"
45 #include "connectiontypes.h"
46 #include "connectioninterfacerequeststypes.h"
47 #include "connectioninterfacecapabilitiestypes.h"
55 void MyOutputHandler(QtMsgType type, const char *msg) {
58 logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n";
61 logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n";
64 logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n";
67 logfile << QTime::currentTime().toString().toAscii().data() << " Fatal: " << msg << "\n";
74 int main(int argc, char ** argv)
77 // logfile.open("/var/log/logfile.txt", ios::app);
78 // #ifndef QT_NO_DEBUG_OUTPUT
79 // qInstallMsgHandler(MyOutputHandler);
83 QCoreApplication app(argc, argv);
86 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinition>();
87 qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinitionList>();
88 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfo>();
89 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfoList>();
90 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
91 qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
92 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilities>();
93 qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilitiesList>();
94 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPair>();
95 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPairList>();
96 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChange>();
97 qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChangeList>();
98 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
99 qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
101 QDBusConnection connection = QDBusConnection::sessionBus();
103 if (!connection.interface()->isServiceRegistered(cm_service_name))
106 // register CM on D-BUS:
107 bool success = connection.registerService(cm_service_name);
109 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Service %1 registered with session bus.").
110 arg(cm_service_name)));
114 QDBusError error = connection.interface()->lastError();
116 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register service %1 with session bus due to error %2.").
117 arg(cm_service_name,error.message())));
122 ConnectionManager connection_mgr(&app);
123 if (!connection.registerObject(cm_object_path,&connection_mgr)){
124 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register VICaR connection manager at path %1 with session bus.").
125 arg(cm_object_path)));
128 qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Enternig main loop.")));