I have made the following changes intended for : CE:Apps / voicecall Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below.
https://build.pub.meego.com//request/show/7418 Thank You, tswindell [This message was auto-generated] --- Request # 7418: Messages from BOSS: State: review at 2012-11-19T16:53:30 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:tswindell:CE:Apps / voicecall -> CE:Apps / voicecall changes files: -------------- --- voicecall.changes +++ voicecall.changes @@ -0,0 +1,4 @@ +* Mon Nov 19 2012 Tom Swindell <[email protected]> - 0.2.5 +- Implemented telepathy call handler duration timer +- Updated call declarative interface to provide notify signal + old: ---- voicecall-0.2.4.tar.gz new: ---- voicecall-0.2.5.tar.gz spec files: ----------- --- voicecall.spec +++ voicecall.spec @@ -1,6 +1,6 @@ Name: voicecall Summary: Voice Call Suite -Version: 0.2.4 +Version: 0.2.5 Release: 1 Group: Communications/Telephony and IM License: Apache License, Version 2.0 other changes: -------------- ++++++ voicecall-0.2.4.tar.gz -> voicecall-0.2.5.tar.gz --- lib/src/abstractvoicecallhandler.h +++ lib/src/abstractvoicecallhandler.h @@ -37,7 +37,7 @@ Q_PROPERTY(VoiceCallStatus status READ status NOTIFY statusChanged) Q_PROPERTY(QString statusText READ statusText NOTIFY statusChanged) Q_PROPERTY(QString lineId READ lineId NOTIFY lineIdChanged) - Q_PROPERTY(QDateTime startedAt READ startedAt) + Q_PROPERTY(QDateTime startedAt READ startedAt NOTIFY startedAtChanged) Q_PROPERTY(int duration READ duration NOTIFY durationChanged) Q_PROPERTY(bool isEmergency READ isEmergency NOTIFY emergencyChanged) Q_PROPERTY(bool isMultiparty READ isMultiparty NOTIFY multipartyChanged) @@ -72,6 +72,7 @@ Q_SIGNALS: void statusChanged(); void lineIdChanged(); + void startedAtChanged(); void durationChanged(); void emergencyChanged(); void multipartyChanged(); --- plugins/declarative/src/voicecallhandler.cpp +++ plugins/declarative/src/voicecallhandler.cpp @@ -66,6 +66,7 @@ success &= QObject::connect(d->interface, SIGNAL(statusChanged()), SIGNAL(statusChanged())); success &= QObject::connect(d->interface, SIGNAL(lineIdChanged()), SIGNAL(lineIdChanged())); success &= QObject::connect(d->interface, SIGNAL(durationChanged()), SIGNAL(durationChanged())); + success &= QObject::connect(d->interface, SIGNAL(startedAtChanged()), SIGNAL(startedAtChanged())); success &= QObject::connect(d->interface, SIGNAL(emergencyChanged()), SIGNAL(emergencyChanged())); success &= QObject::connect(d->interface, SIGNAL(multipartyChanged()), SIGNAL(multipartyChanged())); } --- plugins/declarative/src/voicecallhandler.h +++ plugins/declarative/src/voicecallhandler.h @@ -17,7 +17,7 @@ Q_PROPERTY(int status READ status NOTIFY statusChanged) Q_PROPERTY(QString statusText READ statusText NOTIFY statusChanged) Q_PROPERTY(QString lineId READ lineId NOTIFY lineIdChanged) - Q_PROPERTY(QDateTime startedAt READ startedAt) + Q_PROPERTY(QDateTime startedAt READ startedAt NOTIFY startedAtChanged) Q_PROPERTY(int duration READ duration NOTIFY durationChanged) Q_PROPERTY(bool isEmergency READ isEmergency NOTIFY emergencyChanged) Q_PROPERTY(bool isMultiparty READ isMultiparty NOTIFY multipartyChanged) @@ -52,6 +52,7 @@ void statusChanged(); void lineIdChanged(); void durationChanged(); + void startedAtChanged(); void emergencyChanged(); void multipartyChanged(); --- plugins/declarative/src/voicecallmanager.cpp +++ plugins/declarative/src/voicecallmanager.cpp @@ -213,12 +213,6 @@ TRACE Q_D(VoiceCallManager); - if(d->activeVoiceCall) - { - d->activeVoiceCall->sendDtmf(tone); - } - - /* bool ok = true; unsigned int toneId = tone.toInt(&ok); @@ -234,7 +228,11 @@ } d->tonegend->call("StartEventTone", toneId, 0, (unsigned int)0); - */ + + if(d->activeVoiceCall) + { + d->activeVoiceCall->sendDtmf(tone); + } return true; } --- plugins/telepathy/src/telepathyhandler.cpp +++ plugins/telepathy/src/telepathyhandler.cpp @@ -25,7 +25,7 @@ public: TelepathyHandlerPrivate(TelepathyHandler *q, const QString &id, Tp::ChannelPtr c, const QDateTime &s, TelepathyProvider *p) : q_ptr(q), handlerId(id), provider(p), startedAt(s), status(AbstractVoiceCallHandler::STATUS_NULL), - channel(c), fsChannel(NULL) + channel(c), fsChannel(NULL), duration(0), durationTimerId(-1) { /* ... */ } TelepathyHandler *q_ptr; @@ -39,6 +39,9 @@ Tp::ChannelPtr channel; // CallChannel or StreamedMediaChannel FarstreamChannel *fsChannel; + + int duration; + int durationTimerId; }; TelepathyHandler::TelepathyHandler(const QString &id, Tp::ChannelPtr channel, const QDateTime &userActionTime, TelepathyProvider *provider) @@ -47,6 +50,8 @@ TRACE Q_D(const TelepathyHandler); + QObject::connect(this, SIGNAL(statusChanged()), SLOT(onStatusChanged())); + Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel); if(callChannel && !callChannel.isNull()) { @@ -81,6 +86,8 @@ SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)), SLOT(onStreamedMediaChannelInvalidated(Tp::DBusProxy*,QString,QString))); } + + emit this->startedAtChanged(); } TelepathyHandler::~TelepathyHandler() @@ -122,7 +129,7 @@ { TRACE Q_D(const TelepathyHandler); - return d->startedAt.secsTo(QDateTime()); + return d->duration; } bool TelepathyHandler::isMultiparty() const @@ -243,7 +250,23 @@ TRACE Q_D(TelepathyHandler); Tp::Client::ChannelInterfaceDTMFInterface *dtmfIface = new Tp::Client::ChannelInterfaceDTMFInterface(d->channel.data(), this); - dtmfIface->MultipleTones(tones); + + bool ok = true; + unsigned int toneId = tones.toInt(&ok); + + if(!ok) + { + if (tones == "*") toneId = 10; + else if(tones == "#") toneId = 11; + else if(tones == "A") toneId = 12; + else if(tones == "B") toneId = 13; + else if(tones == "C") toneId = 14; + else if(tones == "D") toneId = 15; + else return; + } + + dtmfIface->StartTone(0, toneId, 50); + //dtmfIface->MultipleTones(tones); } void TelepathyHandler::onCallChannelChannelReady(Tp::PendingOperation *op) @@ -640,3 +663,33 @@ } } } + +void TelepathyHandler::timerEvent(QTimerEvent *event) +{ + TRACE + Q_D(TelepathyHandler); + int status = this->status(); + + if(event->timerId() == d->durationTimerId && (status == STATUS_ACTIVE || status == STATUS_HELD)) + { + d->duration += 1; + emit this->durationChanged(); + } +} + +void TelepathyHandler::onStatusChanged() +{ + TRACE + Q_D(TelepathyHandler); + int status = this->status(); + + if((status == STATUS_ACTIVE || status == STATUS_HELD) && d->durationTimerId == -1) + { + d->durationTimerId = this->startTimer(1000); + } + else + { + this->killTimer(d->durationTimerId); + d->durationTimerId = -1; + } +} --- plugins/telepathy/src/telepathyhandler.h +++ plugins/telepathy/src/telepathyhandler.h @@ -45,6 +45,8 @@ void sendDtmf(const QString &tones); protected Q_SLOTS: + void onStatusChanged(); + // TODO: Remove when tp-ring updated to call channel interface. // StreamedMediaChannel Interface Handling void onStreamedMediaChannelReady(Tp::PendingOperation *op); @@ -78,6 +80,9 @@ // Telepathy Farstream Interface Handling void onFarstreamCreateChannelFinished(Tp::PendingOperation *op); +protected: + void timerEvent(QTimerEvent *event); + private: class TelepathyHandlerPrivate *d_ptr;
