<div class="content" name="ConditionalMediaDetection" uuid="5ece4590-a2ce-4253-a103-0a159af90f1a"><p>The ConditionalMediaDetection packet is transmitted from a
TAPI <a href="489de77f-16d8-4c4f-939a-f795e8b42893#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> to a TAPI <a href="489de77f-16d8-4c4f-939a-f795e8b42893#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> in a <a href="489de77f-16d8-4c4f-939a-f795e8b42893#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">remote procedure call</a>. The
function is invoked by TAPI whenever a client application uses LINEMAPPER as
the dwDeviceID in an <a href="2759c744-e040-4c5d-b4b5-215d391f0490" data-linktype="relative-path">Open</a>
packet call to request that lines be scanned to find one that supports the
desired media types and call parameters. </p><p>TAPI scans based on the union of the desired media type and
the other media types currently being monitored on the line to give the service
provider the opportunity to indicate if it cannot simultaneously monitor for
all the requested media types. If the service provider can monitor for the
indicated set of media types and support the capabilities that are indicated in
lpCallParams, it replies with a success indication. It leaves the active media
monitoring modes for the line unchanged.</p><table>
 <tbody><tr>
  <th><p><br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>1<br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>2<br/>0</p></th>
  <th><p><br/>1</p></th>
  <th><p><br/>2</p></th>
  <th><p><br/>3</p></th>
  <th><p><br/>4</p></th>
  <th><p><br/>5</p></th>
  <th><p><br/>6</p></th>
  <th><p><br/>7</p></th>
  <th><p><br/>8</p></th>
  <th><p><br/>9</p></th>
  <th><p>3<br/>0</p></th>
  <th><p><br/>1</p></th>
 </tr>
 <tr>
  <td colspan="32">Req_Func</td>
 </tr>
 <tr>
  <td colspan="32">Reserved1</td>
 </tr>
 <tr>
  <td colspan="32">hLine</td>
 </tr>
 <tr>
  <td colspan="32">dwMediaModes</td>
 </tr>
 <tr>
  <td colspan="32">lpCallParams</td>
 </tr>
 <tr>
  <td colspan="32">dwAsciiCallParamsCodePage</td>
 </tr>
 <tr>
  <td colspan="32">Reserved2</td>
 </tr>
 <tr>
  <td colspan="32">Reserved3</td>
 </tr>
 <tr>
  <td colspan="32">Reserved4</td>
 </tr>
 <tr>
  <td colspan="32">Reserved5</td>
 </tr>
 <tr>
  <td colspan="32">Reserved6</td>
 </tr>
 <tr>
  <td colspan="32">Reserved7</td>
 </tr>
 <tr>
  <td colspan="32">Reserved8</td>
 </tr>
 <tr>
  <td colspan="32">Reserved9</td>
 </tr>
 <tr>
  <td colspan="32">Reserved10</td>
 </tr>
 <tr>
  <td colspan="32">VarData (variable)</td>
 </tr>
 <tr>
  <td colspan="32">...</td>
 </tr>
</tbody></table><p><b>Req_Func (4 bytes): </b>An unsigned 32-bit
integer. The identifier of the function that will be invoked on the remote
server. This value MUST be set to 127.</p><dl>
<dd>
<p><b>Return Values</b></p>
</dd>
<dd>
<p>On completion of <a href="c28c36d0-579b-4e20-a100-f4e71012d5f8" data-linktype="relative-path">ClientRequest</a>, this field
MUST contain the result of the encapsulated telephony request. A value of 0
indicates success, and a <a href="e0e8af90-24f1-4dbc-8d4e-01b8e4e7cb53" data-linktype="relative-path">LINEERR_Constants</a>
value indicates failure. The remote server MUST complete this call
synchronously.</p>
</dd>
<dd>
<p>MUST return zero if the function succeeds or an
error number if an error occurs. Common return values are as follows:</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Name</p>
   </th>
   <th>
   <p>Value</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>LINEERR_INVALLINEHANDLE</td>
  <td>0x8000002B</td>
 </tr><tr>
  <td>LINEERR_OPERATIONFAILED</td>
  <td>0x80000048</td>
 </tr><tr>
  <td>LINEERR_NODRIVER</td>
  <td>0x80000043</td>
 </tr><tr>
  <td>LINEERR_RESOURCEUNAVAIL</td>
  <td>0x8000004B</td>
 </tr><tr>
  <td>LINEERR_NOMEM</td>
  <td>0x80000044</td>
 </tr><tr>
  <td>LINEERR_INVALMEDIAMODE</td>
  <td>0x8000002F</td>
 </tr><tr>
  <td>LINEERR_OPERATIONUNAVAIL</td>
  <td>0x80000049</td>
 </tr></tbody></table>
</dd></dl><p><b>Reserved1 (4 bytes): </b>An unsigned 32-bit
integer. MUST be set to zero when sent and MUST be ignored on receipt. </p><p><b>hLine (4 bytes): </b>An <a href="9a80ee5c-cf55-4a86-bd67-173059d6ff3c" data-linktype="relative-path">HLINE</a>. The handle to the
line on which media monitoring and parameter capabilities are to be set. This
field MUST have been obtained by sending the Open packet.</p><p><b>dwMediaModes (4 bytes): </b>An unsigned 32-bit
integer. The media types currently of interest to the calling application. This
parameter MUST use one or more of the <a href="e3b2104f-131d-4ead-9ded-45654ebfeac0" data-linktype="relative-path">LINEMEDIAMODE_Constants</a>.</p><p><b>lpCallParams (4 bytes): </b>An unsigned 32-bit
integer. The offset in the VarData field of a <a href="c72ece07-095d-441a-93cd-660f09b7826f" data-linktype="relative-path">LINECALLPARAMS</a> packet. </p><ul><li><p><span><span>  </span></span>dwBearerMode</p>
</li><li><p><span><span>  </span></span>dwMinRate</p>
</li><li><p><span><span>  </span></span>dwMaxRate</p>
</li><li><p><span><span>  </span></span>dwMediaMode</p>
</li><li><p><span><span>  </span></span>dwCallParamFlags</p>
</li><li><p><span><span>  </span></span>dwAddressMode</p>
</li></ul><dl>
<dd>
<p>If dwAddressMode is
LINEADDRESSMODE_ADDRESSID, any address on the line is acceptable. If
dwAddressMode is LINEADDRESSMODE_DIALABLEADDR, indicating that a specific
originating address (phone number) is searched for, or if it is a
provider-specific extension, then dwOrigAddressSize/Offset and the portion of
the variable part they refer to are also relevant. If dwAddressMode is a
provider-specific extension, additional information can be contained in the
dwDeviceSpecific variably sized field. All other fields are irrelevant to the
function.</p>
</dd></dl><p><b>dwAsciiCallParamsCodePage (4 bytes): </b>An
unsigned 32-bit integer. This MUST be set to TAPI_NO_DATA (0xFFFFFFFF).</p><p><b>Reserved2 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved3 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved4 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved5 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved6 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved7 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved8 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved9 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>Reserved10 (4 bytes): </b>An unsigned 32-bit
integer. This field is used for padding and MUST be ignored on receipt. It can
be any value.</p><p><b>VarData (variable): </b>Contains a LINECALLPARAMS
packet.</p><dl>
<dd>
<p>The contents of this field MUST be DWORD-aligned, as
specified in <a href="../ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2" data-linktype="relative-path">[MS-DTYP]</a>
section <a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">2.2.9</a>.</p>
</dd></dl></div>