Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lineSetAppPriority doesn't work?

1 view
Skip to first unread message

Mirko Schenk

unread,
Apr 28, 2005, 8:44:30 AM4/28/05
to
Hi,

I want to handle incoming calls before the default popup appears (to
replace the ringtone).
I use the following code:

Initialization:
---------------

if ( lineInitialize( &LineApp, theApp.m_hInstance, LineCallback,
theApp.m_pszAppName, &LineHandleCount ) == 0 )
{
LineHandles = new HLINE[LineHandleCount];
for(DWORD i = 0; i < LineHandleCount; i++)
{
if ( lineNegotiateAPIVersion( LineApp, i, 0x00010000, 0x00020000,
&ver, &extensionID ) == 0 )
{
rc = lineOpen( LineApp, i, &LineHandles[i], ver, 0, (DWORD)this,
LINECALLPRIVILEGE_MONITOR|LINECALLPRIVILEGE_OWNER,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL );
if ( rc < 0 )
LineHandles[i] = NULL;
else
if ( LineHandleSignal == NULL )
LineHandleSignal = LineHandles[i];
}
}
HRESULT res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE,
NULL,
LINEREQUESTMODE_MAKECALL,
NULL, 1 );
}

Callback:
---------
VOID FAR PASCAL LineCallback( DWORD hDevice,
DWORD dwMsg,
DWORD dwCallbackInstance,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3
)
{
if ( dwMsg == LINE_CALLSTATE )
{
LINECALLINFO *callInfo = (LINECALLINFO *)calloc(sizeof(LINECALLINFO)
+1024, 1);
callInfo->dwTotalSize = sizeof(LINECALLINFO)+1024;
lineGetCallInfo( (HCALL)hDevice, callInfo );

// different stuff...

HRESULT res;

// Remove from priority list, so lineHandoff will run the default
// call window
res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL,
LINEREQUESTMODE_MEDIACALL, NULL, 0 );

// Forward event to next instance (usually Windows' phone app)
lineHandoff( (HCALL)hDevice, NULL, callInfo->dwMediaMode );

// Set to top priority again
res = lineSetAppPriority( theApp.m_pszAppName,
LINEMEDIAMODE_INTERACTIVEVOICE, NULL,
LINEREQUESTMODE_MEDIACALL, NULL, 1 );
}


lineSetAppPriorty returns OK in all cases. But when a call comes in, the
default bubble applears simultaneously with the callback function. I
wanted it to be shown when I do the lineHandoff...
What am I doing wrong?

TIA,
Mirko

crino

unread,
Apr 28, 2005, 4:06:41 PM4/28/05
to
I've tryied with lineSetCallPrivilege but without success too
I'm waiting news :))


"Mirko Schenk" <mo...@sto-helit.de> ha scritto nel messaggio
news:Xns964695E81...@212.19.48.35...

0 new messages