~boiko/telepathy-ofono/update_tp_qt

« back to all changes in this revision

Viewing changes to ofonoconferencecallchannel.cpp

  • Committer: CI bot
  • Author(s): Tiago Salem Herrmann
  • Date: 2014-09-18 13:31:04 UTC
  • mfrom: (105.1.3 fix-dtmf-crash)
  • Revision ID: ps-jenkins@lists.canonical.com-20140918133104-3hf310eqm5scpcmi
Do not process ofono dtmf dbus response if the channel is not active. Fixes: 1370106
Approved by: PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
    mCallChannel->setCallState(Tp::CallStateActive, 0, reason, stateDetails);
161
161
 
162
162
    mDTMFIface = Tp::BaseCallContentDTMFInterface::create();
 
163
    mCallContent = Tp::BaseCallContent::create(baseChannel()->dbusConnection(), baseChannel().data(), "audio", Tp::MediaStreamTypeAudio, Tp::MediaStreamDirectionNone);
 
164
 
 
165
    mDTMFIface = Tp::BaseCallContentDTMFInterface::create();
 
166
    mCallContent->plugInterface(Tp::AbstractCallContentInterfacePtr::dynamicCast(mDTMFIface));
 
167
    mCallChannel->addContent(mCallContent);
163
168
 
164
169
    mDTMFIface->setStartToneCallback(Tp::memFun(this,&oFonoConferenceCallChannel::onDTMFStartTone));
165
170
    mDTMFIface->setStopToneCallback(Tp::memFun(this,&oFonoConferenceCallChannel::onDTMFStopTone));
231
236
 
232
237
void oFonoConferenceCallChannel::onDtmfComplete(bool success)
233
238
{
 
239
    // this might be a response for another channel
 
240
    if (mCallChannel->callState() != Tp::CallStateActive) {
 
241
        return;
 
242
    }
234
243
    mDtmfLock = false;
235
244
    if (success) {
236
 
        mDtmfPendingStrings.removeFirst();
 
245
       if (mDtmfPendingStrings.count() > 0) {
 
246
           mDtmfPendingStrings.removeFirst();
 
247
       }
237
248
       if (mDtmfPendingStrings.isEmpty()) {
238
249
           return;
239
250
       }