Hi Developer!

I will send a operator string to network like *#<number>#
Thats not a normal phone call, but there does'nt exist a command string for
that command and i have to dial.

But if i call that function below two times, the phone (mobile) lost the
connection to network.
I don't see the problem. I've read documentations on palmos.com but all of
these say its correct.
Can anyone give me a hint?

Thanks!
Patrick

function
{
 Err  error;
 UInt16  TelRefNum;
 UInt16  TransID;
 TelAppID TelAppID;
 Boolean  bLoaded = false;
 Boolean  bConnected = false;

 // Find and load the telephony library
 error = SysLibFind (kTelMgrLibName, &TelRefNum);
 if (error)
 {
  error = SysLibLoad(kTelMgrDatabaseType, kTelMgrDatabaseCreator,
       &TelRefNum);
  if (!error)
  {
   bLoaded = true;
  }
 }
 if (error)
  return error;

 // Open the telephony library
 error = TelOpen (TelRefNum, kTelMgrVersion, &TelAppID);
 if (error)
  goto UnloadTelLib;

 // check availability
 error = TelIsSpcServiceAvailable(TelRefNum, TelAppID, NULL);
 if (error)
  goto CloseTelLib;
 error = TelIsSpcCallNumberSupported(TelRefNum, TelAppID, NULL);
 if (error)
  goto CloseTelLib;

 // get the phone number
 error = TelSpcCallNumber (TelRefNum, TelAppID, "*#...#", &TransID);
 if (error)
  goto CloseTelLib;

// error = TelSpcCloseLine (TelRefNum, TelAppID, 0, NULL);


 bConnected = true;

CloseTelLib:
 // Close the telephony library
 error = TelClose (TelRefNum, TelAppID);

UnloadTelLib:
 // Unload the library (if we loaded it)
 if (bLoaded)
 {
  error = SysLibRemove (TelRefNum);
  UTIL_ShowInfoMessage (0, "get: ", "remove");
 }

 return error;
}




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to