<div class="content" name="Open" uuid="6b5ee45e-b5c8-4148-a9b2-b16b9b995c3f"><p>The Open 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>.
Sending this packet MUST open the specified phone device. </p><p>A phone device can be opened by using either owner privilege
or monitor privilege. An application that opens the phone with owner privileges
can control the lamps, display, ringer, and hookswitch or hookswitches of the
phone. An application that opens the phone device with monitor privilege is
notified only about events that occur at the phone, such as hookswitch changes
or button presses. Opening a phone device in owner mode also provides
monitoring of the phone device.</p><p>Ownership of a phone device is exclusive; that is, at any
time, only one application can have a phone device opened with owner
privileges. However, a phone device can be opened multiple times with monitor
privilege.</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">hPhoneApp</td>
 </tr>
 <tr>
  <td colspan="32">dwDeviceID</td>
 </tr>
 <tr>
  <td colspan="32">hPhone</td>
 </tr>
 <tr>
  <td colspan="32">dwNegotiatedVersion</td>
 </tr>
 <tr>
  <td colspan="32">dwExtVersion</td>
 </tr>
 <tr>
  <td colspan="32">OpenContext</td>
 </tr>
 <tr>
  <td colspan="32">dwPrivilege</td>
 </tr>
 <tr>
  <td colspan="32">hRemotePhone</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>
</tbody></table><p><b>Req_Func (4 bytes): </b>The identifier of the
function that will be invoked on the remote server. This value MUST be set to
107.</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="b1c6fae0-09ca-4f7b-85f6-1324376d231c" data-linktype="relative-path">PHONEERR_Constants</a>
value indicates failure. The remote server MUST complete this call
synchronously.</p>
</dd>
<dd>
<p>Returns zero if the request succeeds or a negative
error number if an error occurs. Common return values are:</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Name</p>
   </th>
   <th>
   <p>Value</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>PHONEERR_ALLOCATED</td>
  <td>0x00000001</td>
 </tr><tr>
  <td>PHONEERR_NODRIVER</td>
  <td>0x00000019</td>
 </tr><tr>
  <td>PHONEERR_BADDEVICEID</td>
  <td>0x00000002</td>
 </tr><tr>
  <td>PHONEERR_NOMEM</td>
  <td>0x0000001A</td>
 </tr><tr>
  <td>PHONEERR_INCOMPATIBLEAPIVERSION</td>
  <td>0x00000003</td>
 </tr><tr>
  <td>PHONEERR_OPERATIONFAILED</td>
  <td>0x0000001C</td>
 </tr><tr>
  <td>PHONEERR_INCOMPATIBLEEXTVERSION</td>
  <td>0x00000004</td>
 </tr><tr>
  <td>PHONEERR_OPERATIONUNAVAIL</td>
  <td>0x0000001D</td>
 </tr><tr>
  <td>PHONEERR_INVALAPPHANDLE</td>
  <td>0x00000007</td>
 </tr><tr>
  <td>PHONEERR_RESOURCEUNAVAIL</td>
  <td>0x0000001F</td>
 </tr><tr>
  <td>PHONEERR_INVALPOINTER</td>
  <td>0x00000015</td>
 </tr><tr>
  <td>PHONEERR_UNINITIALIZED</td>
  <td>0x00000022</td>
 </tr><tr>
  <td>PHONEERR_INVALPRIVILEGE</td>
  <td>0x00000016</td>
 </tr><tr>
  <td>PHONEERR_REINIT</td>
  <td>0x00000023</td>
 </tr><tr>
  <td>PHONEERR_INUSE</td>
  <td>0x00000006</td>
 </tr><tr>
  <td>PHONEERR_NODEVICE</td>
  <td>0x00000018</td>
 </tr><tr>
  <td>PHONEERR_INIFILECORRUPT</td>
  <td>0x00000005</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>hPhoneApp (4 bytes): </b>An <a href="55b72ff6-9236-401b-846a-e8a78dfada1b" data-linktype="relative-path">HPHONEAPP</a>. The handle to
the application registration with TAPI. This field MUST have been obtained by
sending the <a href="a600d262-0bb1-447b-8a0d-6f57d3a8ec18" data-linktype="relative-path">Initialize</a>
packet.</p><p><b>dwDeviceID (4 bytes): </b>An unsigned 32-bit
integer. The identifier of the phone device to be opened. A valid value of
dwDeviceID is in the range 0 to dwNumDevs – 1. The client obtains dwNumDevs by
sending a Initialize packet to the remote server.</p><p><b>hPhone (4 bytes): </b>An <a href="0c93f481-3429-48c5-a9e6-f0568c4cabd9" data-linktype="relative-path">HPHONE</a>. Set to
TAPI_NO_DATA (0xFFFFFFFF). Upon successful completion of the request, this
field contains the handle for the phone device to be used by TAPI in subsequent
calls to identify the device.</p><p><b>dwNegotiatedVersion (4 bytes): </b>An unsigned
32-bit integer. The version that is negotiated via the <a href="59e34869-7701-4eb5-95d4-f8ce908ce17a" data-linktype="relative-path">NegotiateAPIVersion</a>
request.</p><p><b>dwExtVersion (4 bytes): </b>An unsigned 32-bit
integer. The extension version number under which the application and the
service provider agree to operate. This number is zero if the application does
not use any extensions. This number is obtained from <a href="6ee86f03-d1e2-4823-98e1-9e5fc97c11bc" data-linktype="relative-path">NegotiateExtVersion</a>. </p><p><b>OpenContext (4 bytes): </b>An unsigned 32-bit
integer. The Callback instance, set to 0.</p><p><b>dwPrivilege (4 bytes): </b>An unsigned 32-bit
integer. The privilege that is requested. This parameter MUST use one of the <a href="a4b8c72d-0fab-4dbd-8ac8-5064fe8e458e" data-linktype="relative-path">PHONEPRIVILEGE_Constants</a>.</p><p><b>hRemotePhone (4 bytes): </b>An unsigned 32-bit
integer. If this field is nonzero, the server MUST use this value for
ASYNCEVENTMSG.hDevice for all unsolicited event and completion notifications
that are sent to the client, instead of the returned hPhone value.</p><dl>
<dd>
<p>Similar handle-swapping semantics can exist between
TAPI service and telephony service providers</p>
</dd></dl><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></div>