.NET Framework - Send DTMF tones

Asked By Veena
09-Jul-07 04:54 AM
Hello All,
I want to send DTMF tones while an voice call is going on. I am using
TAPI for the same. LineGenerateDigits function should do this as per
the documentation. But it gives LINEERR_OPERATIONFAILED when i execute
it. Could anyone please help me.

I have opened an line connection using (dialed a number)
lineOpen (
g_hLineApp,                 // Usage handle for TAPI
g_dwCurrentLineID,          // Cannot use the LINEMAPPER value
&g_CurrentLineInfo.hLine,   // Line handle
g_CurrentLineInfo.dwAPIVersion,
// API version number
0,                          // Must set to zero for Windows CE
0,                          // No data passed back
LINECALLPRIVILEGE_OWNER + LINECALLPRIVILEGE_MONITOR,     //
Can only make an outgoing call
LINEMEDIAMODE_INTERACTIVEVOICE|LINEMEDIAMODE_DATAMODEM,//Media
mode
NULL))

When i get  connected indication which is given by
LINECALLSTATE_CONNECTED,  i am calling:

LPCWSTR tone = TEXT("2");
error = lineGenerateDigits(g_hCall, LINEDIGITMODE_DTMF,tone, 600);

This function returns error LINEERR_OPERATIONFAILED error.


Please help.
CurrentLineInfo.hLine
(1)
DwCurrentLineID
(1)
LineGenerateDigits
(1)
ShellExecuteEx
(1)
LineMonitorDigits
(1)
HLineApp
(1)
LineOpen
(1)
Windows
(1)
  Peter Foot [MVP] replied...
09-Jul-07 10:03 AM
Have you tried the alternative approach of using the dtmf: pluggable
protocol e.g. use ShellExecuteEx to launch

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility
  Veena replied...
10-Jul-07 02:55 AM
Hi Peter,
Thank you very much for replying.
No i am not aware of this.I tried using RIL interface too but no
success.
Just want to clarify..You mean to say i call ShellExecuteEx("dtmf:2");
is it?
Here "2" would stand for the digit whose dtmaf i want to send right?
But how would i know if it has been successfully sent?

Please reply back, till then i'll try doing this.

Thanks again
  Peter Foot [MVP] replied...
10-Jul-07 04:08 AM
Yes you follow dtmf: with the key (or keys) you want to pass, this includes
the * # and p (pause) characters. No I don't believe you'll get a return
value to know if it was successful or not though.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility
  Veena replied...
10-Jul-07 06:56 AM
Hi,
Thanks once again for replying back.
I tried using ShellExecuteEx() wherein i passed lpFile  paramater of
the  SHELLEXECUTEINFO structure as "dtmf:2" considering digit 2. Now
just to confirm whether i receive this DTMF signal, i used
RIL_SetDTMFMonitoring function but again i am not getting any
notification using the same. Any other suggestions which i could try
to confirm?

Thank you very much
  ckm replied...
10-Jul-07 07:11 AM
Can you try changing the Media type from
LINEMEDIAMODE_INTERACTIVEVOICE|LINEMEDIAMODE_DATAMODEM to
LINEMEDIAMODE_INTERACTIVEVOICE
  Veena replied...
11-Jul-07 06:03 AM
Hi,
Sorry for late reply. Was facing some problems with the call
conenction itself.
Now finally i am getting success return code for linegeneratedigits.
Thank you very much.
Now if i have to receive these DTMF tones what should i do?
Any idea?

Thanks once again
  ckm replied...
11-Jul-07 07:12 AM
AFAIK on WM phones it is not possible to monitor DTMF digits on voice
calls. Reason is DTMF digits are  received from the remote party as
audio tones in the voice call, and there is currently no support to
monitor for these audio tones.
  Veena replied...
11-Jul-07 07:20 AM
Thanks a lot for your reply.
Yes i tried lineMonitorDigits function.
But it returns error code that operation is unavailable.
So we have absolutely no means detecting these tones..thats very
discouraging.
  BenoitBedar replied...
19-Jul-07 09:26 AM
When I'm opening my line like you with the same code I get Operation
Unavaible...
the only way I get no error is when I'm using no privilege and only data
modem... what I am doing wrong.
--
Benoit Bedard
Junior Software Designer
Create New Account
help