Article View: microsoft.public.win32.programmer.tapi
Article #1Re: Caller-ID, i think i'm halfway...
From: Michael Dunn
Date: Tue, 04 Jan 2000 00:00
Date: Tue, 04 Jan 2000 00:00
94 lines
6059 bytes
6059 bytes
By the way, I'm replying from the microsoft.public.win32.programmer.tapi newsgroup. You may want to pare down the list of groups you are posting to. I am posting to all because I don't know which groups you may be monitoring. Stefan/GertJan wrote: > Hello all, > > I've been busy lately with reading the tapi.hlp file, and especcialy the > part on Caller-ID, and this is what i've found out until now: > I'm curious, where did you get a tapi.hlp file from? I've not familiar with it. > My app needs to be able to receive messages from tapi, and especcialy > LINECALLSTATE_OFFERING messages. But here's my first problem. How do i do > this? What i've read is that you have to do it with phoneSetStatusMessages. > And if this is true, how do i get the hPhone handle which is needed in the > function? and another problem with phoneSetStatusMessages: > which dwPhoneStatus should be enabled for me to be able to receive > LINECALLSTATE_OFFERING messages? LINE_CALLSTATE messages are always sent, you do not need to turn them on/off with SetStatusMessages. Furthermore, you are likely not going to be doing anything that requires phoneXxx functions (depending on what you are doing and what hardware you are using). You are actually looking for a LINE_CALLSTATE message with a LINECALLSTATE_OFFERING flag in one of it's variables. Callbacks are hard in some languages. You will need to study how Delphi implements them and maybe find some source code. If you are using TAPI 2.1 there are multiple ways of handling Callbacks. Also, if you are using a OCX, much of this type of thing is simplified. If the language isn't all that important to you, then I suggest C++. > Some sample code for Delphi would be really cool. > So when i receive an offering message, i need to check the dwParam1 to see > what's happening... and then with LineGetCallInfo(dwDevice, > LPLINECALLSTATUS) i need to get the caller-id? > I know that i can get the dwDevice-handle from the LINE_CALLSTATE message, > but what is LPLINECALLSTATUS about? What does it do? What do i need it for? > How do i use it? > In the help file they say that it's a pointer to a variable of type > LINECALLSTATUS, but since i'm an absolute beginner and my english isnt good > enough (i think), i dont know what they're saying... or meaning... LINECALLINFO is a structure that contains many variables. Anything that starts with LP (which means Long Pointer) is a pointer to a structure. The LINECALLINFO structure contains the CallerID information. LINECALLSTATUS is not involved with CallerID. Normally: lineInitialize to initialize TAPI and find out how many devices are present. lineOpen with a deviceID to open a line. You may have to play around with Privileges and Media Modes. For incoming calls, you will receive messages like LINE_NEWCALL, LINE_CALLSTATE, and LINE_CALLINFO. Other parameters in these messages will tell you more information. The LINE_CALLINFO message may include the LINECALLINFOSTATE_CALLERID flag which indicates that CallerID information is available. lineGetCallInfo will return having filled in the LINECALLINFO structure you passed it. This structure will contain information including CallerID, if available. The CallerId is stored via a Size/Offset set of variables. In other words, it is appended to the end of the LINECALLINFO structure in a variably-sized data portion. Add the xxxOffset to the pointer to LINECALLINFO to get a pointer to the string, of size xxxSize. It's complicated. I hope you know your programming language well. > Again, some sample code would be usefull. > And ofcourse, the age old question: Is this it, or is there more to it? > > Please help me out, i've looked at several components on several > delphi-pages, but none of them actually worked, so please no more pointers > to web-pages, cuz until now what i found there hasn't been of any use to me. Instead of Delphi pages, I want to point you to TAPI pages. My page is fairly good and you should take a look. You will want to look specifically at the MSDN Library, which contains the TAPI specification. You will want to get a copy of the TAPI Browser, which is a program that allows you to explore the API and try out all the things I have mentioned before writing any code. It is a very useful tool. > And for the dutch people: Sorry datie in't Engels is, maar had > weinig tijd om naar Nederlands terug te vertalen. Mijn excuses! Sorry, not Dutch. I'm having enough problems with the German of my mother and the Danish of my girlfriend's family. I actually can't speak a word of those either, except where food is concerned. :) -- Michael Dunn is a TAPI Developer and Tester for Tri-Link Technologies My TAPI web page: http://mindlink.net/mike_dunn/tapi.htm All opinions are my own, and do not reflect those of my employer "When all else fails, read the directions"
Technical Details
Message-ID:
<38727B07.2B5BC6E1@tri-linktech.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8409vf$8bne$1@reader3.wxs.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108b9d,e98e4623e4c856e9 X-Google-Attributes: gid108b9d,public X-Google-Thread: 10923d,e98e4623e4c856e9 X-Google-Attributes: gid10923d,public X-Google-Thread: 107324,e98e4623e4c856e9 X-Google-Attributes: gid107324,public X-Google-Thread: 1043cf,e98e4623e4c856e9 X-Google-Attributes: gid1043cf,public X-Google-Thread: 105ac8,e98e4623e4c856e9 X-Google-Attributes: gid105ac8,public X-Google-Thread: 10f389,e98e4623e4c856e9 X-Google-Attributes: gid10f389,public From: Michael Dunn <michaeld@tri-linktech.com> Subject: Re: Caller-ID, i think i'm halfway... Date: 2000/01/04 Message-ID: <38727B07.2B5BC6E1@tri-linktech.com> X-Deja-AN: 568363404 Content-Transfer-Encoding: 7bit References: <8409vf$8bne$1@reader3.wxs.nl> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Tri-Link Technologies MIME-Version: 1.0 Newsgroups: microsoft.public.win32.programmer.tapi,nl.telecom,nl.comp.programmeren,alt.business.telecommunication,alt.comp.borland-delphi,borland.public.delphi.objectpascal