阅读:2407回复:1
TAPI的问题?
平台是WINCE 5 ,串口2上接了一个GPRS模块,现在拨号上网和浏览网页都没有问题。通过AT指令打电话也可以。但是使用TAI 来拨号却找不到语音设备,无法打电话。
代码如下: dwMediaMode = LINEMEDIAMODE_AUTOMATEDVOICE;// for voice this should be memset(&stInitParams, 0, sizeof(LINEINITIALIZEEXPARAMS)); // set the options... stInitParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); stInitParams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT; // Initialize TAPI. lRet = lineInitializeEx(&m_hLineApp, NULL, NULL, L"CallAnswer", &dwNumDevs, &dwTAPIVer, &stInitParams); if(lRet) //error return lRet; // Got the event handle... m_hLineEvent = stInitParams.Handles.hEvent; m_nDevID = -1; // go through the device list and select the appropriate device to transfer voice for(int i=0;i<dwNumDevs;i++) { lRet = lineNegotiateAPIVersion(m_hLineApp, i, dwTAPIVer, dwTAPIVer, &dwTmpVer, &stExtID); if(lRet != 0) continue; lpDevCaps = (LINEDEVCAPS *)malloc(sizeof(LINEDEVCAPS)+1024);// Allocate a little extra memory... memset(lpDevCaps, 0, sizeof(LINEDEVCAPS)+1024); lpDevCaps->dwTotalSize = sizeof(LINEDEVCAPS)+1024; lRet = lineGetDevCaps(m_hLineApp, i, dwTmpVer, 0, lpDevCaps); if(lRet) //error { free(lpDevCaps); lpDevCaps=NULL; continue; } char *szText = ((char*)lpDevCaps) + lpDevCaps->dwLineNameOffset;// FOR DEBUGGING // for more refer LINEMEDIAMODE_ Constants in MSDN printf("%d dwMediaModes %x\n",i,lpDevCaps->dwMediaModes); if(lpDevCaps->dwMediaModes & dwMediaMode) { free(lpDevCaps); m_nDevID = i; break; } free(lpDevCaps); } if(m_nDevID < 0) return LINEERR_BADDEVICEID; // no device available // Open the line... lRet = lineOpen(m_hLineApp, m_nDevID, &m_hLine, dwTAPIVer, 0x00000000, 1,LINECALLPRIVILEGE_OWNER,dwMediaMode,NULL); if(lRet) { lineShutdown(m_hLineApp); return lRet; } // We want to be notified for everything lRet = lineSetStatusMessages(m_hLine, 0x1ffffff, 0); if(lRet) { lineShutdown(m_hLineApp); return lRet; } ///////////////////////////////////////////// 在lineGetDevCaps得到的设备都是LINEMEDIAMODE_DATAMODEM。 请问高手看看,是不是在注册表里还有什么设置,告诉系统串口2的设备是语音设备。 |
|
沙发#
发布于:2010-11-15 10:55
我的问题是如何没有设置对应的COM2的波特率,怎么实现相关的设置?
|
|