~ubuntu-branches/ubuntu/utopic/resiprocate/utopic

« back to all changes in this revision

Viewing changes to resip/recon/MediaInterface.cxx

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2014-03-25 21:34:22 UTC
  • mfrom: (18.1.26 sid)
  • Revision ID: package-import@ubuntu.com-20140325213422-s8qr5lsrnjfkbm8i
* New upstream release
* Fix crash in librecon when UA is not using
  a UserProfile derived from ConversationProfile (Closes: #742638)
* Ensure consistent use of milliseconds in DTMF tone API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
         {
74
74
            MiDtmfNotf* pDtmfNotfMsg = (MiDtmfNotf*)&msg;
75
75
 
 
76
            int duration = pDtmfNotfMsg->getDuration();  // in RTP timestamp units
 
77
            int durationMS = duration;
 
78
            if(duration >= 0) // negative durations indicate start of tone in sipXtapi
 
79
            {
 
80
               int rtpClockRate = 8000;   // FIXME - should use actual RTP clock rate of the flow graph?
 
81
               durationMS = (duration * 1000) / rtpClockRate;   //  convert from RTP timestamp units to milliseconds
 
82
               StackLog(<< "RTP clock rate = " << rtpClockRate << "Hz, duration (timestamp units) = " << duration << " = " << durationMS << "ms");
 
83
            }
 
84
 
76
85
            // Get event into dum queue, so that callback is on dum thread
77
 
            DtmfEvent* devent = new DtmfEvent(mConversationManager, mOwnerConversationHandle, pNotfMsg->getConnectionId(), pDtmfNotfMsg->getKeyCode(), pDtmfNotfMsg->getDuration(), pDtmfNotfMsg->getKeyPressState()==MiDtmfNotf::KEY_UP);
 
86
            DtmfEvent* devent = new DtmfEvent(mConversationManager, mOwnerConversationHandle, pNotfMsg->getConnectionId(), pDtmfNotfMsg->getKeyCode(), durationMS, pDtmfNotfMsg->getKeyPressState()==MiDtmfNotf::KEY_UP);
78
87
            mConversationManager.post(devent);
79
88
 
80
89
            InfoLog( << "MediaInterface: received MI_NOTF_DTMF_RECEIVED, sourceId=" << pNotfMsg->getSourceId().data() <<