I was wrong. The log-in, log-off will happen independent of the application.
"Mohan Maganti" wrote:
> Andreas,
> I was looking into what I need to accomplish. I think I need some help. I
> will state what I need again --
> From the PC
> 1) log-in , log-off from the phone system (samsung)
> 2) Monitor any incoming calls on that particular phone "NODE".
> 3) When a call comes-in, display some UI depending on the caller-ID.
> 4) Know when the call ends and do some thing else (in the UI and other parts
> of the application)
> Here is what I had done until now. I pulled some portions from internet and
> some from the MSDN website.
> There are lot of unknowns for me here.
> The code posted does not do what I need to do, but I thought it is a start
> 1) What do I need to know to accomplish what I need to.?
> 2) Can any one please give me some function names (atleast) so that I can
> be helped.
> 3) Thanks. Awaiting any help
> *************************************************
> HRESULT hr=NULL;
> // Initialize COM.
> hr = CoInitializeEx(
> NULL,
> COINIT_MULTITHREADED
> );
> // If (hr != S_OK) process the error here.
> // Create a TAPI entry point object.
> ITTAPI *gpTapi; // globally allocated
> hr = CoCreateInstance(
> CLSID_TAPI,
> NULL,
> CLSCTX_INPROC_SERVER,
> IID_ITTAPI,
> (LPVOID *)&gpTapi
> );
> // If (hr != S_OK) process the error here.
> // Initialize TAPI.
> hr = gpTapi->Initialize();
> if (hr != S_OK) //process the error here.
> printf("I am stuck");
> // Declare the interfaces used to select an address.
> IEnumAddress * pIEnumAddress;
> ITAddress * pAddress;
> ITMediaSupport * pMediaSupport;
> VARIANT_BOOL bSupport;
> BSTR ppName;
> // Use the TAPI object to
> // enumerate available addresses.
> hr = gpTapi->EnumerateAddresses( &pIEnumAddress );
> // If (hr != S_OK) process the error here.
> // Locate an address that can support the
> // media type the application needs.
> while ( S_OK == pIEnumAddress->Next(1, &pAddress, NULL) )
> {
> // Determine the media support.
> pAddress->get_ServiceProviderName(&ppName);
> pAddress->get_AddressName(&ppName);
> hr = pAddress->QueryInterface(
> IID_ITMediaSupport,
> (void **)&pMediaSupport
> );
> // If (hr != S_OK) process the error here.
> pAddress->get_ServiceProviderName(&ppName);
> // In this example, the required media type is already known.
> // The application can also use the address object to
> // enumerate the media supported, then choose from there.
> hr = pMediaSupport->QueryMediaType(
> TAPIMEDIATYPE_AUDIO,
> &bSupport
> );
> // If (hr != S_OK) process the error here.
> //pAddress->get_ServiceProviderName(ppName);
> if (bSupport)
> {
> pAddress->get_ServiceProviderName(&ppName);
> hr = pAddress->get_AddressName(&ppName);
> if(hr != S_OK)
> printf("I am stuck");
> break;
> }
> //pAddress->CreateCall(
> }
> // pAddress is now a usable address.
> // start making call
> BSTR AddressToCall = SysAllocString(L"111.11.1.1");
> // Have a look at the service provider and the address name
> BSTR d;
> pAddress->get_ServiceProviderName(&d);
> BSTR ss = d;
> pAddress->get_AddressName(&d); ss = d;
> ITBasicCallControl * pBasicCall;
> ADDRESS_STATE pAddressState;
> pAddress->get_State(&pAddressState);
> if (pAddressState == AS_OUTOFSERVICE)
> {
> /*The address is temporarily out of service*/
> int i = 9;
> }
> pAddress->
> // Start the call
> hr = pAddress->CreateCall(AddressToCall, LINEADDRESSTYPE_IPADDRESS,
> TAPIMEDIATYPE_AUDIO, &pBasicCall);
> SysFreeString(AddressToCall);
> // Make the connection.
> hr = pBasicCall->Connect(TRUE);
> if (hr != S_OK)
> {
> //AfxMessageBox("Couldn't connect to call");
> }
> hr = pBasicCall->Disconnect(DC_NORMAL);
> if (hr == S_FALSE)
> {
> // Call state is idle
> bool idle = true;
> }
> // end making call
> // end enumerations
> return (int) msg.wParam;
> **********************************************
> "Andreas Marschall [MVP TAPI]" wrote:
> > "Mohan Maganti" <MohanMaga...@discussions.microsoft.com> schrieb im
> > Newsbeitrag news:173E9AFA-EA9A-4976-8AAA-F173DD1E9D5C@microsoft.com...
> > > Hello Guys,
> > > I was out of commission for couple of weeks. Just looked at the messages.
> > > Thanks for the information.
> > Mohan, you are welcome.
> > > I will look into this today.
> > Ok.
> > > Andreas --
> > > Your website is very nice.
> > Thanks for your feedback :-)
> > > I will follow the suggestion of naming post little better.
> > Thanks again.
> > --
> > Best Regards
> > Andreas Marschall
> > Microsoft MVP for TAPI / Windows SDK
> > TAPI / TSP Developer and Tester
> > My TAPI and TSPI FAQ:
> > http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
> > My TotoŽ Tools (a collection of free, mostly TAPI related tools):
> > http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
> > TAPI development around the world (Frappr! map):
> > http://www.frappr.com/TAPIaroundTheWorld
> > * Please post all messages and replies to the newsgroup so all may
> > * benefit from the discussion. Private mail is usually not replied to.
> > * This posting is provided "AS IS" with no warranties, and confers no rights.