---title: CallCollect---Represents a current or past collect session in a call. You can obtain instances of this class by starting at Collect with the following method:- [Call.collect](./voice-call.mdx#collect)#### ExampleCollecting a PIN with keypad input from the user, then waiting for a result before proceeding with the next instructions.jsimport { Voice } from @signalwire/realtime-api;const client = new Voice.Client({ project: , token: , contexts: [office],});const call = await client.dialPhone({ from: +YYYYYYYYYY, to: +XXXXXXXXXX,});// start Collectconst collect = await call.collect({ digits: { max: 5, digitTimeout: 4, terminators: #*, },});await call.playTTS({ text: Please enter your PIN,});const { digits } = await collect.ended();console.log(PIN collected:, digits);## Accessors### confidence• get **confidence**(): numberConfidence level for the speech recognition result (if [type](#type) is speech), from 0 to 100. For example, 83.2.#### Returnsnumber---### digits• get **digits**(): stringThe digits that have been collected (if [type](#type) is digit). For example, 12345.#### Returnsstring---### id• get **id**(): stringThe unique id for this collect session.#### Returnsstring---### reason• get **reason**(): no_match | no_input | errorAlias for [type](#type), in case of errors. Use this field to check the reason of the error.#### Returnsno_match | no_input | error---### terminator• get **terminator**(): stringThe terminator used to complete the collect (if [type](#type) is digit). For example, #.#### Returnsstring---### text• get **text**(): stringThe text that has been collected (if [type](#type) is speech). For example, hello whos there.---### type• get **type**(): error | no_input | no_match | digit | speechThe type of this collect session.#### Returnserror | no_input | no_match | digit | speech## Methods### ended▸ **ended**(): Promise<[CallCollect](./callcollect.mdx)\>Returns a promise that is resolved only after this collect finishes (or is stopped).#### ReturnsPromise<[CallCollect](./callcollect.mdx)\>#### Examplejsconst collect = await call.collect({ digits: { max: 4, digitTimeout: 10, terminators: #, }, partialResults: true, sendStartOfInput: true,});await collect.ended();---### startInputTimers▸ **startInputTimers**(): Promise<[CallCollect](./callcollect.mdx)\>Start the initialTimeout timer on an active collect.#### ReturnsPromise<[CallCollect](./callcollect.mdx)\>#### Examplejsconst collect = await call.collect({ digits: { max: 4, digitTimeout: 10, terminators: #, }, partialResults: true, sendStartOfInput: true, startInputTimers: false,});// You can add some logic before starting input timers.await collect.startInputTimers();---### stop▸ **stop**(): Promise<[CallCollect](./callcollect.mdx)\>Stops the collect session.#### ReturnsPromise<[CallCollect](./callcollect.mdx)\>#### Examplejsconst collect = await call.collect({ speech: { endSilenceTimeout: 2, speechTimeout: 10, language: en-US, hints: [sales, support, representative], }, partialResults: true, sendStartOfInput: true,});await collect.stop();