lineMonitorMedia
The lineMonitorMedia
function enables and disables the detection of media modes on the specified
call. When a media mode is detected, a message is sent to the application.
LONG lineMonitorMedia(
HCALL hCall, |
|
DWORD dwMediaModes |
|
); |
|
Parameters
hCall
A handle to
the call. The call state of hCall can be any state except idle.
dwMediaModes
The media
modes to be monitored. A value of zero for the dwMediaModes parameter
cancels all media mode detection. This parameter can have multiple flags set.
This parameter uses the following LINEMEDIAMODE_ constants:
LINEMEDIAMODE_INTERACTIVEVOICE
The
application wants to handle calls of the interactive voice media type (it
manages live voice calls).
LINEMEDIAMODE_AUTOMATEDVOICE
Voice energy
is present on the call and the voice is locally handled by an automated application.
LINEMEDIAMODE_DATAMODEM
The
application wants to handle calls with the data modem media mode.
LINEMEDIAMODE_G3FAX
The
application wants to handle calls of the group 3 fax media type.
LINEMEDIAMODE_TDD
The
application wants to handle calls with the TDD (Telephony Devices for the Deaf)
media mode.
LINEMEDIAMODE_G4FAX
The
application wants to handle calls of the group 4 fax media type.
LINEMEDIAMODE_DIGITALDATA
The
application wants to handle calls of the digital data media type
LINEMEDIAMODE_TELETEX
The
application wants to handle calls with the teletex media mode.
LINEMEDIAMODE_VIDEOTEX
The
application wants to handle calls with the videotex media mode.
LINEMEDIAMODE_TELEX
The
application wants to handle calls with the telex media mode.
LINEMEDIAMODE_MIXED
The application
wants to handle calls with the ISDN mixed media mode.
LINEMEDIAMODE_ADSI
The
application wants to handle calls with the ADSI (Analog Display Services
Interface) media mode.
LINEMEDIAMODE_VOICEVIEW
The media
mode of the call is VoiceView.
Return Values
Returns zero
if the request is successful or a negative error number if an error has
occurred. Possible return values are:
LINEERR_INVALCALLHANDLE,
LINEERR_OPERATIONUNAVAIL, LINEERR_INVALCALLSTATE, LINEERR_OPERATIONFAILED,
LINEERR_INVALMEDIAMODE, LINEERR_RESOURCEUNAVAIL, LINEERR_NOMEM,
LINEERR_UNINITIALIZED.
Remarks
The media
modes specified with lineOpen
This function
is considered successful if media-mode monitoring has been correctly initiated,
not when media mode monitoring has terminated. Media monitoring for a given
media mode remains in effect until it is explicitly disabled by calling lineMonitorMedia
with a dwMediaModes parameter set to zero, until the call transitions to
idle, or when the application deallocates its call handle for the call.
The lineMonitorMedia function is primarily an event reporting mechanism.
The media mode of call, as indicated in LINECALLINFO
Default media
monitoring performed by the service provider corresponds to the union of all
media modes specified on lineOpen
Although this
function can be invoked in any call state, a call's media mode can typically
only be detected while the call is in certain call states. These states may be
device specific. For example, in ISDN, a message may indicate the media mode of
the media stream before the media stream exists. Similarly, distinctive ringing
or the called ID information about the call can be used to identify the media
mode of a call. Otherwise, the call may have to be answered (call in the connected
state) to allow a service provider to determine the call's media mode by
filtering the media stream. Because filtering a call's media stream implies a
computational overhead, applications should disable media monitoring when not
required. By default, media monitoring is enabled for newly inbound calls, because
a call's media mode selects the application that should handle the call.
An outbound
application that deals with voice media modes may want to monitor the call for
silence (a tone) to distinguish who or what is at the called end of a call. For
example, a person at home may answer calls with just a short "hello."
A person in the office may provide a longer greeting, indicating name and
company name. An answering machine may typically have an even longer greeting.
Because
media-mode detection enabled by lineMonitorMedia is implemented as a
read-only operation of the call's media stream, it is not disruptive.
Monitoring of
media on a conference call applies only to the hConfCall, not to the
individual participating calls
See Also