PDA

View Full Version : accept data connection with HTC tornado (GSM/TAPI)


tq
05-05-2006, 07:51 PM
Hi,
I have 2 HTC Tornado (T-Mobile SDA) smartphone and Visual Studio 2005. I want to connect them over a GSM data connection. For this risen, I write a little class "myTAPI".
If I use the "LINEMEDIAMODE_INTERACTIVEVOICE" media mode, I can dial and answer speech calls. But if I change the mode to "LINEMEDIAMODE_DATAMODEM", something go wrong. If call the second smartphone with my application, I see for a half second 2 arrows in the right left corner. "lineGetLineDevStatus" returns one active call, for the moment. But I can't get the call over "lineGetMessage" . So I have no hCall Handle.
If I call to PSTN, my phone ring. If I answer by hand, I hear a modem tone.

Program calling phone
TAPIDev.getMessage();
TAPIDev.getMessage();
TAPIDev.getMessage();
TAPIDev.dial(CString("01716597462"), LINEMEDIAMODE_DATAMODEM);//01716597462
TAPIDev.getMessage();
TAPIDev.getMessage();
TAPIDev.getMessage();
TAPIDev.getMessage();
//TAPIDev.openSerial();
TAPIDev.getStatus();
TAPIDev.getMessage();
TAPIDev.getStatus();
Sleep(5000);

Program waiting phone

for(i = 0; i < 60; ++i){
TAPIDev.getStatus();
TAPIDev.getMessage();
}


Can someone help me?
Or have someone sample code, that works on tornado.

My sourcecode:
- mytapi: my TAPI class
- open: open the connection
- dial: dial an number
- getMessage: lineGetMessage and answer if possible a call
- getStatus: lineGetLineDevStatus - output for debugging

Thanks


Thomas

tq
19-05-2006, 10:30 PM
Hi,
I implement the same program ( connecting two gsm phones over a gsm data channel) with RIL instance of TAPI. But I have the same problem. The calling smartphone works, but den second smartphone not answer. I only see 2 small arrows in the right left corner for a second.

In an other forum, I read, I have to kill "cprog.exe" but the result is the same.

It down work!

Have somebody a idea?

my code for the calling phone

HRESULT result;
DWORD dwNotificationClasses = 0xFF0000;
HRIL g_hRIL = 0;
DWORD pdwVersion;
result = RIL_Initialize(1, ResultCallback, NotifyCallback, dwNotificationClasses, g_dwParam, &g_hRIL);
TRACE(TEXT("RIL_Initialize: 0x%0X \n"), result);
result = RIL_GetDriverVersion(
g_hRIL, // @parm handle to RIL instance returned by <f RIL_Initialize>
&pdwVersion // @parm pointer to version. HIWORD is major version, LOWORD is minor version
);
TRACE(TEXT("RIL_GetDriverVersion 0x%0X \n"), pdwVersion);

result = RIL_Dial(
g_hRIL,
"123",
RIL_CALLTYPE_DATA, // @parm type of the call to establish (<def RIL_CALLTYPE_> constant)
RIL_DIALOPT_NONE // @parm dialing options (any combination of <def RIL_DIALOPT_> constants)
);

TRACE(TEXT("RIL_Dial: %d\n"), result);

Sleep(30000);
result = RIL_Hangup(
g_hRIL // @parm handle to RIL instance returned by <f RIL_Initialize>
);
TRACE(TEXT("RIL_Hangup: 0x%0X \n"), result);
Sleep(20000);
result = RIL_Deinitialize(g_hRIL);
TRACE(TEXT("RIL_Deinitialize: 0x%0X \n"), result);


my code for the answering phone:

HRESULT result;
DWORD dwNotificationClasses = 0xFF0000;
HRIL g_hRIL = 0;
DWORD pdwVersion;
result = RIL_Initialize(1, ResultCallback, NotifyCallback, dwNotificationClasses, g_dwParam, &g_hRIL);
TRACE(TEXT("RIL_Initialize: 0x%0X \n"), result);
result = RIL_GetDriverVersion(
g_hRIL, // @parm handle to RIL instance returned by <f RIL_Initialize>
&pdwVersion // @parm pointer to version. HIWORD is major version, LOWORD is minor version
);
TRACE(TEXT("RIL_GetDriverVersion 0x%0X \n"), pdwVersion);
Sleep(20000);
result = RIL_Answer( g_hRIL );
TRACE(TEXT("RIL_Answer: 0x%0X \n"), result);

Sleep(20000);
result = RIL_Deinitialize(g_hRIL);
TRACE(TEXT("RIL_Deinitialize: 0x%0X \n"), result);


my output for the calling phone:
Load module: myRIL.exe
Load module: shellres.dll
Load module: shutil.dll
Load module: commctrl.dll
Load module: aygshell.dll
Load module: tshres.dll.0407.mui
Load module: tshres.dll
Load module: oleaut32.dll
Load module: ole32.dll
Load module: ossvcs.dll
Load module: ril.dll
Load module: coredll.dll
RIL_Initialize: 0x0
RIL_GetDriverVersion 0x10000
NotifyCallbackRIL_Dial: 468
notify: dwCode=0x800002 lpData=303BFE88, cbData=4
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
ResultCallbackresult: dwCode=5, hrCmdID=468 lpData=00000000, cbData=0
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=303BFD90, cbData=32
RIL_Hangup: 0x1D5
NotifyCallbacknotify: dwCode=0x10005 lpData=00000000, cbData=0
ResultCallbackresult: dwCode=1, hrCmdID=469 lpData=00000000, cbData=0
The thread 0x2d266852 has exited with code 0 (0x0).
RIL_Deinitialize: 0x0
Load module: t9ime.dll

my output for the answering phone:
Load module: myRIL.exe
Load module: shellres.dll
Load module: shutil.dll
Load module: commctrl.dll
Load module: aygshell.dll
Load module: tshres.dll.0407.mui
Load module: tshres.dll
Load module: oleaut32.dll
Load module: ole32.dll
Load module: ossvcs.dll
Load module: ril.dll
Load module: coredll.dll
RIL_Initialize: 0x0
RIL_GetDriverVersion 0x10000
NotifyCallbacknotify: dwCode=0x800002 lpData=2E3BFE88, cbData=4
NotifyCallbacknotify: dwCode=0x400005 lpData=2E3BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x10001 lpData=2E3BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x80001 lpData=00292810, cbData=1576
NotifyCallbacknotify: dwCode=0x10005 lpData=00000000, cbData=0
NotifyCallbacknotify: dwCode=0x400005 lpData=2E3BFD90, cbData=32
RIL_Answer: 0x7E
ResultCallbackresult: dwCode=3, hrCmdID=126 lpData=2E3BFD90, cbData=4
NotifyCallbacknotify: dwCode=0x400005 lpData=2E3BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=2E3BFD90, cbData=32
NotifyCallbacknotify: dwCode=0x400005 lpData=2E3BFD90, cbData=32
The thread 0xccf055b6 has exited with code 0 (0x0).
RIL_Deinitialize: 0x0
Load module: t9ime.dll
Unload module: ril.dll


Thanks for help


Thomas

tq
06-06-2006, 06:33 PM
the registry hack don't work but signing the programm do it

SICKQQQ
20-10-2006, 06:00 AM
I use two Dopod 900 to test my data call program,
when I register to PSTN and make first data call by my program, it failed...

but after dial video phone by default dialer, I can make a data call and transfer data through ReadFile/WriteFile, does somebody know about that?

ittaym
13-12-2006, 02:41 PM
dose any one of you know why this could happen ??
i drop the cprog.exe with the function kill_cprog



void kill_cprog()
{
HANDLE Proc, ProcTree;
PROCESSENTRY32 pe;
BOOL ret_val;

/* Get processes tree */
ProcTree = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

pe.dwSize = sizeof(PROCESSENTRY32);

/* Search for cprog process in a process tree */
for(ret_val = Process32First(ProcTree, &pe); ret_val; ret_val = Process32Next(ProcTree, &pe))
{
if(!wcsicmp(TEXT("cprog.exe"),pe.szExeFile))
{
/* Terminate cprog */
Proc = OpenProcess(0, 0, pe.th32ProcessID);
TerminateProcess(Proc, 0);
CloseHandle(Proc);
break;
}
}

CloseToolhelp32Snapshot(ProcTree);
}




and open the line on this mode
nRetCode = ::lineOpen(m_LineHandle, i, &m_hLine, TAPI_API_HIGH_VERSION,0, (DWORD)m_hWnd, LINECALLPRIVILEGE_OWNER , LINEMEDIAMODE_DATAMODEM , CallParams);


i used the callback

nRetCode = lineInitializeEx( &m_LineHandle, 0, (LINECALLBACK)lineCallbackFunc, (LPCWSTR)"MSM TAPI", &m_dwLines, &MaxTAPIVersion, Params );


and i cant get any callback while in create a call



please help me with this cuz it's make me so confusion

SICKQQQ
14-12-2006, 05:00 AM
dose any one of you know why this could happen ??
i drop the cprog.exe with the function kill_cprog



void kill_cprog()
{
HANDLE Proc, ProcTree;
PROCESSENTRY32 pe;
BOOL ret_val;

/* Get processes tree */
ProcTree = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

pe.dwSize = sizeof(PROCESSENTRY32);

/* Search for cprog process in a process tree */
for(ret_val = Process32First(ProcTree, &pe); ret_val; ret_val = Process32Next(ProcTree, &pe))
{
if(!wcsicmp(TEXT("cprog.exe"),pe.szExeFile))
{
/* Terminate cprog */
Proc = OpenProcess(0, 0, pe.th32ProcessID);
TerminateProcess(Proc, 0);
CloseHandle(Proc);
break;
}
}

CloseToolhelp32Snapshot(ProcTree);
}




and open the line on this mode
nRetCode = ::lineOpen(m_LineHandle, i, &m_hLine, TAPI_API_HIGH_VERSION,0, (DWORD)m_hWnd, LINECALLPRIVILEGE_OWNER , LINEMEDIAMODE_DATAMODEM , CallParams);


i used the callback

nRetCode = lineInitializeEx( &m_LineHandle, 0, (LINECALLBACK)lineCallbackFunc, (LPCWSTR)"MSM TAPI", &m_dwLines, &MaxTAPIVersion, Params );


and i cant get any callback while in create a call



please help me with this cuz it's make me so confusion

maybe you can use RIL to receive RIL_NOTIFY_DATASVCNEGOTIATED and RIL_NOTIFY_CONNECT .

eelco_akker
14-12-2006, 11:27 PM
just a thought, but isn't a data subscrription/number required to receive data calls, like e.g. fax?

Eelco