The ability of an application to deal with incoming calls or to be the target of call handoffs on a line is determined by the value used for the dwMediaModes parameter of the lineOpen function. With this function, the application indicates its interest in monitoring calls or receiving ownership of incoming calls of one or more specific media modes, or of any (unspecified) media mode, as described in the following cases:
All applications that have opened a line device in any mode are notified about certain general statuses and events occurring on the line device or its addresses. These include the line being taken out of service, the line going back into service, the line being under maintenance, an address coming in use or going idle, and an open or close operation being executed on the line. An application that does not care about a certain message can use the lineSetStatusMessages function to filter the message. Most such status messages are disabled by default; an application would need to call lineSetStatusMessages to enable them.
The media modes specified with lineOpen add to the default value for the provider's media mode monitoring for initial incoming call type determination. This means that the dwMediaMode settings of all applications with the line open are ORed together, and that union becomes the default media detection on the line. The lineMonitorMedia function modifies the mask that controls LINE_MONITORMEDIA messages but does not affect the default media detection enabled on new incoming calls. It is necessary for an application using lineMonitorMedia to call it to establish media monitoring on every new call in which it is interested.