Monday, October 22, 2007

TAPI 2.x, C# and .net framework I GOT ITWORK

I have seen so many posts on the net related to TAPI and .net framework. Among all those I tried the following samples.
1. Davang program from code project, but i found some unhandled exceptions in that.
2. Some samples from Zulmar, Which are very useful.
3. A C# wrapper from GotDotNet group by Helen warn and gang.

Among these three, I found the last one is very useful and an efficient one. So, for this first of all i would like to THANK Helen and Gang for doing such an outstanding job.

With this sample one can develop their own and customized applications including the features like
1. Dialing a number,
2. Detecting the status of the call,
3. The status of the end user like HUB,
4. Forwarding the call if the end user is not responding in right time.
5. Checking the event status, etc.

A phone call need not be terminated if one end user is not interested. That means by detecting the line status, we can be able to know that either party is terminating and eventually the call get terminated.

This is using TAPI 2.x which is developed on a C++ pointer style program.
The latest one of TAPI 3.x is a COM based and not good for managed code programming.
So, please have a look at it and start working on TAPI and managed code.

All these stuff you can make on your own by doing some small modifications in it.

For more stuff and comments visit the following link.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5d893af6-b340-49d8-9162-b90bf6932414

TAPI 2.x, C# and .net framework

I have seen so many posts on the net related to TAPI and .net framework. Among all those I tried the following samples.
1. Davang program from code project, but i found some unhandled exceptions in that.
2. Some samples from Zulmar, Which are very useful.
3. A C# wrapper from GotDotNet group by Helen warn and gang.

Among these three, I found the last one is very useful and an efficient one. So, for this first of all i would like to THANK Helen and Gang for doing such an outstanding job.

With this sample one can develop their own and customized applications including the features like
1. Dialing a number,
2. Detecting the status of the call,
3. The status of the end user like HUB,
4. Forwarding the call if the end user is not responding in right time.
5. Checking the event status, etc.

A phone call need not be terminated if one end user is not interested. That means by detecting the line status, we can be able to know that either party is terminating and eventually the call get terminated.

This is using TAPI 2.x which is developed on a C++ pointer style program.
The latest one of TAPI 3.x is a COM based and not good for managed code programming.
So, please have a look at it and start working on TAPI and managed code.

All these stuff you can make on your own by doing some small modifications in it.

For more stuff and comments visit the following link.
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5d893af6-b340-49d8-9162-b90bf6932414

Wednesday, October 10, 2007

Everything you need for global communications

Unified Communications bridge the gap between telephony and computing to deliver real-time messaging, voice, and conferencing to the desktop environment. Microsoft® Unified Communications technologies use powerful software to streamline communications between people and organizations, regardless of medium, platform, device or location. These technologies integrate with your existing voice/PBX and network infrastructure to deliver a secure, common management platform for all of your communication workloads. One pane global communicaions? Now you're talking.

With Unified Communications, you can:
• Streamline Communications for End-Users
• Increase Operational Efficiency
• Provide Built-in Protection
• Build a Future-Ready Foundation on Software

Empowering your team to work better, together..

For more info on this, follow the link;
"http://www.microsoft.com/india/uc/launch/itpro/default.mspx"

Tuesday, October 9, 2007

Exploring Extended TAPI Functions

Retrieving General Information:
We will start this part of tutorial from regular things. This section describes how to obtain various general information for specified TAPI device. This function groups belong to Extended TAPI. ExTAPI, proving its name, extends wireless API with different options:
• various device specific info
• info about signal strength
• info about system type
• info about line operators
• choosing the cellular network
• registering lines for specific operator
• get/set GPRS class
• get/set equipment state
• and more...
'Get/Set' functions
There are a couple dozen get/set-functions that give you a lot of useful information and allow managing line devices. It doesn't make sense to describe them all here; I'll only put a brief 'get' calls reference. You will find detailed explanations in SDK help:
• lineGetCallBarringCaps
• lineGetCallBarringState
• lineGetCallWaitingCaps
• lineGetCallWaitingState
• lineGetCurrentAddressID
• lineGetCurrentHSCSDStatus
• lineGetCurrentOperator
• lineGetCurrentSystemType
• lineGetEquipmentState
• lineGetGeneralInfo
• lineGetGPRSClass
• lineGetHSCSDCaps
• lineGetHSCSDState
• lineGetMuteState
• lineGetNumberCalls
• lineGetOperatorStatus
• lineGetRadioPresence
• lineGetRegisterStatus
• lineGetSendCallerIDState
• lineGetUSSD
Network operator related functions
ExTAPI exposes several functions that you can use to manage network operator-related stuff:
• lineRegister
• lineUnregister
• lineGetRegisterStatus
• lineGetCurrentOperator
• lineGetOperatorStatus
• lineSetPreferredOperator

Basic Telephony Services Reference

The Basic Telephony functions are listed by category in the following tables. A function is identified as asynchronous if it indicates completion in a REPLY message to the application. If the function always returns its result to the application immediately, the function is considered synchronous.
Following is a functional grouping of the basic telephony service functions:
• Address Formats
• Addresses
• Answering Incoming Calls
• Call Drop Functions
• Call Handle Manipulation
• Call Privilege Control
• Call States and Events
• Line Status and Capabilities
• Line Version Negotiation
• Location and Country/Region Information
• Making Calls
• Opening and Closing Line Devices
• Request Recipient Services
• TAPI Initialization and Shutdown
• Toll Saver Support
TAPI Initialization and Shutdown
Function Description
lineInitializeEx
Initializes the TAPI line abstraction for use by the invoking application. Synchronous.
lineShutdown
Shuts down the application's use of TAPI's line abstraction. Synchronous.

Line Version Negotiation
Function Description
lineNegotiateAPIVersion Allows an application to negotiate a TAPI version to use. Synchronous.

Line Status and Capabilities
Function Description
lineGetDevCaps Returns the capabilities of a given line device. Synchronous.
lineGetDevConfig Returns configuration of a media stream device. Synchronous.
lineGetLineDevStatus Returns current status of the specified open line device. Synchronous.
lineSetDevConfig Sets the configuration of the specified media stream device. Synchronous.
lineSetStatusMessages Specifies the status changes for which the application needs to be notified. Synchronous.
lineGetStatusMessages Returns the application's current line and address status message settings. Synchronous.
lineGetID Retrieves a device ID associated with the specified open line, address, or call. Synchronous.
lineGetIcon Allows an application to retrieve an icon for display to the user. Synchronous.
lineConfigDialog Causes the provider of the specified line device to display a dialog box that allows the user to configure parameters related to the line device. Synchronous.
lineConfigDialogEdit Displays a dialog box allowing the user to change configuration information for a line device. Synchronous.

Addresses
Function Description
lineGetAddressCaps Returns the telephony capabilities of an address. Synchronous.
lineGetAddressStatus Returns current status of a specified address. Synchronous.
lineGetAddressID Retrieves the address ID of an address specified using an alternate format. Synchronous.

Opening and Closing Line Devices
Function Description
lineOpen Opens a specified line device for providing subsequent monitoring and/or control of the line. Synchronous.
lineClose Closes a specified opened line device. Synchronous.

Address Formats
Function Description
lineTranslateAddress Translates between an address in canonical format and an address in dialable format. Synchronous.
lineSetCurrentLocation Sets the location used as the context for address translation. Synchronous.
lineSetTollList Manipulates the toll list. Synchronous.
lineGetTranslateCaps Returns address translation capabilities. Synchronous.

Call States and Events
Function Description
lineGetCallInfo Returns fixed information about a call. Synchronous.
lineGetCallStatus Returns complete call status information for the specified call. Synchronous.
lineSetAppSpecific Sets the application-specific field of a call's information structure. Synchronous.

Making Calls
Function Description
lineMakeCall Makes an outbound call and returns a call handle for it. Asynchronous.
lineDial Dials (parts of one or more) dialable addresses. Asynchronous.

Answering Incoming Calls
Function Description
lineAnswer Answers an incoming call. Asynchronous.

Toll Saver Support
Function Description
lineSetNumRings Indicates the number of rings after which incoming calls are to be answered. Synchronous.
lineGetNumRings Returns the minimum number of rings requested with lineSetNumRings. Synchronous.
Call Privilege Control
Function Description
lineSetCallPrivilege Sets the application's privilege to the privilege specified. Synchronous.

Call Drop Functions
Function Description
lineDrop Disconnects a call, or abandons a call attempt in progress. Asynchronous.
lineDeallocateCall Deallocates the specified call handle. Synchronous.

Call Handle Manipulation
Function Description
lineHandoff Hands off call ownership and/or changes an application's privileges to a call. Synchronous.
lineGetNewCalls Returns call handles to calls on a specified line or address for which the application does not yet have handles. Synchronous.
lineGetConfRelatedCalls Returns a list of call handles that are part of the same conference call as the call specified as a parameter. Synchronous.

Location and Country/Region Information
Function Description
lineTranslateDialog Displays a dialog box allowing the user to change location and calling card information. Synchronous.
lineGetCountry Retrieves dialing rules and other information about a given country/region. Synchronous.

Request Recipient Services
The following two functions are used only in support of Assisted Telephony.
Function Description
lineRegisterRequestRecipient Registers or deregisters the application as a request recipient for the specified request mode. Synchronous.
lineGetRequest Gets the next request from the Telephony dynamic link library. Synchronous.

TAPI 2.x


The TAPI DLLs, along with the TAPI Server (Tapisvr.exe), are crucial abstractions separating end-user or server applications from service providers. A TAPI DLL in conjunction with the TAPI Server provides a consistent interface between these two layers.

A TAPI application loads the appropriate DLL into its process space. During initialization, TAPI establishes an RPC link with Tapisvr.exe. In Windows Server 2003 family, Windows XP, and Windows 2000, the TAPI Server runs in the context of SVCHOST. In Windows NT, the TAPI Server runs as a separate service.

There are three DLLs associated with TAPI: Tapi.dll, Tapi32.dll, and Tapi3.dll. These DLLs are located in %SystemRoot%\system32. The following figure illustrates the roles of their respective roles in Microsoft Telephony:

Roles of the three TAPI DLLs

Existing 16-bit applications link to Tapi.dll. In Windows Server 2003 family, Windows XP, Windows 2000, Windows NT, Windows Millennium Edition, and Windows 98, Tapi.dll is simply a thunk layer that maps 16-bit addresses to 32-bit addresses and pass requests to Tapi32.dll. In Windows 95 and Windows 3.1, this DLL is the core of Windows Telephony.

Existing 32-bit TAPI 2.x applications link to Tapi32.dll. In Windows Server 2003 family, Windows XP, Windows 2000, Windows NT, Windows Millennium Edition, and Windows 98, Tapi32.dll is a thin marshaling layer that transfers function requests to the TAPI Server (TAPISRV) and, when needed, loads and invokes media service provider DLLs in the application's process. In Windows 95, Tapi32.dll is a thunk layer to Tapi.dll.

TAPI 3.x applications link to Tapi3.dll.
TAPI Functions

The following sections contain an alphabetic list of functions grouped by area. The information for each function includes a list of the valid call states on entry of the function and typical call state transitions when the request is complete.

* Assisted Telephony Functions
* Call Center Functions
* Line Device Functions
* Phone Device Functions

For TAPI functions categorized by service level and task, see TAPI Quick Function Reference.

Please note that service provider limitations may exist concerning the actual states in which a function can be performed. Applications must check the dwCallFeatures member in the LINECALLSTATUS structure, the dwAddressFeatures member in the LINEADDRESSSTATUS structure, and the dwLineFeatures member in the LINEDEVSTATUS structure to determine whether or not a function is permitted within the current call state.
Here I am particular on Phone Device Functions:

TAPI supports the following phone device functions:

* phoneCallbackFunc
* phoneClose
* phoneConfigDialog
* phoneDevSpecific
* phoneGetButtonInfo
* phoneGetData
* phoneGetDevCaps
* phoneGetDisplay
* phoneGetGain
* phoneGetHookSwitch
* phoneGetIcon
* phoneGetID
* phoneGetLamp
* phoneGetMessage
* phoneGetRing
* phoneGetStatus
* phoneGetStatusMessages
* phoneGetVolume
* phoneInitialize
* phoneInitializeEx
* phoneNegotiateAPIVersion
* phoneNegotiateExtVersion
* phoneOpen
* phoneSetButtonInfo
* phoneSetData
* phoneSetDisplay
* phoneSetGain
* phoneSetHookSwitch
* phoneSetLamp
* phoneSetRing
* phoneSetStatusMessages
* phoneSetVolume
* phoneShutdown

Monday, October 8, 2007

Working with TAPI 3.0 in our application (With Basic Call Control Functions)

The first thing you need to do is create the TAPI objects to initialize the TAPI 3.0 TSP (TAPI Service Providers). To have more information on TSP and what TAPI is all about, please refer to help provided in the MSDN .NET documentation. The code below is a declaration of the TAPI object and addresses the interfaces that will hold the addresses which are responsible for call handling, and basic call control interface which will hold the reference to the object that will be responsible for handling basic operations of the call.

private TAPIClass tobj;
private ITAddress[] ia=new TAPI3Lib.ITAddress[10];
private ITBasicCallControl bcc;

The code below is responsible for initializing a TAPI object so that it can be used by application. The main functions are:

* Initialize() will initialize TAPI.
* EnumerateAddresses() will give the list of available TSPs.

void initializetapi3()
{
try
{
tobj = new TAPIClass();
tobj.Initialize();
IEnumAddress ea=tobj.EnumerateAddresses();
ITAddress ln;
uint arg3=0;
lines=0;

cn=new callnotification();
cn.addtolist=new callnotification.listshow(this.status);
tobj.ITTAPIEventNotification_Event_Event+= new
TAPI3Lib.ITTAPIEventNotification_EventEventHandler(cn.Event);
tobj.EventFilter=(int)(TAPI_EVENT.TE_CALLNOTIFICATION|
TAPI_EVENT.TE_DIGITEVENT|
TAPI_EVENT.TE_PHONEEVENT|
TAPI_EVENT.TE_CALLSTATE|
TAPI_EVENT.TE_GENERATEEVENT|
TAPI_EVENT.TE_GATHERDIGITS|
TAPI_EVENT.TE_REQUEST);

for(int i=0;i<10;i++)
{
ea.Next(1,out ln,ref arg3);
ia[i]=ln;
if(ln!=null)
{
comboBox1.Items.Add(ia[i].AddressName);
lines++;
}
else
break;
}
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
}

The code below is responsible for registering incoming calls so that they can be handled by our application. For that you need to select the line on which you want to receive calls and press the Register button.

try
{
registertoken[line]=tobj.RegisterCallNotifications(ia[line],
true,true,TapiConstants.TAPIMEDIATYPE_AUDIO,2);
MessageBox.Show("Registration token : "+
registertoken[line],
"Registration Succeed for line "+line);
}
catch(Exception ein)
{
MessageBox.Show("Failed to register on line "+line,"Registration for calls");
}

The class given below is to be added depending upon your TAPI event handling requirements. This is specially designed according to the requirements of the application.

class callnotification:TAPI3Lib.ITTAPIEventNotification
{
public delegate void listshow(string str);
public listshow addtolist;

public void Event(TAPI3Lib.TAPI_EVENT te,object eobj)
{
switch(te)
{
case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION:
MessageBox.Show("call notification event has occured");
break;
case TAPI3Lib.TAPI_EVENT.TE_DIGITEVENT:
TAPI3Lib.ITDigitDetectionEvent dd =
(TAPI3Lib.ITDigitDetectionEvent)eobj;
MessageBox.Show("Dialed digit"+dd.ToString());
break;
case TAPI3Lib.TAPI_EVENT.TE_GENERATEEVENT:
TAPI3Lib.ITDigitGenerationEvent dg =
(TAPI3Lib.ITDigitGenerationEvent)eobj;
MessageBox.Show("digit dialed!");
MessageBox.Show("Dialed digit"+dg.ToString());
break;
case TAPI3Lib.TAPI_EVENT.TE_PHONEEVENT:
MessageBox.Show("A phone event!");
break;
case TAPI3Lib.TAPI_EVENT.TE_GATHERDIGITS:
MessageBox.Show("Gather digit event!");
break;
case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
TAPI3Lib.ITCallStateEvent a=
(TAPI3Lib.ITCallStateEvent)eobj;
TAPI3Lib.ITCallInfo b=a.Call;
switch(b.CallState)
{
case TAPI3Lib.CALL_STATE.CS_INPROGRESS:
MessageBox.Show("dialing");
break;
case TAPI3Lib.CALL_STATE.CS_CONNECTED:
MessageBox.Show("Connected");
break;
case TAPI3Lib.CALL_STATE.CS_DISCONNECTED:
MessageBox.Show("Disconnected");
break;
case TAPI3Lib.CALL_STATE.CS_OFFERING:
MessageBox.Show("A party wants to communicate with you!");
break;
case TAPI3Lib.CALL_STATE.CS_IDLE:
MessageBox.Show("Call is created!");
break;
}
break;
}
}
}

How to handle H.323 or IP calls????

To do IP calls or H.323 calls, you need to make H.323 call(IP call) enabled and enter the IP address of the destination and Call. Otherwise it will not succeed in calling to the remote destination. To receive H.323 calls or IP calls, you need to first register on the line on which you want to receive IP calls and h.323 call(IP call).
How to answer an incoming call

BasicCallCOntrol.Answer(), is enough to answer a call.

How to transfer a call:

To transfer a call, first there should be one active call existing. Then you can specify the address to which the call is to be transferred to
Here I have specified the internet address since the call was an IP call. To provide this functionality, there is one function in IBasicCallControl named BlindTransfer(String transfferaddress). Refer the MSDN documents for more information on that!

Friday, October 5, 2007

TAPI 2.x vs TAPI 3.x

It is a common misconception that TAPI 3.0 (or TAPI 3.1) replaces TAPI 2.x. TAPI 2.x (and all earlier versions) is written in C/C++ and requires applications to make heavy use of C style pointer arithmetic. This makes TAPI fast and easy to access from C/C++ applications, but it also makes it difficult to use from many other programming languages.

On the other hand, TAPI 3.x was designed with a COM (Component Object Model) interface. This was done with the intent of making it accessible from managed languages like Visual Basic, VBScript, Java or other environments that provide easy access to COM but don't deal with C-style pointers.

TAPI 3.x has a slightly different set of functionality than TAPI 2.x. The addition of integrated media control was the most significant addition. But TAPI 3.x doesn't include all functionality that TAPI 2.x does, like support for the Phone class.

One very notable issue with TAPI 3.x is the lack of support for managed code (.NET environment). As documented in Microsoft KB Article 841712, Microsoft currently has no plans to support TAPI 3.x directly from .Net programming languages. However, Mark Smith has provided a Managed C++ library called TSP++ 3.0.

One often overlooked reason an application developer might choose between TAPI 2.x and TAPI 3.x should be the hardware vendors recommendation. Even though TAPI provides an abstract model of phone lines, telephony applications are still heavily impacted by the specific behavior of the underlying hardware. Troubleshooting behavior issues usually requires both software and hardware vendors to collaborate. Because there is almost a 1:1 relationship between the TAPI Service Provider (TSP) interface and the TAPI 2.x interface, collaboration is often easier if the application is designed using TAPI 2.x. Experience with TAPI 3.x varies significantly between hardware vendors.

Telephony Application Programming Interface (TAPI) functionality is not supported from managed code:
This article discusses why Telephony Application Programming Interface (TAPI) is not supported from managed code. An alternative method permits you to call TAPI functionality from managed code.
***** Because of the complexity of the TAPI 3.x Component Object Model (COM) interface, the managed wrapper that is created by Microsoft Visual Studio .NET does not work. Therefore, you cannot call TAPI functionality from managed code.

Microsoft has no current plans to release a TAPI interoperative component.*****

Using TAPI from managed code
You can use different versions of TAPI in different programming environments.
TAPI 2.x
TAPI 2.x is an interface that is based on the C programming language.

You can call TAPI functionality from the Managed Extensions for C++ applications in Microsoft Visual Studio .NET by using TAPI 2.x (Tapi32.dll).

All the TAPI 2.x data structures are based on the DWORD data type. TAPI 2.x also requires heavy use of pointers. Therefore, TAPI 2.x functionality is difficult to use from any language other than the Managed Extensions for C++.
TAPI 3.x
TAPI 3.x is an interface that is based on Component Object Model (COM).

You can call TAPI 3.x (Tapi3.dll) functionality from unmanaged code. Create an unmanaged DLL that calls TAPI 3.x functionality, and then call the unmanaged DLL from managed code.

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:
TAPI DLL
http://msdn2.microsoft.com/en-us/library/ms734236.aspx (http://msdn2.microsoft.com/en-us/library/ms734236.aspx)

TAPI 2.2 Overview
http://msdn2.microsoft.com/en-us/library/ms737218.aspx (http://msdn2.microsoft.com/en-us/library/ms737218.aspx)

TAPI 3.1 Overview
http://msdn2.microsoft.com/en-us/library/ms734214.aspx

My Self

tapi COMPATABLE MODEMS Samples

Once i found the TAPI 3.0 sample, its quite hard to find the HardWare to run that sample. I struggled almost a day to find the suitable modem to find out.
Anyway I found some useful modems, which are listed below along with their limitations, pro's and con's by tested people.

What type of modems are recommanded?

Conexant/Rockwell chips
rockwell 6764-61 chipset(External)
It has good capablities on Dial, Answer, Drop, Transfer, Ring/CallerID/Disconnect tone/Digit/fax tone/detection, Voice Play/Record, Fax send/Receive, Speakerphone/Mic (Volume adjustable).
The capabilities of modem is not only determined by the chipset, but also by the manufactor.
We offer this type of modems. For details, please click here
Conexant 6793-11, 6793-17, 11242-11, 11252-11.(Internal)
We've used these modems, and they all works well with almost all the functions voiceangel supports.

Smart Link chip(Internal)
We've used Smart Link 2800, Smart Link 1800 which work well on caller id, voice, fax, digit/disconnection tone/fax sending tone detection.

Intel 5628 chip(Internal)
We've used Intel 5628 internal modem, it works well, and it support CallerID, Wave Play/ Record, Digits detection, but it can not detect the disconnection of the call.

Zoom voice modems:
It can get caller ID. Two model 3049C and PCI3025C are especially good. You should use the updated driver available from zoom technical support (some modems were shipped with defective inf files). But it has a long delay on the DTMF detection.

You can get the modems from www.zoom.com
MT5656ZDX External Modem

It has the following features:
a.Detects remote hang-up
b.Reports Caller-ID
c. Built in speaker
d.Headset / Microphone jacks
You can get the modems from http://www.multitech.com/PRODUCTS/MultiModemZDX/
(It seems that they only support customers from United State)
Lunar voice modems
They generally work well on voice play and record and digits detection, but can not get caller ID.
Jaton voice modems:
The WinComm (Intel 536EP chip) VoiceAngel1.92 PCI and Jaton Communicator V90 internal 56K works are recommanded.
Swann voice modems work well.
Creative and Broadxent voice modems. These are very popular voice modems and we have many and mixed reports. It does seem the more recent modems do work well since Creative overcame problems with Windows XP. Model PCID15633 has a DTMF tone detection delay problem. Default flash-hook duration time can not be changed.
Pragmatic/Lectron .
Model I56LVP-F40 (Agere 16478C chip) 56k VoiceAngel1.92 PCI works well.
Hayes Accura . We have had a number of 'working' reports of these modems.
NetComm Roadster . You will need to download and install the Rockwell Drivers to use the Netcomm Roadster.
NetComm InModem . This will only work with the version 8.18 drivers. Later drivers are incompatible.
Maestro . Please check the Maestro website for driver updates if you have problems. The Maestor Jetstream 3 has unresolved problems with DTMF detection.
Other modems that work include the 1456VQE-C e-Modem V90 56k, GTW VoiceAngel1.92 Voicemodem, Supramax56, Aopen FM 56-PM PCI VoiceAngel1.90,MDA-56P (W2000), Netcomm USB RAVE modem (AM5060) (W2000), Best Data - Smart One VoiceAngel1.92 Lite HCF PCI Modem 56FW-PC (W2000), Comp USA generic VoiceAngel1.90 PCI,SKU#274406 (W98), 'Topic', Dynalink, WISECOM, Generic HSP56 PCI, Multitech multimodem model MT5634ZPX-PCI-V92, Viking, RockwellRC56D2(EXT), GeniusGM56PCI-L, Modem Blaster 56II and PCI56K and the ASK56K.

The post may be bit large to find, but no way to escape.
If you found anything , please drop me a mail at : damodara.naidu@chimeratechnologies.com

Wednesday, October 3, 2007

Capturing a photograph from camera connected to machine through .net 1.1 application

In the recent project i had a scenario where I have to capture the photo of the user using our KIOSK and also I have to know the WIA API(Windows Image Acquisition API) devices connected to the system. For these I downloaded the WIA SDK toolkit from MicroSoft and install it on the machine.
This SDK contains an assembly called WIA.dll which can capable of detecting the devices and performing the operations like taking photo etc.
Download it and refer the same WIA.dll to the application. The classes, delegates, interfaces and properties in the dll can serve us.

For a better example and explanation.. refer the following links.

http://www.vbforums.com/showthread.php?t=378126

http://msdn2.microsoft.com/en-us/library/ms792464.aspx

Integrating intelliginet devices (like Proximity sensors) with C #.net 1.1 Applications

Sometimes we need to integrate intelligent devices to our .net applications. To do this we have to buy some other 3rd party tools or we have to make our own tools. As I am having a little experience in .net (C#) programming(around 2.5 years) I knew that its not possible to me to do so.(May be some guys even less experience can write, here I am talking about me.) Once in my application I have to integrate the Proximity Sensor to detect the presence of an object infront of a KOISK. So, I decided to go to the COM ports stuff and from there I got the events.
The events like DSR(DataSetReady), CarrierDetect(CD) will be useful.
The proximity sensor is a digi inc,. product which can return two events like On(True) and Off(False). If any object is infront of the sensor the orange LED glows that means the DSR is On(True), So load the application and if nothing is there infront of the sensor, no LED glows. It means that DSR is Off(False). So, load the screen saver.

If you found any problem related this COM port stuff, don't hesitate to mail me.

Serial Port Communications with .net 1.1

Many of us (.net programmers) wonder why microsoft didnot included the serial port stuff in Visual Studio 1.1. (I found this when I have to integrate a proximity sensor to my KIOSK application to detect the motion of an object infront of the KIOSK ). Well, as I searched the web (for almost 3-4 days) I found really some useful tools, but they are of trail versions (after a period of time they will disable). So i decided to wrote my OWN serial port API to detect any kind of devices connected to the machine.
The only thing I have done was (Modifying some already existing API's) creating an API to read the events of COM ports like
1. Break,
2.Carrier Detect(CD),
3. ClearToSend(CS),
4. DataSetReady(DSR), the most powerful one to identify the events.
5. Ring,
6. RxFlag(Received Flag),
7. RxChar(Received Character),
8. StatusError,
9. TxBufferEmpty.

I found these are the enough events to achieve serial communications in .net 1.1.
If you are at any way to integrate any type of device(like sensors and intelligent devices etc.) with your application, you can achieve with this. Any way .net 2.0 and later versions are supporting the Serial Port Communication.
For any help on this post , contact me at damodara.naidu@chimeratechnologies.com or +91 988 678 2793.
MSN IM : chm_damodar@hotmail.com

TAPI 3.0

TAPI, or the telephony application-programming interface is the mechanism by which computers can respond to phone calls. It is the technology behind call-centres, and all CTI (Computer Telephony Integration) applications. This application can be used to detect, pick up, and play a pre-recorded message to callers.

You will need a voice modem to use this application. Data modems can still be used with this, but you will not be able to send and receive audio after the call is accepted.
And for more information see this link.

http://msdn2.microsoft.com/en-us/library/ms811413.aspx
And here is the useful example program which was written by Mr.Devang.
This is developed in C# and .net framework 1.1
http://www.codeproject.com/cs/internet/devangpro.asp?df=100&forumid=199032&exp=0&select=2046327

Have nice programming times.