<div class="content" name="GenerateTone" uuid="d67f7840-ddd8-4262-bae4-ec70aa383839"><p>The GenerateTone 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 generates the specified tone inband over the specified
call. Invoking this function with a zero for dwToneMode aborts any tone
generation that is currently in progress on the specified call. Sending a
GenerateTone or <a href="555485de-1851-4e63-ae7a-f6a1de1d206e" data-linktype="relative-path">GenerateDigits</a>
packet while tone generation is in progress aborts the current tone generation
or digit generation in progress and initiates the generation of the newly
specified tone or digits.</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">hCall</td>
 </tr>
 <tr>
  <td colspan="32">dwToneMode</td>
 </tr>
 <tr>
  <td colspan="32">dwDuration</td>
 </tr>
 <tr>
  <td colspan="32">dwNumTones</td>
 </tr>
 <tr>
  <td colspan="32">lpTones</td>
 </tr>
 <tr>
  <td colspan="32">dwSize</td>
 </tr>
 <tr>
  <td colspan="32">dwEndToEndID</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">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 20.</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
contains 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_INVALCALLHANDLE</td>
  <td>0x80000018</td>
 </tr><tr>
  <td>LINEERR_NOMEM</td>
  <td>0x80000044</td>
 </tr><tr>
  <td>LINEERR_INVALCALLSTATE</td>
  <td>0x8000001C</td>
 </tr><tr>
  <td>LINEERR_OPERATIONUNAVAIL</td>
  <td>0x80000049</td>
 </tr><tr>
  <td>LINEERR_INVALTONEMODE</td>
  <td>0x8000003E</td>
 </tr><tr>
  <td>LINEERR_OPERATIONFAILED</td>
  <td>0x80000048</td>
 </tr><tr>
  <td>LINEERR_INVALTONE</td>
  <td>0x8000003C</td>
 </tr><tr>
  <td>LINEERR_RESOURCEUNAVAIL</td>
  <td>0x8000004B</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>hCall (4 bytes): </b>An <a href="7f4089a0-7432-4ef0-8eeb-5aafe407c07e" data-linktype="relative-path">HCALL</a>. The handle to the
call on which a tone is to be generated. One way of obtaining a valid hCall is
by sending the <a href="c9acdfde-22de-43ff-b491-23a9ed72fb31" data-linktype="relative-path">MakeCall</a>
packet. The application MUST be an owner of the call. The call state of hCall
can be any state.</p><p><b>dwToneMode (4 bytes): </b>An unsigned 32-bit
integer. Defines the tone to be generated. Tones can be either standard or
custom. A custom tone is composed of a set of arbitrary frequencies. A small
number of standard tones are predefined. The duration of the tone MUST be
specified by dwDuration for both standard and custom tones. If dwToneMode is
set to zero, any digit or tone generation in progress is canceled. This
parameter MUST use one of the <a href="fabc6a63-f332-45d4-98ae-5090fae2a7dd" data-linktype="relative-path">LINETONEMODE_Constants</a>.</p><p><b>dwDuration (4 bytes): </b>An unsigned 32-bit
integer. The duration, in milliseconds, during which the tone is sustained. A
value of 0 for dwDuration uses a default duration for the specified tone.
Default values are: </p><ul><li><p><span><span>  </span></span>CUSTOM:
infinite</p>
</li><li><p><span><span>  </span></span>RINGBACK:
infinite</p>
</li><li><p><span><span>  </span></span>BUSY:
infinite</p>
</li><li><p><span><span>  </span></span>BEEP:
infinite</p>
</li><li><p><span><span>  </span></span>BILLING:
fixed (single cycle)</p>
</li></ul><dl>
<dd>
<p>This parameter is not validated by
TAPI when this function is called.</p>
</dd></dl><p><b>dwNumTones (4 bytes): </b>An unsigned 32-bit
integer. The number of entries in the lpTones array. This parameter is ignored
if dwToneMode is not equal to LINETONEMODE_CUSTOM.</p><p><b>lpTones (4 bytes): </b>An unsigned 32-bit integer.
If dwToneMode is set to LINETONEMODE_CUSTOM, this field contains the offset, in
bytes, of a <a href="4114d674-a287-40a8-9e6a-6fe39fa20b4e" data-linktype="relative-path">LINEGENERATETONE</a>
packet in the VarData field. Otherwise, this field is set to the value
TAPI_NO_DATA (0xFFFFFFFF).</p><p><b>dwSize (4 bytes): </b>An unsigned 32-bit integer.
If dwToneMode is set to LINETONEMODE_CUSTOM, this field is set to the value of
(dwNumTones * sizeof (LINEGENERATETONE)). Otherwise, this field is set to zero.</p><p><b>dwEndToEndID (4 bytes): </b>An unsigned 32-bit
integer. A unique, uninterpreted identifier of the request for its entire
lifetime, that is, until the matching <a href="47c86cdf-a2ad-43aa-a57c-7c7746548e24" data-linktype="relative-path">LINE_GENERATE</a> packet is
sent. The service provider MUST include this identifier as one of the
parameters in the packet.</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>VarData (variable): </b>Contains a number of
LINEGENERATETONE packets that are equal to the value of the dwNumTones field.</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>