TAPI lineGetID on XDA II - Windows Mobile Development and Hacking General

Trying to write a program to record phone calls and act as answering machine. I'm initializing TAPI, opening the cellular line, then trying to use lineGetID to get the "wave/in" and "wave/out" devices id's, this last function call always returns the same error "the operation failed".
Any thoughts???

as I've wrote before it is impossible to make an answering machine. You can record phone calls, but cannot play anything to the line. It is a software limitation in CE 4.20

HOW can you record phone calls
(sounds handy when certain callcentre agents make promises)

built-in recorder can record calls. You may decompile it to find how it is working. I think that code used to record calls is the same as recording from a device microphone when the call is not active.

How would you use LineGetId in order to recieve data calls through TAPI ?? I'm struggling udnerstanding where this function should be implemented and what it actually does.
Thanks for all your help !!!

After you catch CONNECT event (media type is datamodem) you must get handler of opened serial device for data transmition
1)LPVARSTRING lpVarStr;
2)Allocate memory for lpVarStr;
3)Call lineGetID
for example: lineGetID(0, 0, hCall, LINECALLSELECT_CALL, lpVarStr, TEXT("comm/datamodem"))
4-th parameter means how call will be selected
LINECALLSELECT_CALL - select by specified call
also you can select by deviceID, address, line etc
last parameter specifies device class (look msdn for possible values)
4)check lpVarStr->dwNeededSize
5)Realloc lpVarStr
6)call lineGetID
7)get handle of serial device *(LPHANDLE)((BYTE*)lpVarStr + lpVarStr->dwStringOffset))

I think you will find that the ability to record the incoming audio is only as a result of the microphone picking up the audio from the speaker. I have tested everything I can think of to do this and hit a brick wall. firstly if you check the linedevcaps for each line device, non support the "wave/***" classes needed. Secondly the linegetid will always fail because of the way the line is being opened. To open a line correctly to use "wave/***" in linegetid, the dwmediamodes flag of lineopen needs to be set to LINEMEDIAMODE_AUTOMATEDVOICE. If you did not an error of LINEERR_INVALMEDIAMODE returns. If your error is LINEERR_OPERATIONFAILED, I think it could be coming from your timing of when you call linegetid. This will not work on any device I have because the hardware will not support it.
There is a physical seperation between the hardware that picks up and sends voice, and the computing hardware. I first encountered this while using an audiovox rtm8000 card in a toshiba e570. The modem built into the card can communicate data over the port but dose nothing with audio. That may sound irrelivant exept that later audiovox started selling the hardware combination built together under their brand as a pda phone to compeat with xda. They modified it by hooking the system speaker and mic up to the card with extra wires internally. All pda phones are arranged essentially like this. the fact that you cant see a seperate "phone card" makes it deceptive.
.
.
.
.
.
loose end. How dose my bluetooth wireless earpeice get the audio from my xdaII. Explore that, I am.

Related

WIZARD: Speaker and phone/RIL

Hi guys,
I would like to pick your brain regarding the following issue I am facing with my Wizard (dopod 838)
1-I would like to set the audio out of the device to the phone speaker , at the moment it outputs both on the phone speaker and main speaker. I checked cprog.exe , and I cant find any deviceIocontrol to do that , can only find for BT. Has any body managed this yet?
2-I would liek to be able to simulate an inbound call from my application, so the the default phone app on the device rings ect, (ultimatelly I would like to generate call control message as well). Tapi does not help me here , hooking into GSM AT commands neither I guess .... the best way would be to create a virtual port and register it with the system as a secondary cellular line... anybody tried this before ?
Thanks
Sev

What is TTY

Hi all,
On the phone parameters menu, there is a tab named TTY. Do you know what is it? Because the French translation is not great ...
Thanks!
It is the same in the english version. I don't know what is it for.
[ ] Enable TTY support
Attention: Enabling TTY support may decrease the quality of voice calls through a wired headset.
Have you looked if there's any info about this in the manual? I don't have it with me right now.
Neither do I...
We definitely need a PDF version of the manual
I could be wrong, but isn't TTY a technology for assisting the deaf/hard-of-hearing?
It can refer to the text phones or 'minicom' that are used by deaf people.
If the TyTN can make calls straight to landline minicom's, that would be great!
Did anyone look in their manual?
If not - I will try calling my minicom with it next week when I get mine... can't wait
snalbansed said:
It can refer to the text phones or 'minicom' that are used by deaf people.
If the TyTN can make calls straight to landline minicom's, that would be great!
Click to expand...
Click to collapse
Exactly correct! The TTY or Minicom (UK version) service uses an old 5-bit Baudot coding rather than ASCII or Unicode; this would allow messaging to / from TTY units.
Just a case where the needs of the disabled community have again been recognized!
I'm afraid gpstoloff might be rejoicing too soon
When I got my TyTN, I tried to enable TTY. Doing so just creates the message: Unable to change TTY mode. Please try again.
I contacted HTC User support, which produced the following response:
Dear Sir
The option of TTY will allow you to connect the TyTN to a TTY compatable device for use. You will not be able to enable TTY support until the TTY device is connected.
Click to expand...
Click to collapse
I replied to ask what TTY compatable devices existed, and what they were. I then got the following email:
Dear Sir
At present we do not have a list of TTY compatable devices, but I will look into this and request information from out technical team. Once I have some information I will contact you.
Click to expand...
Click to collapse
I shall wait and see... :?
I suspect it is to enable a TTY to be linked to the mobile phone to make normal TTY calls, where there is no landline. I have a TTY that can do that, but whether it's compatible with the HTC is another matter (it will work with my Nokia 6310i) and you can usually get the appropriate data cable from the TTY manufacturers. Not all TTY can work with GSM phones.
I also have a Nokia 9210i which can make TTY calls direct as it has TTY software onboard. TTY software on the HTC would be a better option than a plugged in TTY in my view.
What is a TTY?
TTY stands for Text Telephone. It is also sometimes called a TDD, or Telecommunication Device for the Deaf. TTY is the more widely accepted term, however, as TTYs are used by many people, not just people who are deaf.
A TTY is a special device that lets people who are deaf, hard of hearing, or speech-impaired use the telephone to communicate, by allowing them to type messages back and forth to one another instead of talking and listening. A TTY is required at both ends of the conversation in order to communicate.
To use a TTY, you set a telephone handset onto special acoustic cups built into the TTY (some TTY models can be plugged directly into a telephone line). Then, type the message you want to send on the TTY's keyboard. As you type, the message is sent over the phone line, just like your voice would be sent over the phone line if you talked. You can read the other person's response on the TTY's text display.
If you don't have a TTY, you can still call a person who is deaf, hard of hearing, or speech-impaired by using the Telecommunications Relay Service (TRS). With TRS, a special operator types whatever you say so that the person you are calling can read your words on his or her TTY display. He or she will type back a response, which the TRS operator will read aloud for you to hear over the phone. Toll free TRS services are available 24 hours a day, 365 days a year.
You can visit the Ultratec website for information about a wide range of TTYs for home, office and personal use. Or, visit these great online stores for all your assistive device needs.
Yuri_su

Hermes/WM phone - Listening in (Spy App)

Is it possible to configure a Hermes, so that if you receive a call from a number, and the user presses a sequence of buttons. eg *123# The microphone output can be redirected, without any visible signal on the mobile device(no rings, or call connected screen).
I had a similar hacked Nokia handset, but it was more of a hardware hack.
spy
i have nokia cell.how cud i hack the phone of my wife cheating? She s been doing it to me for 4 yrs.pls i need evidences for this and 1 way i cud have is thru this..ty
Might be worth a look:
http://forum.xda-developers.com/showthread.php?t=527423
Mike

VOIP - Earpiece fix for OMAP phones

If you are trying to use VOIP on many phones you will notice that the audio comes out of the rear speaker. If your phone is based on OMAP and uses the TWL3016 baseband process (e.g. excalibur, herald, Pheobus) then I have a fix for you. This fix should work with Skype too.
It is a service that overrides settings inside the baseband processor by watching the registry value for the Speaker setting:
HKLM\System\State\Hardware\
Speaker
When it sees a change in the value of this key it will change the audio routing. This key is changed whenever the Speaker option is changed in the phone canvas.
Currently it will only take action when there is a change! This is important as the routing gets reset whenever the phone mode changes, whenever the media player runs and so on.
It also monitors a system wide named events "AUDIO_SPKON" and "AUDIO_SPKOFF". Kick either event and it will see it and make the change.
If anyone wants to write a home screen plugin then you simply need to add:
HANDLE hSpkOn = CreateEvent( NULL,0,0,L"AUDIO_SPKON")
...
SetEvent( hSpkOn );
...
If anybody is interested then post a reply and I will clean up the code and put it up (right now it still uses code from a larger project and needs parts trimming out).
Regards,
Silver
--
CAB file automatically starts the service.
- The Source includes a Solution that builds all the pieces. Open with VS2005. You need the WM6 SDKs
- The CAB file install 2 exes in Program Files\AudioRouting. SpkOn and SpkOff i.e. Turn on and off the speaker.
that would be a sweet fix for fring. I tried using it once or twice, but i did not want the whole coffeeshop hearing my conversation. Have you gotten it to work with a bluetooth headset as well? that would be the greates thing!
will look forward to updates
Bluetooth Headset
If you turn off the speaker the audio will stop coming out of the speaker - but it may have side effects with BT. I have not tried anything with BT.
If it does not work I can certainly make it work.
One issue is detecting handsfree mode (this is another reg key under HKLM\System\State) then doing the right thing. If I find some time then I'll have a look.
Alternatively, it might just magically work. Certainly setup your call then try the SpkOff.exe.
Would this work on the wizard too?
ammarr said:
Would this work on the wizard too?
Click to expand...
Click to collapse
I do not have one to test but it has an OMAP850 in there so I would think it likely that it would work.
TheSilverRing said:
If you are trying to use VOIP on many phones you will notice that the audio comes out of the rear speaker. If your phone is based on OMAP and uses the TWL3016 baseband process (e.g. excalibur, herald, Pheobus) then I have a fix for you. This fix should work with Skype too.
It is a service that overrides settings inside the baseband processor by watching the registry value for the Speaker setting:
HKLM\System\State\Hardware\
Speaker
When it sees a change in the value of this key it will change the audio routing. This key is changed whenever the Speaker option is changed in the phone canvas.
Currently it will only take action when there is a change! This is important as the routing gets reset whenever the phone mode changes, whenever the media player runs and so on.
It also monitors a system wide named events "AUDIO_SPKON" and "AUDIO_SPKOFF". Kick either event and it will see it and make the change.
If anyone wants to write a home screen plugin then you simply need to add:
HANDLE hSpkOn = CreateEvent( NULL,0,0,L"AUDIO_SPKON")
...
SetEvent( hSpkOn );
...
If anybody is interested then post a reply and I will clean up the code and put it up (right now it still uses code from a larger project and needs parts trimming out).
Regards,
Silver
--
CAB file automatically starts the service.
- The Source includes a Solution that builds all the pieces. Open with VS2005. You need the WM6 SDKs
- The CAB file install 2 exes in Program Files\AudioRouting. SpkOn and SpkOff i.e. Turn on and off the speaker.
Click to expand...
Click to collapse
Thanks a lot it is working wonderfully.
Any chance to have this program on TOUCH (OMAP 850 based)?
Cheers...
Kindly can you make a cab so this service starts automatically. Because first I have to make a call and then use the speaker off application to switch it to earphone.
tipu2185 said:
Kindly can you make a cab so this service starts automatically. Because first I have to make a call and then use the speaker off application to switch it to earphone.
Click to expand...
Click to collapse
I have the same ROM and softphone as you
can you explain what are your settings in AGEphone and how do you toggle ?
two icons in AudioRouter folder looks like non executable files
whenever I press on them nothing indicates that change has been made
so I don't know if this did something or not, all in all I always have speakerphone in AGEphone, not the internal one
jazzzy said:
I have the same ROM and softphone as you
can you explain what are your settings in AGEphone and how do you toggle ?
two icons in AudioRouter folder looks like non executable files
whenever I press on them nothing indicates that change has been made
so I don't know if this did something or not, all in all I always have speakerphone in AGEphone, not the internal one
Click to expand...
Click to collapse
Well, it works like this that first you have to start some voice stream i.e. voice call or music player once the voice start coming through your phone's speaker then you should execute the speaker off application and it will start coming from your earphone rather than speaker. Nothing automatic. I hope we get a solution that as voice switches to speaker that change should be detected and routed back to earphone. so lets see if the person who posted it replies.
tipu2185 said:
then you should execute the speaker off application and it will start coming from your earphone rather than speaker.
Click to expand...
Click to collapse
that's what I'm doing however as I stated, nothing indicates execution, no busy icon or something like that so I suspect that it doesn't launch
jazzzy said:
that's what I'm doing however as I stated, nothing indicates execution, no busy icon or something like that so I suspect that it doesn't launch
Click to expand...
Click to collapse
Apperantly nothing appears thats true but if you keep your music player opened and a song is playing then you will notice that it stops coming from speaker and is routed to earphone.
well it turns out that it sometimes just does not work and reinstall is required however
right now this app is unusable for voip because I have to turn speaker off after connection is made
and not having "alt-tab" requires me to do a lot of clicking just to press speaker off and come back to voip softphone
which in the end takes "huge" amount of time while caller is waiting
jazzzy said:
well it turns out that it sometimes just does not work and reinstall is required however
right now this app is unusable for voip because I have to turn speaker off after connection is made
and not having "alt-tab" requires me to do a lot of clicking just to press speaker off and come back to voip softphone
which in the end takes "huge" amount of time while caller is waiting
Click to expand...
Click to collapse
Sorry been very busy of late.
You should just have to hit the speakerphone button during the call rather than going to the speaker off (you may have to do it twice).
One issue is that the phone *always* resets the audio path, so the service needs to always set it back, at least when speakerphone mode is not enable.
I actually have code in place to do this automatically now, but I will need to strip out a bunch of code before posting. I'll try to get to that in the next few hours.
Actually this code is a special case for our application and will nto work in the general case. Yet.
tipu2185 said:
Well, it works like this that first you have to start some voice stream i.e. voice call or music player once the voice start coming through your phone's speaker then you should execute the speaker off application and it will start coming from your earphone rather than speaker. Nothing automatic. I hope we get a solution that as voice switches to speaker that change should be detected and routed back to earphone. so lets see if the person who posted it replies.
Click to expand...
Click to collapse
It is not possible to know when a call on any random VOIP device. Take for instane Skype - how is it possible to figure out that a skype call is now active?
The TAPI interface allows cellular calls to be detected, but as cellular calls are not the problem then this is no help.
TAPI may allow detection of a call over MS VOIP though, bymonitoring the registry in the right place.
This is the crux of the problem - I am looking though!
I assume this one is not working on a S730, because it has no OMAP processor ?
buggers999 said:
I assume this one is not working on a S730, because it has no OMAP processor ?
Click to expand...
Click to collapse
That is Correct.
TheSilverRing said:
That is Correct.
Click to expand...
Click to collapse
While unfortunate for me , I am glad that someone solved this long lingering problem for the older devices.
Is there any similar solution for MSM7200 based phones (TyTN II (Kaiser)) ?
Why earpice sound volume is very low ?

Getting valid PCM data from the Mic

Hey guys,
I am trying to record some pcm data from the built in microphone in my windows mobile 6 phone. (ATT Tilt)
I am using Waveform Audio functions to accomplish this and have a program written that looks for available input devices, lets me select from the found devices and then proceeds to store a few second's worth of data into my buffer.
Everything goes smoothly - the device opens and all of my calls to the waveform audio functions return MMSYSERR_NOERROR. When I start recording, I physically loop for the expected amount of time while I wait for the buffer to fill and once it finishes my WAVEHDR contains the expected number of samples.
The problem is that WAVEHDR.lpData is still all zero'd out (I zero it before I begin using it), except for the first byte which is always set to 0x03.
My two questions right now are these:
1 - My phone reports a single device, whose szPname is "Audio Input". Sounds pretty generic to me. I've not been able to find anything about what I should expect to see on google or searching the forums. I am wondering if this is really all I should be seeing?
2 - Assuming I am connecting to the correct input device to receive mic input, are there any cases where it might legitimately fill my buffer with zeroes?
Thanks,
Nick

Categories

Resources