How to receive incoming call notification - Windows Mobile Development and Hacking General

1st of all - hello!
This is my first post in this Forum and I feel very uncomfortable at this point because I got a question, which has been hit many times before. Further it won't be the exact right place here to ask, because I dont own a XDA but a Motorola MPx200 with Windows Mobile 2003 Smartphone Edition. Nevertheless, I guess you can help me because developement in .NET is quite the same - and most of the features will work there too.
But getting startet...
I'm trying to write a program, which will indicate on my desktop computer if there is a incoming call on my mobile. Further it has to show me the incoming callers ID, maybe from the buildin phonebook of the mobile. For that Programm i have to write a little "listener" for my mobile, which calls a function (which talks to my desktop) when a incoming call is received.
Unfortunatly I can't write C++, but I think there must also be a solution in C# .NET over a API call. But I don't know, which method in which DLL I should call to receive the information if there is an incoming call or not.
Can anybody please help figuring out how to do this.
What I know now is, that it has to do with RIL and TAPI, but I must read myself in RIL to understand that.
Your my last chance - i googled the whole day, even read about 20 pages on google groups but there wasn't the "All-i-need-to-be-happy"-solution at all. I also have searched the wiki in here...
Sorry if you don't understand some parts of this text - i come from germany, so english isn't my native language.
Thanks so long.
Marcus

Hi
for WM2003 it is kind of hard and involves a lot of study concernaing TAPI.
with WM5 it should be quite easy using .net compact framework 2.0 as there is a new namespace Microsoft.WindowsMobile.Status and a System Property called: SystemProperty.PhoneIncomingCall yet I have not tried that route.
One more Option which I didn't try - but could be a chance for you without learning TAPI is to register a small console.exe within the notifcation queue to run on the appropriate system event! (memmaid is a good explorer for the notiication queue)
This option will most likely just tell you that there is a call - and now details - I have no time to research this right now.
BR
Daniel

http://msdn.microsoft.com/library/en-us/apisp/html/sp_extapi_linegetnumbercalls.asp?frame=true
V

Progress
And is it working??
I thought I was the only one who wants to get this working...
Let us know !

Related

Get the telephone number in a program by starting a call

I develope a software which uses the phone of windows ce. So the user of the software can use the telephone. But it should be forbidden for the users to call any numbers. So I need to check the number the user puts in before he can start the call. How can I do that. Can I work with the RIL? In the past I have worked with the RIL and I get the message when someone starts a call but I don't know how I can get the number.
bye
Barney0021
I am not a programmer but could you not scan the keyboard input for this, used to be easy in the days of basic programming.
Thank you for answering, but I don't think this will work.
Mr.barney
can u provide me the code to use the phone
i dont know how to Initializing TAPI on EVB .... i saw the help file but i couldn't know how to do it well>>>pls
Barney0021: you may hook the COM1 and intercept all AT commands coming to the modem and filter the prohibited ATD commands. Or you can use TAPI functions like lineGetCallInfo. It should return the dialed number of the given call, but I have not tested this.
@ corv3:
I am programming with eVC++. And the phone application I use in my program is not written by myself. Instead I use the telephone application Windows CE owns. In my program I need only to start the telephone application. This is very easy. When you are still interested in the code (eVC++) then mail me again.
Greetings
@ mamaich:
Thanks, this is good, but the function needs a parameter called HCALL. How can I get this?
Greetings
Mr.Barney >>>
i want my program these functions:
-answer call by it self or by win ce phone program
-know the caller number
even on EVC ++
so if u know about the code of these functions pls tell me about them
Barney0021 said:
@ mamaich:
Thanks, this is good, but the function needs a parameter called HCALL. How can I get this?
Greetings
Click to expand...
Click to collapse
Look into TAPI samples coming with PPC 2003 SDK! There are several good examples.
The other variant is visiting www.cryptophone.de and downloading their source code. The code is a bit difficult to understand, but you'll se how everything can be done. Even interception of phone calls so that "Phone" application does not popup. Of cause you cannot use their source code because it is copyrighted, but you can do the similar things.
@ corv3:
At the moment my program only uses the Win CE phone. For this I've programmed a function that opens the telepbone. The following three lines will do that:
SYSTEMTIME systime;
GetSystemTime(&systime);
CeRunAppAtTime(L"\\Windows\\cprog.exe",&systime);
Ohter activities with the phone are still in progress but not properly working.
thanx alot Mr.Barney ....
Hi, I have the same problem
I want to get keypad numbers to block out going calls but i don't know how, key words I used are TAPI Windows mobile get caller number, call control, call management I searched in codeproject.com also but I found nothing, please help...I feel the wrong thing is from me

test tapi on your device

A lot of people trying to write programs that can transfer data over a phone call seem to end up giving up because they think their device is not capeable of it. I put this little app together to make it possible to demonstrate the data transfer on ppc phones. If this works on your device then you can implement similar functionality.
download bellow:
http://odeean.veritel.com.au/ORDTapiUser/myTapiUser.exe
It will only work if the program is running on both the calling and answering ppc at the same time.
Instructions:
0)Make sure the phones on your ppc's are turned on.
1)copy the exe to both devices.
2)run the exe on both devices.
3)press "startup" on both devices.
4)(both devices) a series of dialogs will pop up, if you see one labeled "celular line" press yes. If you know your phone uses a line called something else press yes to that instead. If you press no to everything the program will try to get the correct line, but may fail. If you want to choose again restart the program.
5)on the calling device put a phone number in the edit box at the top. I am no expert on numbers around the world so I have just let whatever you put there go straight in. If the number fails its got nothing to do with this program.
6)on the calling device press "dial". wait until it says connected.
7)on the answering device the incoming call will be shown. If a caller id is available it will be displayed. The ppc inbuilt phone is not stopped by this app so you will not be able to press the answer button. Instead wait (normally the default is 3 rings) and my program will answer the call itself.
8)two way communication is now posible. Data sent from the "data to send" edit box on one ppc will be displayed on the "received data" window on the other ppc. As this is a simple program the display will just show the last 25 digits to keep the latest info in the window.
9)when done press "hangup" on one of the ppc's
The data is not just sent in a direct way. It gets broken up into packets and they are timed as they are transmitted along with some error checking. The timing is rather generous so it slows the transmition down a bit, that along with all the actions being displayed to the user.
This works well between my xda mini and xda I. It dose not work on windows mobile 2005. Because of the expense involved in phone calls it is dificult to debug. If any messages do pop up it would be nice if you could post the number on the dialog and a description of what was going on. This program cost me $150 in phone expence, so enjoy.
.
could you post the code , please ?
i have to make an application that need to receive file from server with data call.
(excuse my english)
best regards
I will not post the entire code, this is to let you know if it is worth the effort trying. Almost everything contained within this program that is related to tapi can be seen in posts already on this board. If you have a specific question I would be glad to post code relating to it.
When you say you need to retreive a file from a server, you should know that tapi data calls do not go through the mechanism that ras or sockets use to let the operating system get a ip and port for communication. Your program is responsible directly for the communication. It would be terrific if you could write code to replace the missing incoming ras components from pocket pc. I have not so I could not show any code for that.
If the server you want to connect to is not a pocket pc based device, ie it is a normal pc, then tapi is not the best solution for you. I suggest using sockets, its designed for that kind of thing. ppc to ppc tapi data calling is like a last resort kind of programming. It is forced on us because either the phone networks don't give us usefull ip's for sockets or the api's are not fully implemented in ras. Alternately you could look into using the compact framework 2.0 and c#, I think I read somewhere that incoming ras would be included there.
just one question...your application uses TAPI, isn't it?so TAPI is supported by mostly different mobile device?Am I right?
thanx
ppc 2000 supports tapi outbound only.
ppc 2002, wm2003, wm2005 all support tapi inwards and out.
The hardware can vary, I only have the devices listed in my sig. For all of those (that are phones) tapi data, in/out is fully functional. If you are using a phone card (ie one that plugs into the expansion port) its capeabilities may be different. Often those only support gprs (not tapi). If you have anything with XDA in the name its OK.
Thank you for your advise but I have a specific problem using HTC
Wizard. I need to connect a server using a V110 modem in order to create
data link between a PDA and this server. I developed a code (VB .net)
for PDA and independent cellular phone using standard AT commands. I
tried to develop a similar approach with HTC Wizard but it seems it is
not possible to send AT commands to the modem (cellular line). To
develop your code you should have solved this problem using TAPI. Could
you explain me how to initiate the cellular line so that I could create
a V110 link.
Thx
I understand more clearly what you want to do now. Unfortunately I have never attempted to use at commands. You said I should have solved this problem in my app, but the point of using tapi is to not have to deal with at commands. Tapi is good for sending data, its my "guess" that whatever the commands you want to send could be generated by tapi to look like whats expected on the other end (assuming the typs of transmitted data match. eg dose the size of one at command correspond to >= the size of one char?).
I think that you would not be able to communicate directly with the modem with at commands until you have stopped tapi/ril from using the port. Again, I have not done this. Search this board to find how to do that. Once you have, try your origional code again. I doubt your normal phone functionality would work after that.
Sorry I could not be of more real help.
I dont have PPC but I do have smartphone instead..
Does the program require CSD line or can use normal GSM? Can you create one similar program that can be used in Samartphone wm5?
It uses normal gsm, ie a voice call. The underlying class in my program can probably work on smartphones, but I do not have one. To be honest I think smartphones are dying. Normal ppc phones are the same size now so to put too much effort into smarphones seems less attractive.
My PPC wm5 cannot dial, the other PPC show CONNECT but...
I was using HP Ipaq and Dopod PPC, The HP Ipaq when dialed it show dial number but nothing dialed to other party. Latter Dialed from Dopod It was shown CONNECT but no connection is establish to other party...
Could you give me the reason. If I am using WM5 is the case, what OS that you are using?
How about using CSD line instead could it possible running properly? Do I need to install certificate and signing the application(exe) as to make the program running in WM5, is what happen to smartphone certain API under privilage zone.
It is my mistake the MyTapUser.exe find in both HP and Dopod
I am sorry since I just bought the SIM card and the provider put some procedure before I can use the line. After consulted the shoper, The shoper activated it for me. Walla! I tested again it worked fine...thanks to you...master!
Some networks can also cause problems. I use vodafone and its 100% ok but I put an optus prepaid in and nothing happened at all. If I understand correctly the network should only be interested in the bearer mode. I use LINEBEARERMODE_VOICE - the same as a voice call so it should be ok. When experimenting with that sim, they will not do anything with a call that contains a LINEMEDIAMODE_DATAMODEM in the call params. Very strange considering they have no use for knowing this.
I am pleased it worked for you. This is realy very old and I will be removing it from my site soon when my new stuff comes out. Even if the myTapiUser seems to work, remember that it is not checking the contents of the transmition. Bad weather for example could cause information to be missed. There are probably problems receiving on the HP that you may not have noticed. Is it the same HP made by quanta? If the HP can receive data after answering an incoming call I would love to know about it. Can you confirm this?
This is my report..
I am using prepaid no csd line.
Device Info
========
1.HP iPAQ TI OMAP1510 - 2003 PPC(memory-57.04MB)
2.DOPOD PXA270-520MHZ WM5(5.1.1..1700)(memory-50.19MB)
HP Dialed Dopod
===========
- HP received data from DOPOD immediately after data was sent.
- DOPOD received data from HP after next sequence of data transmit from HP(sometime error 0052 occur)
DOPOD Dialed HP
============
- HP received immediately data from DOPOD
- DOPOD receiving data from HP after the next sequence of data transmitting.
- error trigger 0052(assembly packet...) in DOPOD
data send perfect 100% correct...
May I know whether, If this method can be used sending digital stream of data, such as, compress voice or image?
Yes it can. I have not done voice because the flow of the transfer would be very different from what I want. If you want to see voice transfer in action over data calls google cryptophone.
In about 15 hours I will be releasing my program. Come back then to see what it can really do. I need to make a page for it on my site and get screen captures etc. Its 2am here so I can't do it now.
incoming call how to get connectted?
I can dial to the receiving phone. My receiving phone use ril to detect the incoming call. After the detection, I can press the green button to answer. My problems is why everytime I answered the call it failed.
I did like below procedure, when ril detect the incoming signal
-lineOpen
-lineAnswer
-lineGetID
Is it the correct way to answer the call? Why 'lineOpen' produce error result?
Can You give the correct way to answer the incoming call for modem like communication.
Thank in advance,
As far as ril goes I know little. You should have opened the line before the call was offering, this includes negotiating the version of tapi to use then finding the correct line then using lineopen. All this has been covered in other threads. The values returned from the api calls are self explanitory so checking them is useful.
The use of linegetid is less straight forward but again it has also been covered in other threads. The thing to remember is that after you use lineanswer to answer an offering call, do not imediately call linegetid. You need to wait for the connected line state. Also check the dwCallbackInstance when looking at line states because as I found with the atom, you need to be sure the results are relevant to your program.
I know that what you really would like is some code but its too complicated to sumarize in a few lines. The best thing to do is start from the beginning ( lineInitializeEx ) and work to the end result ( LineGetID ) checking your errors along the way. You will need another thread to do the checking of the state of the line, and it will have to be properly synchronized if you don't want unexplained crashes. If your program is answering the call, don't touch the phone buttons. When you answer the call cprog.exe owns it and you will not be able to access it. Also is there a reason you are mixing ril with tapi? I would guess it complicates the issue, why not just use tapi or just use ril?
Ril or TAPI
Yes! You are right, either one can be used. I am a little bit confused about the two. Just remember I am new to this kind of development. After sometime I am testing the use of RIL and TAPI both can give the same answer, but better use TAPI from the beginning. And I have to kill the cprog.exe and RegisterHotKey for green button first.
I want to ask you something. Why after several attempt of LINEDEVSTATE_RINGING event, there is no LINECALLSTATE_OFFERING trigger, as this event use to lineAnswer? And what should I do when the LINEDEVSTATE_RINGING event trigger?
Thank in advance
Sorry, I may have been a bit loose with the terminology. Its a while since I coded that part - Line states, line messages I mean. LINECALLSTATE_OFFERING is obtaine this way....
First off, use the event notification method, not the callback window. Wait for the event using WaitForSingleObject then Use lineGetMessage to get a LINEMESSAGE. If the dwMessageID of the LINEMESSAGE is LINE_CALLSTATE then check what call state it is (eg is dwParam1 equal to LINECALLSTATE_OFFERING etc). You can then take action depending on what you want to do, like answer when offering.
I never see LINEDEVSTATE_RINGING because it is not needed by my app because the line messages suffice. Killing cprog.exe on a users device before its neccesary could lead to missed calls, also when it is not running the caller just hears the ringing tone so it seems like they are being ignored. I have also found that the os restarts it again anyway after a while (actually it seems like it dose this after the device has powered down and when a new call comes in).
What is the different when using event and callback function
What I understood that we can use either event or callback function to gain message from TAPI. I am using the callback function to get the LINECALLSTATE_OFFERING, which is different than you, where you are possibly using the Event method (lpLineInitializeExParams->dwOptions = LINEINITIALIZEEXOPTION_USEEVENT - I think you are using this one!).
I still cannot get the status of LINECALLSTAE_OFFERING. Some of the events caught are LINEDEVSTATE_CLOSE and LINEDEVSTATE_OPEN. What is the meaning of LINEDEVSTATE_OPEN stated in the MSDN line is open by other application, does it means that cprog.exe is conqured the line?
The reason I said to use the event method is that I have only done this with it. I could not give any advice about the call back method (although i guess it should give the same results), if you can get it to work then its fine. How are you getting LINEDEVSTATE_CLOSE & LINEDEVSTATE_OPEN? LINEDEVSTATE_XXXXX have nothing to do with LINECALLSTATE_OFFERING. Are you checking for a LINE_CALLSTATE in your call back? I think in the call back method this should be sent to your program.
ie
case:LINE_CALLSTATE;
{
if(dwParam1==LINECALLSTATE_OFFERING)
{
//it is offering
}
}
break;
All LINEDEVSTATE_OPEN is telling you is that cprog is also using the phone to wait for calls (normally cellular line).
If LINE_CALLSTATE it means a call is comming and you can find out about it (eg if its offering). cprog.exe dose not do anything to the call unless the user presses a button or taps on the notification. It dose nothing to the line, cprog will be aware of the same messages that you are and if you set up tapi to use data on a line then unfortunately cprog will also ring when data calls come but other than that there are no issues with it to worry about. If you need proof of this just donwload the current version of GSMbeam and in the settings change the spelling of cprog. When a data call comes in you will see GSMbeam monitoring it then the cprog notification will come up over that monitoring the same call. The program that answers the call first is the one that owns it, until then its not altered.

modem to modem comunication using gsm modem and UART

I am looking the way to make two smartphone wm5 can communicate using CSD line. I am planing to fetch data and sending data through the UART/COM port. The question is how would we know which COM due the GSM modem attached to.
Why the sample tstril.exe have error like RIL HANDLE: 00000000, result 80004005 and also the navigated bar cannot move? - I am using Omap Smartpone wm5.
Thanks in advance
You need to sign the application in order to make it work on most of the smartphones running WM 5.0 (RIL API is priviledged API). PocketPCs are not that tight regarding this subject.
Cheers,
Raul
how to sign applica and get free certificate into smartphone
could you explain the better way on to unlock smartphone using free certificate so Application can access the privilage zone?..
Thanks in advance
Only OEM can give such certificate or sign your certificate with one of their root certificate in order for yours to grant you certain priviledges.
I'm afraid that no free or test certificate will help you. RIL is not ment to be used by spare time developers like us...
Cheers,
Raul
Install and sign certificate using third party CA
I already install certificate (.cer) and signing tstril.exe using signtool.exe using our internal certificate. In my smartphone setting->security->certificates->root , shown my CA name registered. But I couldn't launch my tstril.exe. Can you explain why it is happen eventhough my CA name was registered in the setting.
Could you explain me how can I get the OEM certificate? For your information I am using DOPOD TI OMAP850 Model nameopod577W.
Thanks in advance
To answer your question short if you're not an ISV partner or a 3 rd party working on a RIL involving software that has to be added to the ROM then you will probably not see such certficate.
Nevertheless you can check your code functionality on pocket pc side and overall functionality on 2 pocket pc 2003 SE. The RIL hasn't change...
Then you could try to get in touch with HTC if you target this devices and ask them to sign your internal certficate with their root one so that you can sign your app and work with RIL on smartphone platforms.
Cheers,
Raul Tinca
tstril.exe can't work in my dopod and also hp ipaq and sp
I compile the source code using ms 2005 and deploy it into my Hp 2003 and also dopop wm5 both couldn't work
DOPOD
=====
RIL Handle: 0003274, result 00000000
notify: dwCode=0x800002 lpData=2808FE38, cbData=4
notify: dwCode=0x400005 lpData=2808FD40, cbData=32
HP iPAQ
=====
RIL Handle: 00032510, result 00000000
notify dwCode=0x800002 lpData=2007FE8
.....
Well in this case i see that you have valid handle and also receive data in your notify callbacks...
I don't see where the problem is. Let's take it step by step. What are the first steps you want to achieve ?
Raul
could you explain to me more detail on tstril.exe
sorry for late reply..a little bit preoccupied with other things.
Answer to your question, my aim is to get voice data or to send voice data through the handle. How could it be done?
May I know the purpose of this tstril.exe since I am to much ignorant. ow to use the handler and what kind of data I could get from the handler.
Sorry for stupid question...
Thank you in advance.
Hi all,
Voila!
I found the purpose of it. It use to model the caption of event produce by ril. I already manage to run it into my smartphone after I unlocked the phone. Then I found some event occurred. While I am dialing the other phone to the ril phone I saw events triggered. This can be use tho trap like incoming event since the incoming event in smartphone was interfered by the cprog.exe. Event from TAPI is hardly used especially for incoming (ring on) event.
Please tell me, is this what you mean? The handle shown above is to an event that gets triggered at the same time the message buble for incoming call happens. In my use of tapi the event for incoming calls is always generated but I am interested in what you have found because if it is from ril then maybe it is set sooner (hence give me more time to respond). Also if rersetting this would get rid of the message buble it would be useful.
When you say it was interfeared with by cprog.exe what do you mean? Are you saying it is reset or am I misunderstanding the whole thing?
Since the cprog.exe steal the TAPI event so it is difficult to gain the incoming call event from the callback function. What most of the people did is to kill the cprog.exe by the time incoming call event fired by the ril.
After killing the cprog.exe then invoke lineAccept / lineAnwer to connect the call.
Cprog.exe is program runnning at background. This program will hinder the Application to gain full control on the answering part.
I hope I had given you the correct info..
Sorry but can ask more ?
When you say steal the event do you mean that ril triggers an auto reset event that tapi needs to get to know there is a call comming? That would be interesting and I would experiment.
If you mean that the event is the one accessed by LINEINITIALIZEEXPARAMS initialParams ..... initialParams.Handles.hEvent then this dose not seem to be so. I use that event at the same time that cprog.exe uses it to detect a change in the state of the line, it can't be auto reset (unles tapi maintains seperate events for each application using it).
I only kill cprog.exe if I am sure the call is for data. I would love to know how to just make the incoming call buble go away without killing cprog.exe. If I stop that process just after it set the hardware to vibrate it becomes difficult to stop the vibration. If I could leave it running until the call was no longer offering then cprog would cancel its own vibration.

Phone application cprog.exe

Hi,
I want some information about default phone application cprog.exe.
I want to know how does it communicate with outlook and other application.
I guess most probably it should be via message posting.
But, unfortunately wheni tested the same with spy running on cprog and then i called a contact from outlook contacts.
I see many messages posted to cprog but I found no message or Parameter(WPARAM/LPARAM) to cprog that contains the number to call.
can anyone help me out to get information how to fetch that number? the number passed to phone/cprog.exe from contact.
The same thing i need for sddialer.exe that after matching the sound tag, how it informs cprog that which number to call?
Please help! I am looking these since long...
Good Luck
Best of luck trying to find any doco on cprog (if you do, please post back here!).
If you have a look at this thread you may find what you are looking for (at least how to initiate a call from the PC is there):
http://forum.xda-developers.com/showthread.php?t=295585
Look for LINE_REQUEST message
There a two ways, that an application can make a call; using tapiRequestMakeCall or lineMakeCall. tapiRequestMakeCall is by far the simplest to use. Examples of their use can be found in two sample cellcore progams available from microsoft, CeDialer, and HelloTapi. You could try this and see which produces messages simular to outlook. I'll guess that it's HelloTapi (tapiRequestMakeCall).
When an application uses tapiRequestMakeCall a LINE_REQUEST message is sent to the call-control application. This application must then call lineGetRequest to get information on the request. It then must execute the request.
See the remarks on the lineRegisterRequestRecipient page at microsoft
http://msdn2.microsoft.com/en-us/library/ms736043.aspx
I wish there was a similar Hello USSD example for the lineSendUSSD API. There's very little information on it... No one seems to be able to capture the responses past the first call.
oops missed part of your question
After the call app places the call, it should get a series of messages, mostly LINE_CALLINFO and LINE_CALLSTATE. The messages contain a handle for the call. Once you have the call handle you should be use the lineGetCallInfo and lineGetCallState functions to get info about the call. I think lineGetCallInfo includes the number that was called. The callstate typically goes through dialling, progressing, and then connected. I believe your not supposed to use the call handle until after a LINE_REPLY message is sent, saying the call didn't fail. If there are problems perhaps you should wait a short time.
To find out more about the messages, you could play with the CeDialer sample. It's linecallbackfunc looks at the messages, it would be easy to put in a few logging statements to see what's in each message. It think CeDialer will only get messages for inbound calls, and calls that it originated. (not ones by cprog.) Although you should check to be sure that I'm correct.
Good luck! Please, let us know whatever you might find out.
Hi,
I will look into this and post reply according As soon as possible.
Thanks
Where i can find the original cprog.exe to install in my non phone PDA? it's the dialer for voip.
Many thanks

Sending SMSs with destination port number

Hi All!!!
Although I've been reading this forum from a long time, this is my first post.
I'm developing an application that integrates a GPS application (implemented in C++ using WM6 SDK) that should send a SMS to a Midlet application wich is a tracking application. In this journey I faced what seems to be a tough problem: I need to send an SMS from a C++ application to a Midlet application with the GPS coordinates.
It seems to be easy at first glance but as the J2ME community knows, Midlet applications can only receive messages that comes to a specific port number registered by the application.
I know to which port number I have to send the damm message, but WM6 SDK SMS API doesn't even mention a "port number". So I don't know how to specify it to the SmsSendMessage function.
My gess is that it has to be encoded in the parameter pbProviderSpecificData but I have no idea of how it should be encoded there.
WM6 SDK SMS API reference: http://msdn2.microsoft.com/en-us/library/aa919102.aspx
Any one has faced this problem before or could point me to the right direction?
Any comment on this is welcome.
Thanks in advance.

Categories

Resources