Click here to Skip to main content
15,915,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalneed of a project Pin
anithar12-Jun-02 0:54
anithar12-Jun-02 0:54 
GeneralPointer to a vector Pin
John Oliver11-Jun-02 23:37
John Oliver11-Jun-02 23:37 
GeneralRe: Pointer to a vector Pin
John Oliver11-Jun-02 23:50
John Oliver11-Jun-02 23:50 
GeneralRe: Pointer to a vector Pin
Rama Krishna Vavilala12-Jun-02 0:06
Rama Krishna Vavilala12-Jun-02 0:06 
GeneralRe: Pointer to a vector Pin
Joaquín M López Muñoz11-Jun-02 23:51
Joaquín M López Muñoz11-Jun-02 23:51 
GeneralRe: Pointer to a vector Pin
gazihan12-Jun-02 0:54
gazihan12-Jun-02 0:54 
GeneralRe: Pointer to a vector Pin
Christian Graus12-Jun-02 2:02
protectorChristian Graus12-Jun-02 2:02 
GeneralCall Dropped under TAPI 2 Pin
Derek Lakin11-Jun-02 23:27
Derek Lakin11-Jun-02 23:27 
I am writing an application using TAPI 2.0 on Win NT4 (the other end will be Win98) to answer calls. So far I haven't made much progress Frown | :(

TAPI is initialised okay and a line opened successfully. I then call lineSetStatusMessages as follows:
DWORD dwLineStates = LINEDEVSTATE_CLOSE |
	LINEDEVSTATE_CONNECTED | LINEDEVSTATE_DISCONNECTED |
	LINEDEVSTATE_RINGING;
lRes = lineSetStatusMessages(m_hLine, dwLineStates, 0);


In my TAPI event handling thread I have the following code to handle the events of interest:
// TAPI's got something to tell us
LINEMESSAGE lineMess;
long lRes = lineGetMessage(g_hLineApp, &lineMess, 0);

if(lRes < 0)
{
	TRACE1(_T("lineGetMessage failed returning 0x%X\n"), lRes);
}
else
{
	// Process the message
	TRACE1(_T("Call Handle: 0x%X\t"), lineMess.hDevice);
	TRACE3(_T("dwMessageID: %d\tdwParam1: 0x%X\tdwParam2: 0x%X\n"),
		lineMess.dwMessageID, lineMess.dwParam1, lineMess.dwParam2);
	switch(lineMess.dwMessageID)
	{
	case LINE_CALLSTATE :	// Sent after change of call state
		switch(lineMess.dwParam1)
		{
		case LINECALLSTATE_OFFERING : // Incoming call is Offering
			{
				lRes = lineAnswer(g_hCall, NULL, 0);
				TRACE1(_T("lineAnswer returned 0x%X\n"), lRes);
			}
			break;
		case LINECALLSTATE_DISCONNECTED : // Call ended
			{
				lRes = lineDrop(g_hCall, NULL, 0);
				TRACE1(_T("lineDrop returned 0x%X\n"), lRes);
			}
			break;
		}
		break;
	}
}


This produces the following trace output:
Call Handle: 0x982AE8	dwMessageID: 23	dwParam1: 0x0		dwParam2: 0x982BC0
Call Handle: 0x982BC0	dwMessageID: 2	dwParam1: 0x2		dwParam2: 0x0
lineAnswer returned 0x1
Call Handle: 0x982AE8	dwMessageID: 8	dwParam1: 0x2		dwParam2: 0x1
Call Handle: 0x0	dwMessageID: 12	dwParam1: 0x1		dwParam2: 0x0
Call Handle: 0x982BC0	dwMessageID: 2	dwParam1: 0x4		dwParam2: 0x0
Call Handle: 0x982BC0	dwMessageID: 2	dwParam1: 0x4000	dwParam2: 0x800
lineDrop returned 0x2
lineDeallocateCall returned 0x0
Call Handle: 0x982BC0	dwMessageID: 2	dwParam1: 0x1		dwParam2: 0x0
Call Handle: 0x0	dwMessageID: 12	dwParam1: 0x2		dwParam2: 0x0
Call Handle: 0x982AE8	dwMessageID: 3	dwParam1: 0x0		dwParam2: 0x0


which can be interpreted as:

dwMessageID: LINE_APPNEWCALL
dwMessageID: LINE_CALLSTATE	dwParam1: LINECALLSTATE_OFFERING
lineAnswer returned 0x1
dwMessageID: LINE_LINEDEVSTATE	dwParam1: LINEDEVSTATE_RINGING
dwMessageID: LINE_REPLY	        dwParam1: 0x1 (Request ID)
dwMessageID: LINE_CALLSTATE	dwParam1: LINECALLSTATE_ACCEPTED
dwMessageID: LINE_CALLSTATE	dwParam1: LINECALLSTATE_DISCONNECTED	dwParam2: LINEDISCONNECTED_UNAVAIL
lineDrop returned 0x2
lineDeallocateCall returned 0x0
dwMessageID: LINE_CALLSTATE	dwParam1: LINECALLSTATE_IDLE
dwMessageID: LINE_REPLY	        dwParam1: 0x2 (Request ID)
dwMessageID: LINE_CLOSE


As you can see. When a call is received it is answered successfully, but then the LINE_CALLSTATE changes to LINECALLSTATE_DISCONNECTED straight away. The reason code is UNAVAIL, which means it doesn't know and never will Frown | :(

The call is being initiated on a Win98 PC using Hyperterminal. The really frustrating part is that the initiating modem thinks it is connected. Issuing the command AT+CPAS gives a return code of 4, which means Call in Progress!

Even more frustratingly, if a carry out a call from Hyperterminal to Hyperterminal across the 2 PCs it works without problem Mad | :mad:

Any ideas where I'm going wrong? Why does it think the line has been disconnected when it hasn't?

Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.

Salamander Software Ltd.
GeneralRe: Call Dropped under TAPI 2 Pin
Joaquín M López Muñoz11-Jun-02 23:58
Joaquín M López Muñoz11-Jun-02 23:58 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 0:57
Derek Lakin12-Jun-02 0:57 
GeneralRe: Call Dropped under TAPI 2 Pin
Michael P Butler12-Jun-02 0:43
Michael P Butler12-Jun-02 0:43 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 1:07
Derek Lakin12-Jun-02 1:07 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 2:15
Derek Lakin12-Jun-02 2:15 
GeneralRe: Call Dropped under TAPI 2 Pin
Michael P Butler12-Jun-02 4:28
Michael P Butler12-Jun-02 4:28 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 5:22
Derek Lakin12-Jun-02 5:22 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 7:52
Derek Lakin12-Jun-02 7:52 
GeneralRe: Call Dropped under TAPI 2 Pin
Michael P Butler12-Jun-02 11:24
Michael P Butler12-Jun-02 11:24 
GeneralRe: Call Dropped under TAPI 2 Pin
Derek Lakin12-Jun-02 22:00
Derek Lakin12-Jun-02 22:00 
Questionhow to properly create and use project files Pin
gazihan11-Jun-02 23:12
gazihan11-Jun-02 23:12 
AnswerRe: how to properly create and use project files Pin
Joaquín M López Muñoz12-Jun-02 0:03
Joaquín M López Muñoz12-Jun-02 0:03 
GeneralRe: how to properly create and use project files Pin
gazihan12-Jun-02 0:36
gazihan12-Jun-02 0:36 
GeneralRe: how to properly create and use project files Pin
Nish Nishant12-Jun-02 0:42
sitebuilderNish Nishant12-Jun-02 0:42 
GeneralRe: how to properly create and use project files Pin
gazihan12-Jun-02 1:00
gazihan12-Jun-02 1:00 
GeneralRe: how to properly create and use project files Pin
Nish Nishant12-Jun-02 1:23
sitebuilderNish Nishant12-Jun-02 1:23 
AnswerRe: how to properly create and use project files Pin
Rage12-Jun-02 1:16
professionalRage12-Jun-02 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.