An Unknown Application Is Running

If at least one unknown application has opened the line, the TAPI dynamic-link library gives an ownership handle for the incoming call to the highest priority unknown application. It also passes monitoring handles to the other applications that have the line open for monitoring. The unknown application receives a LINE_CALLSTATE message with dwParam3 set to owner.

This unknown application can then try to perform media determination itself, or use the assistance of the other media applications, allowing them to perform probes for their media mode(s), if appropriate. The unknown application can pass the call to another media application using lineHandoff. The unknown application would examine dwMediaMode in LINECALLINFO to determine the possible remaining candidate media. In doing so, it uses the highest priority media to determine the initial handoff target. It calls lineHandoff, specifying the single highest priority destination media mode as the target.

The following is the default priority of media modes, listed in order from first tried to last tried when used during media-type handoffs.

Order Media Mode
1 LINEMEDIAMODE_INTERACTIVEVOICE
2 LINEMEDIAMODE_DATAMODEM
3 LINEMEDIAMODE_G3FAX
4 LINEMEDIAMODE_TDD
5 LINEMEDIAMODE_G4FAX
6 LINEMEDIAMODE_DIGITALDATA
7 LINEMEDIAMODE_TELETEX
8 LINEMEDIAMODE_VIDEOTEX
9 LINEMEDIAMODE_TELEX
10 LINEMEDIAMODE_MIXED
11 LINEMEDIAMODE_ADSI

Automated voice is a media mode that has no meaningful distinction with interactivevoice at this level, and is therefore not listed.

If the handoff fails, the unknown application should clear that media mode flag in the dwMediaMode member of LINECALLINFO. This action moves the probe for the call one step closer to a final determination of the media mode. If the handoff indicates TARGETSELF, it means that the unknown application is the highest priority application for the media mode for which it was trying to hand off the call, so it should go ahead and do the probing itself.

If the handoff indicates SUCCESS, it means that a different application is the highest priority application for the media mode for which the call was being handed off. The unknown application should deallocate the call handle or change to being a monitor while the new owner has control and proceeds with probing.

The receiving application controls the call. If the probe is successful, it should set the correct media mode bit. If the probe fails, the application should clear the failed media mode bit in LINECALLINFO and hand the call off to the next highest priority application. If no more media mode bits are set, the handoff fails, because no suitable owner application exists for the call.

Eventually, the media mode may be identified through monitoring or successful probing, though the UNKNOWN bit still may be set in dwMediaMode in the data structure LINECALLINFO. In this case, the application that has received the call cannot be sure that it is the highest priority application for the identified media mode. It is now the duty of that application to ensure that the call goes to the highest priority application. To do so, the application follows these steps:

As long as the UNKNOWN bit is still on, the receiving application still does not know that the highest-priority media mode is present on the call, so it still needs to probe for it. It only considers the media mode to be present if the UNKNOWN bit is off—only then can it use the call as a call of that media mode.