# Bug in DTMF Decode sample?

**URL:** <https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462>\
**Category:** Open AT\
**Created:** [June 1, 2010, 4:54pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462 "2010-06-01T16:54:03Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 1, 2010, 4:54pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/1 "2010-06-01T16:54:03Z")

</div>

I built the DTM Detection sample, unmodified, and downloaded it to a Fastrack Xtend with R7.4a.

It detects DTMF, but almost always gives a “double” trigger - a short false trigger, followed by the true symbol; eg,

> [@DTM Detection sample](#):
>
> received post-processed DTMF : 2 ; duration : 20 ms  
> received post-processed DTMF : 2 ; duration : 400 ms  
> received post-processed DTMF : 3 ; duration : 10 ms  
> received post-processed DTMF : 3 ; duration : 390 ms  
> received post-processed DTMF : 4 ; duration : 20 ms  
> received post-processed DTMF : 4 ; duration : 410 ms

The DTMF spec requires a minimum of 40ms before a valid symbol is recognised, so these can’t be right (at only 10 or 20ms) - so there must be a bug somewhere…

Yes, it’d be easy enough to work-around by having the application ignore any “too-short” symbols - but it shouldn’t be necessary!

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 2, 2010, 1:43am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/2 "2010-06-02T01:43:51Z")

</div>

Hiya,

I know this doesn’t help the fact that the DTMF example is misbehaving, but…

I don’t recall seeing the issue that you are having, but below is the DTMF setup code that I’m using without any troubles.

```auto
void voice_dtmfSubscribe( void )
{
        s32 ret;
        s32 bufferSize;

        s32 rawSampleDuration;
        s32 dtmfDuration;

        // subscribe to Audio Stream
        Voice_DtmfAudioStreamHandle = adl_audioSubscribe( ADL_AUDIO_VOICE_CALL_RX,
                                voice_dtmfAudioEventHandler, ADL_AUDIO_RESOURCE_OPTION_FORBID_PREEMPTION );

        ret = adl_audioGetOption( Voice_DtmfAudioStreamHandle,
                        ADL_AUDIO_RAW_DTMF_SAMPLE_DURATION, &rawSampleDuration);
        TRACE ((TRACE_VOICE_BASE, "DTMF: audioGetOption returns [%d], dtmf duration = [%d]", ret, rawSampleDuration));

        dtmfDuration = rawSampleDuration * ADL_AUDIO_MAX_DTMF_PER_FRAME * 10;

        // configure buffer and stream options
    ret = adl_audioSetOption ( Voice_DtmfAudioStreamHandle,
                                ADL_AUDIO_DTMF_DETECT_BLANK_DURATION, dtmfDuration );
        TRACE ((TRACE_VOICE_BASE, "DTMF: audioSetOption returns [%d], duration = [%d]", ret, dtmfDuration));

        ret = adl_audioGetOption( Voice_DtmfAudioStreamHandle,
                        ADL_AUDIO_DTMF_PROCESSED_STREAM_BUFFER_SIZE, &bufferSize);
        TRACE ((TRACE_VOICE_BASE, "DTMF: audioGetOption returns [%d], buffer = [%d]", ret, bufferSize));

        // Buffer Memory Allocation
        if (Voice_DtmfStreamBuffer != NULL)
        {
                adl_memRelease( Voice_DtmfStreamBuffer );
        }
        Voice_DtmfStreamBuffer = adl_memGet( bufferSize );

        // now connect to the audio stream
        ret = adl_audioStreamListen(Voice_DtmfAudioStreamHandle, ADL_AUDIO_DTMF,
                                        Voice_DtmfLowIrqHandle, Voice_DtmfHighIrqHandle, Voice_DtmfStreamBuffer );
        TRACE ((TRACE_VOICE_BASE, "DTMF audioStreamListen returns [%d]", ret));

        return;
}
```

Note that I am setting the DTMF duration and the blank duration myself…can’t remember why this was done, but it did come out of one of the app notes or the ADL guide. 8)

Hope this helps some.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 2, 2010, 11:17pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/3 "2010-06-02T23:17:33Z")

</div>

> [@davidc](#):
>
> Note that I am setting the DTMF duration and the blank duration myself…can’t remember why this was done, but it did come out of one of the app notes or the ADL guide.

The Guide has this to say:

> [@ADL User Guide](#):
>
> • Description  
> ADL\_AUDIO\_DTMF\_DETECT\_BLANK\_DURATION  
> RW: DTMF decoding option (u16); it allows to define the blank duration  
> (ms) in order to detect the end of a DTMF. This value will act on the  
> Wireless CPU® behaviour to return information about DTMF when listening  
> to a DTMF audio stream. The value must be a multiple of value returned by  
> ADL\_AUDIO\_RAW\_DTMF\_SAMPLE\_DURATION option multiplied by  
> ADL\_AUDIO\_MAX\_DTMF\_PER\_FRAME.

Is that what you were thinking of?

It is typically unhelpful in giving no guidance whatsoever on how to choose a suitable multiple! 😒😠

Your multiple seems to be ten - was there any particular reason for that

The sample is certainly not enforcing the highlighted requirement!

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 3, 2010, 11:36am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/4 "2010-06-03T11:36:49Z")

</div>

> [@awneil](#):
>
> Your multiple seems to be ten - was there any particular reason for that?

As in:

```auto
dtmfDuration = rawSampleDuration * ADL_AUDIO_MAX_DTMF_PER_FRAME * 10;

        // configure buffer and stream options
    ret = adl_audioSetOption ( Voice_DtmfAudioStreamHandle,
                                ADL_AUDIO_DTMF_DETECT_BLANK_DURATION, dtmfDuration );
```

ie, you’re setting the blank duration to:  
rawSampleDuration \* ADL\_AUDIO\_MAX\_DTMF\_PER\_FRAME \* 10

- On both my Fastrack Supreme and Xtend, rawSampleDuration = 10

- ADL\_AUDIO\_MAX\_DTMF\_PER\_FRAME is #defined as 2 in adl\_audio.h

So the blank duration comes out to 10 \* 2 \* 10 = 200

So I put AT+BLANK=200 into the sample, and the behaviour remains the same - still the double triggering!

And the Raw detection doesn’t seem to work at all!

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 4, 2010, 5:19pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/5 "2010-06-04T17:19:45Z")

</div>

OK: I’ve taken davidc’s initialisation, and just the minimal IRQ and Event handlers - and I still get the double-detection. 😠

Here it is:

```auto
#include "adl_global.h"

/ ******************************************************************************
 * Open-AT mandatory Variables
 ***************************************************************************** /
const u16 wm_apmCustomStackSize = 4096*3;
const u32 wm_apmIRQLowLevelStackSize = 4096;
const u32 wm_apmIRQHighLevelStackSize = 4096;

/ ******************************************************************************
 * Globals
 ***************************************************************************** /
s32	voice_DtmfAudioStreamHandle;	// Handle for the Audio Subscription
s32 voice_DTMFLowIrqHandle; // Handle for the Low-Level IRQ
s32 voice_DTMFHighIrqHandle; // Handle for the High-Level IRQ

adl_audioPostProcessedDecoder_t * postProcessedDTMF; // Post-processed DTMF

void * pDtmfStreamBuffer;	// Audio stream buffer

ascii dtmfResultStr [300];	// For tracing

/ ******************************************************************************
 * Audio Event Handler
 ***************************************************************************** /
void voice_dtmfAudioEventHandler( s32 audioHandle, adl_audioEvents_e audioEvent )
{
	TRACE(( 1, "Audio Ev: %d", audioEvent ));
}

/ ******************************************************************************
 * Low-Level IRQ Handler:
 *
 * Retrieves the post-processed DTMF Data, and checks the duration;
 * If the duration is too short to be valid, it is ignored (returns FALSE);
 * If the duration is valid, returns TRUE so that the High-Level IRQ Handler
 * will be called to deal with it.
 ***************************************************************************** /
bool voice_DtmfLowIrqHandler( adl_irqID_e src, adl_irqNotificationLevel_e lvl, adl_irqEventData_t *Data )
{
    TRACE(( 1, "LoIRQ: Ctx=%p Inst=%d Usr=%p Src=%p Buf=%p",
							Data->Context,
							Data->Instance,
							Data->UserData,
							Data->SourceData,
							((adl_audioStream_t*)Data->SourceData)->DataBuffer
    ));

    if( ((adl_audioPostProcessedDecoder_t*)((adl_audioStream_t*)Data->SourceData)->DataBuffer)->Duration > 4 )
    {	// Valid DTMF duration;
    	// Cause ADL to call the High level IRQ handler.
		return TRUE;
    }
    else
    {	// Invalid DTMF duration (too short);
    	// Do not cause ADL to call the High level IRQ handler (ie, ignore it!)

    	// retrieve DTMF - just for the Trace
        postProcessedDTMF = ((adl_audioPostProcessedDecoder_t*)((adl_audioStream_t*)Data->SourceData)->DataBuffer) ;

        TRACE(( 1, " PP-DTMF: %c; dur=%d ms - IGNORE!",
    							postProcessedDTMF->DecodedDTMF,
    							(postProcessedDTMF->Duration*10)
    	));
    	return FALSE;
    }
}

/ ******************************************************************************
 * High-Level IRQ Handler:
 *
 * Outputs the received DTMF symbol in an AT Response
 * (assumes that the Low-Level IRQ Hndler has already extracted the data)
 ***************************************************************************** /
bool voice_DtmfHighIrqHandler( adl_irqID_e src, adl_irqNotificationLevel_e lvl, adl_irqEventData_t *Data )
{
	// retrieve DTMF
    postProcessedDTMF = ((adl_audioPostProcessedDecoder_t*)((adl_audioStream_t*)Data->SourceData)->DataBuffer) ;

    wm_sprintf ( dtmfResultStr, "Post-proc DTMF: '%c'; duration: %d ms\r\n", postProcessedDTMF->DecodedDTMF, (postProcessedDTMF->Duration*10) );
    adl_atSendResponse( ADL_AT_RSP, dtmfResultStr );
    TRACE(( 1, dtmfResultStr ));

    return FALSE;	// The return value is not used for a High-Level handler
}

/ ******************************************************************************
 * Open-AT Entry Point
 *
 ***************************************************************************** /
void adl_main ( adl_InitType_e initType )
{
	s32 result;	// For API return result codes

	// Values for the Audio option Get/Set functions;
	// they all require a type of s32.
	s32 rawSampleDuration;
	s32 dtmfBlankDuration;
	s32 bufferSize;

    TRACE(( 1, "\n" ));
    TRACE(( 1, "Embedded Application: Main; Init=%d\n", initType ));

    /* DTMF decoding test application */
    TRACE(( 1, "DTMF Listener" ));
    TRACE(( 1, __DATE__ ));
    TRACE(( 1, __TIME__ ));

	// Subscribe the IRQ Handlers
	voice_DTMFLowIrqHandle = adl_irqSubscribe( voice_DtmfLowIrqHandler, ADL_IRQ_NOTIFY_LOW_LEVEL, ADL_IRQ_PRIORITY_LOW_LEVEL, 1 );
	voice_DTMFHighIrqHandle = adl_irqSubscribe( voice_DtmfHighIrqHandler, ADL_IRQ_NOTIFY_HIGH_LEVEL, ADL_IRQ_PRIORITY_HIGH_LEVEL, 1 );

	// Subscribe to Audio Stream
    voice_DtmfAudioStreamHandle = adl_audioSubscribe
    (
    	ADL_AUDIO_VOICE_CALL_RX, // Audio Stream ("Resource")
        voice_dtmfAudioEventHandler, // Event Handler
        ADL_AUDIO_RESOURCE_OPTION_FORBID_PREEMPTION // Options: this subscription "owns" the stream exclusively.
    );
    TRACE(( 1, "Audio Handle: %d", voice_DtmfAudioStreamHandle ));

    // Get the DTMF sample size
    result = adl_audioGetOption
	(
		voice_DtmfAudioStreamHandle, // The subscribed resource handle
		ADL_AUDIO_RAW_DTMF_SAMPLE_DURATION,	// The required parameter to get
		&rawSampleDuration // Will receive the requested value
	);
	TRACE((1, "audioGetOption=%d, sample duration: %d", result, rawSampleDuration));

	// Set the DTMF Blank Duration:
	// The ADL User Guide says this must be a multiple of ADL_AUDIO_MAX_DTMF_PER_FRAME and
	// the raw sample duration (obtained above). Unhelpfully, it doesn't give any advice on
	// what multiple to use - ten is, apparently, arbitrary.
	dtmfBlankDuration = rawSampleDuration * ADL_AUDIO_MAX_DTMF_PER_FRAME * 10;
	result = adl_audioSetOption
	(
		voice_DtmfAudioStreamHandle, // The subscribed resource handle
		ADL_AUDIO_DTMF_DETECT_BLANK_DURATION, // The required parameter to get
		dtmfBlankDuration // The value to set
	);
	TRACE(( 1, "audioSetOption= %d, blank duration: %d", result, dtmfBlankDuration ));

	// Get the required buffer size
	result = adl_audioGetOption
    (
    	voice_DtmfAudioStreamHandle,
        ADL_AUDIO_DTMF_PROCESSED_STREAM_BUFFER_SIZE,
        &bufferSize
    );
    TRACE(( 1, "audioGetOption=%d, buffer: %d", result, bufferSize ));

    // Allocate a buffer of the indicated size
    pDtmfStreamBuffer = adl_memGet( bufferSize );
    TRACE(( 1, "pDtmfStreamBuffer=%p", pDtmfStreamBuffer ));

    // Start listening to the Audio Stream
    result = adl_audioStreamListen
	(
		voice_DtmfAudioStreamHandle,	// The subscribed resource handle
		ADL_AUDIO_DTMF, // The required audio format
		voice_DTMFLowIrqHandle, // The Low-level IRQ handle
		voice_DTMFHighIrqHandle, // The High-level IRQ handle
		pDtmfStreamBuffer // The Stream Buffer;
										// The post-processed DTMF data will be delivered
										// to the IRQ Handlers in this buffer.
	);
    TRACE ((1, "audioStreamListen=%d", result));

    // Received DTMF data will now be passed to the Low-Level IRQ Handler...
}
```

Note that the Low-Level IRQ Handler just checks for too-short DTMF durations, and only causes the High-Level IRQ Handler to be called when the duration is valid

The source file is also attached - as it can be rather hard to read in the little code window on this forum! 😒  
[adl\_main.zip](https://forum.sierrawireless.com/uploads/short-url/1EGlejVpZEAcj6fy3927YJM0SY1.zip) (2.22 KB)

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 4, 2010, 8:20pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/6 "2010-06-04T20:20:55Z")

</div>

Example TMT Trace:

> [@TMT](#):
>
> 9098.633 Trace ADL 1 Embedded Application: Main; Init=0
> 
> 9098.633 Trace ADL 1 DTMF Listener  
> 9098.633 Trace ADL 1 Jun 4 2010  
> 9098.633 Trace ADL 1 18:08:54  
> 9098.633 Trace ADL 1 Audio Handle: 403449936  
> 9098.633 Trace ADL 1 audioGetOption=0, sample duration: 10  
> 9098.633 Trace ADL 1 audioSetOption= 0, blank duration: 200  
> 9098.633 Trace ADL 1 audioGetOption=0, buffer: 12  
> 9098.633 Trace ADL 1 pDtmfStreamBuffer=180C1E10  
> 9098.633 Trace ADL 1 audioStreamListen=0  
> 9103.765 Trace L3RR 1 RRD: Unknown event 0x583f  
> 9130.780 Trace SIM 1 sim\_SimUpdateReq : Unknown SIM file !  
> 9131.171 Trace L3RR 1 RRD: Unknown event 0x583f  
> 9133.905 Trace L3RR 1 RRC: Unknown event 0x586c  
> 9137.155 Trace LLH 1 PP-DTMF: 0; dur=10 ms - IGNORE!  
> 9137.983 Trace HLH 1 HiIRQ: Ctx=00000000 Inst=0 Usr=00000000 Src=180C2B10 Buf=180C2B50  
> 9137.983 Trace HLH 1 Post-proc DTMF: ‘0’; duration: 400 ms
> 
> 9142.233 Trace LLH 1 PP-DTMF: 1; dur=20 ms - IGNORE!  
> 9143.046 Trace HLH 1 HiIRQ: Ctx=00000000 Inst=0 Usr=00000000 Src=180C2B10 Buf=180C2B50  
> 9143.046 Trace HLH 1 Post-proc DTMF: ‘1’; duration: 400 ms
> 
> 9145.077 Trace LLH 1 PP-DTMF: 2; dur=20 ms - IGNORE!  
> 9145.874 Trace HLH 1 HiIRQ: Ctx=00000000 Inst=0 Usr=00000000 Src=180C2B10 Buf=180C2B50  
> 9145.874 Trace HLH 1 Post-proc DTMF: ‘2’; duration: 400 ms
> 
> 9148.562 Trace LLH 1 PP-DTMF: 3; dur=20 ms - IGNORE!  
> 9149.390 Trace HLH 1 HiIRQ: Ctx=00000000 Inst=0 Usr=00000000 Src=180C2B10 Buf=180C2B50  
> 9149.390 Trace HLH 1 Post-proc DTMF: ‘3’; duration: 400 ms
> 
> 9153.186 Trace LLH 1 PP-DTMF: 6; dur=20 ms - IGNORE!  
> 9153.983 Trace HLH 1 HiIRQ: Ctx=00000000 Inst=0 Usr=00000000 Src=180C2B10 Buf=180C2B50  
> 9153.983 Trace HLH 1 Post-proc DTMF: ‘6’; duration: 400 ms

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 7, 2010, 6:50am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/7 "2010-06-07T06:50:58Z")

</div>

Hiya,

I’ve just built your example code and loaded it into a Q2686G. The only change I made was to comment out the adl\_atSendResponse() in the High level interrupt routine (because this has caused me issues in the past).

I cannot duplicate the ‘double detection’ issue that you are seeing.

Just out of interest, ATI9 returns the following for my module:

```auto
ati9
"DWL","V08b0g","","Wavecom",54680,"071609 15:36","16bb6f5c","00010000"
"FW","B74s00gg.Q2686G","R74a00gg.Q2686G","Wavecom",2106632,"102809 12:57","7c687cd0","00020000"
"OAT","","","",77616,"060710 16:37","cb146736","00260000"
 -"M2M Studio","1.1.1.200911160856-R3160"
 -"Open AT Embedded Software Suite package","2.31.0.RC2"
 -"Open AT OS Package","6.31.0.03"
 -"Open AT Firmware Package","7.4.0.a.200912041916"
```

And I was using a HTC HD2 phone to send the DTMF by tapping on the touch screen…

Now I’m wondering if any of the following are valid:

1. Are we using different versions of OpenAT or Firmware (etc)?
2. How different is the Fastrack Xtend Hardware to the Q2686G?
3. Can you try a different module? (e.g. Fastrack Supreme?)
4. Can you try a different phone or modem to send the DTMF to your Xtend in case there is an issue with the DTMF being sent? Although, as you note each DTMF tone should be a minimum of 40mS so the Sierra module shouldn’t catch tones shorter than this…

Hope this helps some.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 7, 2010, 8:01am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/8 "2010-06-07T08:01:36Z")

</div>

> [@davidc](#):
>
> I’ve just built your example code and loaded it into a Q2686G. The only change I made was to comment out the adl\_atSendResponse() in the High level interrupt routine (because this has caused me issues in the past).

I’ll give that a try; however, that is in the Sierra Wireless sample - so if it is what causes the problem, then that is a bug in the sample!😒

> [@](#):
>
> And I was using a HTC HD2 phone to send the DTMF by tapping on the touch screen…

I have tried using:

- My POTS landline phone - so that’s real, analogue in-band signalling;
- A GSM Phone - so that’s network-generated;
- Skype - no idea what that does!

And they all exhibit the same behaviour.

> [@](#):
>
> [\*]Are we using different versions of OpenAT or Firmware (etc)?

I’ll check…

> [@](#):
>
> [\*]How different is the Fastrack Xtend Hardware to the Q2686G?

I don’t know - but I thought this was all digital - within the module?

> [@](#):
>
> [\*]Can you try a different module? (e.g. Fastrack Supreme?)

Yes, a Supreme exhibits the same behaviour.

> [@](#):
>
> [\*]Can you try a different phone or modem to send the DTMF

See above! 8)

One thing I haven’t tried is using a different GSM network…

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 7, 2010, 12:39pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/9 "2010-06-07T12:39:40Z")

</div>

Hiya,

> [@awneil](#):
>
> that is in the Sierra Wireless sample - so if it is what causes the problem, then that is a bug in the sample!

Exactly - but are you surprised? 😕

> [@awneil](#):
>
> And they all exhibit the same behavior.

That doesn’t sound good. I’ve just checked with a POTS landline and didn’t see any difference to my tests with the GSM mobile.

> [@awneil](#):
>
> I don’t know - but I thought this was all digital - within the module?

I would have thought so too - but it may depend on how the voice stream is being processed in different processors/hardware.

Have you got the facilities to connect a microphone or handset up to your module? If you can, and have an old tone dialer in your collection of spares it might be worth seeing if the same issue arises when connecting to the Microphone Audio Stream. If it does, then we know it’s a processing issue. I know it’s clutching at straws, but it’s probably worth a try - just for completeness.

> [@awneil](#):
>
> One thing I haven’t tried is using a different GSM network…

Good thought - all my testing has been on the same network.

Maybe it’s time to contact your Distributor 😒

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 7, 2010, 1:12pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/10 "2010-06-07T13:12:29Z")

</div>

> [@I](#):
>
> that is in the Sierra Wireless sample - so if it is what causes the problem, then that is a bug in the sample!

> [@davidc](#):
>
> Exactly - but are you surprised? 😕

Don’t get me started… 😠

> [@](#):
>
> Maybe it’s time to contact your Distributor 😒

I have done - they are looking into it…

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 8, 2010, 1:51am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/11 "2010-06-08T01:51:50Z")

</div>

Hiya,

Just tried your code with a mobile from the Virgin Network (carried over Optus here in Oz), and still don’t see the issue you are having.

Just out of interest, have you tried the DTMF RAW mode to see what the modem is decoding?

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 8, 2010, 10:44am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/12 "2010-06-08T10:44:43Z")

</div>

Results on all 4 UK networks as follows (all pre-pay):

- Virgin (T-Mobile): Exhibits the problem

- Vodafone: Exhibits the problem (used in the original tests);

- Orange: No problem;

- O2: No problem.

So it does seem to be network-related: Vodafone & T-Mobile have the problem; Orange & O2 don’t.

In all cases, the results are the same irrespective of the originator of the call (Skype/GSM/POTS).

So, does anyone know what Vodafone & T-Mobile have in common, that’s different to what Orange & O2 have in common ❓

The “raw” mode didn’t seem to work at all in the sample - which is one reason why I took it out of my “cut-down” version!  
I might now try it again on the “good” networks…

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [June 8, 2010, 11:34am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/13 "2010-06-08T11:34:07Z")

</div>

Hiya,

> [@awneil](#):
>
> So it does seem to be network-related: Vodafone & T-Mobile have the problem; Orange & O2 don’t.

Oh blast.

That’s not good.

I’ll see if I can find someone with a Vodaphone SIM here in Oz and give it a try and see if the problem can be replicated here too. I have tested the following networks here in Oz:  
Telstra (Post-paid)  
Virgin (Pre-paid, used Optus for connectivity).

After your findings I think I’ll look into buying pre-paid SIMs for each of the networks here in Oz and testing my software. At the very least I’m going to put in your ‘short pulse’ trap in my DTMF Low Level interrupt.

We shouldn’t have to do this.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 8, 2010, 11:52am UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/14 "2010-06-08T11:52:52Z")

</div>

> [@davidc](#):
>
> I’m going to put in your ‘short pulse’ trap in my DTMF Low Level interrupt.

You may send the royalties to my PayPal account… 8)

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 8, 2010, 12:01pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/15 "2010-06-08T12:01:59Z")

</div>

> [@davidc](#):
>
> The only change I made was to comment out the adl\_atSendResponse() in the High level interrupt routine (because this has caused me issues in the past).

I’ve tried taking that out - I still get the problem.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 8, 2010, 10:23pm UTC](https://forum.sierrawireless.com/t/bug-in-dtmf-decode-sample/4462/16 "2010-06-08T22:23:58Z")

</div>

I tried using the AT+WDDM command - the results are the same; eg,

> [@](#):
>
> at+cops?  
> +COPS: 0,0,“vodafone UK”
> 
> OK
> 
> +CRING: VOICE
> 
> +CLIP: “+447xxxxxxxxx”,145  
> ata  
> OK
> 
> +WDDI: “1”,10
> 
> +WDDI: “1”,400
> 
> +WDDI: “2”,20
> 
> +WDDI: “2”,400
> 
> +WDDI: “3”,20
> 
> +WDDI: “3”,390
> 
> +WDDI: “4”,10
> 
> +WDDI: “4”,390
> 
> +WDDI: “5”,10
> 
> +WDDI: “5”,390
> 
> +WDDI: “6”,10
> 
> +WDDI: “6”,390
> 
> +WDDI: “7”,10
> 
> +WDDI: “7”,390
> 
> +WDDI: “8”,390
> 
> +WDDI: “9”,10
> 
> +WDDI: “9”,390
> 
> +WDDI: “0”,20
> 
> +WDDI: “0”,400
> 
> +WDDI: “\*”,10
> 
> +WDDI: “\*”,390
> 
> +WDDI: “#”,10
> 
> +WDDI: “#”,400
> 
> NO CARRIER

So it’s not just an Open-AT thing
