Here are the files as attachements for mprDecodeInbandDtmf.

The decoder is linked to the flowgraph in MpConnection.cpp (also attached):

   mpDecodeInBandDtmf = new MprDecodeInBandDtmf( name, this,
samplesPerFrame, samplesPerSec);
   res = pParent->addResource(*mpDecodeInBandDtmf);
   res = pParent->addLink(*mpDecode, 0, *mpDecodeInBandDtmf, 0);


And in the CallLib, I added the following handler to SipConnection.cpp in
order to fire the sipxtapi event

void SipConnection::onInBandDtmf(IMediaEvent_DeviceTypes type, int dtmfCode)
{
 UtlString callId ;
    UtlString remoteAddress ;
    SIPX_MEDIA_TYPE mediaType = (type == IDevice_Audio) ? MEDIA_TYPE_AUDIO :
MEDIA_TYPE_VIDEO;
    getCallId(&callId);
    getRemoteAddress(&remoteAddress);

    CpMultiStringMessage message(CpCallManager::CP_REFIRE_MEDIA_EVENT,
callId,
            remoteAddress, NULL, NULL, NULL,
            MEDIA_REMOTE_DTMF, MEDIA_CAUSE_DTMF_INBAND, mediaType, dtmfCode)
;

    mpCallManager->postMessage(message);
}


And at last, in sipxtapievent.h, I added the MEDIA_CAUSE_DTMF_INBAND def

typedef enum
{
    MEDIA_CAUSE_NORMAL,             /**< Normal cause; the call was likely
torn down.*/
    MEDIA_CAUSE_HOLD,               /**< Media state changed due to a local
or remote
                                         hold operation */
    MEDIA_CAUSE_UNHOLD,             /**< Media state changed due to a local
or remote
                                         unhold operation */
    MEDIA_CAUSE_FAILED,             /**< Media state changed due to an error
condition. */
    MEDIA_CAUSE_DEVICE_UNAVAILABLE, /**< Media state changed due to an error
condition,
                                        (device was removed, already in use,
etc). */
    MEDIA_CAUSE_INCOMPATIBLE,        /**< Incompatible destination -- We
were unable
                                        to negotiate a codec */
 MEDIA_CAUSE_DTMF_START,    /**< A DTMF tone has started */
 MEDIA_CAUSE_DTMF_STOP,    /**< A DTMF tone has stopped */
    MEDIA_CAUSE_DTMF_INBAND

} SIPX_MEDIA_CAUSE ;


I think that's all.

Best regards,

stipus

----- Original Message ----- 
From: "Alexander Chemeris" <[EMAIL PROTECTED]>
To: "stipus" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Thursday, June 14, 2007 12:05 PM
Subject: Re: [sipxtapi-dev] Various methods of detecting DTMF


> Hello,
>
> On 6/14/07, stipus <[EMAIL PROTECTED]> wrote:
> > > > A few month ago, I wrote a mprDecodeInbandDtmf.cpp that works quite
> > well.
> > > >
> > > > I can try to post it here if you are interested.
> > >
> > > I believe we all would be interested. So, please, post it to issue
tracker
> > too.
> > >
> > > I suppose, it detect DTMF, mixed with audio stream, right? Does it use
> > > some third-party library for this?
> >
> > No it doesn't use any third party library. I wrote everything from
scratch.
> >
> > However, it was for a test many months ago, and it's built against an
old
> > rev of
> > sipxtapi-media-update. It's very hard to make a diff with current
version.
>
> Oh, your mailer broke indents. Could you send this files as attachements,
> or, better, create issue in tracker and post them there?
>
> -- 
> Regards,
> Alexander Chemeris.
>
> SIPez LLC.
> SIP VoIP, IM and Presence Consulting
> http://www.SIPez.com
> tel: +1 (617) 273-4000
>
>
>

Attachment: MprDecodeInBandDtmf.cpp
Description: Binary data

Attachment: MprDecodeInbandDtmf.h
Description: Binary data

Attachment: MpConnection.h
Description: Binary data

Attachment: MpConnection.cpp
Description: Binary data

_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to