lineInitialize()
lineOpen(m_hLineApp, dwDeviceID, &hLine, dwAPIVersion, 0, 0,
LINECALLPRIVILEGE_OWNER, LINEMEDIAMODE_DATAMODEM, 0);
Fill out a LINECALLPARAMS struct. Here's an example:
Note the use of dwBearerMode = LINEBEARERMODE_PASSTHROUGH. That's the key to making it work.
LINECALLPARAMS CallParams;
ZeroMemory(&CallParams, sizeof(LINECALLPARAMS));
CallParams.dwTotalSize = sizeof(LINECALLPARAMS);
// This is where we configure the device to allow us direct access to the modem in command mode
CallParams.dwBearerMode = LINEBEARERMODE_PASSTHROUGH;
// This specifies that we want to use only IDLE calls and
// don't want to cut into a call that might not be IDLE (ie, in use).
CallParams.dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
// We will assume there is only one address and use it (normal modem)
CallParams.dwAddressMode = LINEADDRESSMODE_ADDRESSID;
CallParams.dwAddressID = 0;
// Unimodem ignores these values.
(CallParams.DialParams).dwDialSpeed = 0;
(CallParams.DialParams).dwDigitDuration = 0;
(CallParams.DialParams).dwDialPause = 0;
(CallParams.DialParams).dwWaitForDialtone = 0;
// We're using lineMakeCall to open a "call" but it doesn't actually
// dial when dwBearerMode = LINEBEARERMODE_PASSTHROUGH. The
// "passthrough" call is used to set modem parameters such as baud rate,
// parity, data bits, etc.
lineMakeCall(m_hLine, // Handle to the open line device on which a call is to be originated.
&m_hCall, // Long pointer to an HCALL handle.
"", // the telephone number
1, // Country Code
&CallParams); // the structure you just set up
//Wait for the LINE_REPLY...
lineGetID(hLine, 0L, NULL, LINECALLSELECT_LINE, lpVarString,"comm/datamodem");
hCommFile = *((LPHANDLE)((LPBYTE)lpVarString + lpVarString -> dwStringOffset));
GetCommConfig(hCommFile, commconfig, &size);
modemsettings = (MODEMSETTINGS*) &commconfig->wcProviderData;
//Do whatever you need to do...
SetCommConfig(hCommFile, commconfig, size);
lineGetDevConfig(0,lpVarString,"comm/datamodem")
lineDrop()
lineSetDevConfig(0,lpVarString",comm/datamodem")
//Do your normal call using lineMakeCall