sysapps / telephony

API to manage telephony calls
15 stars 12 forks source link

ToneParams: gap does not apply before the first tone #102

Closed efullea closed 11 years ago

efullea commented 11 years ago

'Represents the duration in milliseconds of the time gap (space) before a [DTMF] tone.'

should be

'Represents the duration in milliseconds of the time gap (space) between [DTMF] tones.'

to reflect that there is no gap before the first tone

zolkis commented 11 years ago

Invalid. There may be a gap before the first tone.

efullea commented 11 years ago

What is the reason / use case?

zolkis commented 11 years ago

You may have just stopped a tone. We don't control system latency, so the gap may be needed before the first tone.

marcoscaceres commented 11 years ago

Agree with @zolkis. Makes sense that the underlying system would control the gap before the next send.

efullea commented 11 years ago

But that is not a reason to delay the start of all first tones in a sequence. If we say it is the gap after the tones, both cases are fulfilled, i.e. no delay in the first tone and we make sure that there is a gap between sequences of tones.

zolkis commented 11 years ago

It does not delay the start of all first tones, only when specified. If not specified, the system controls it. Usually in such cases the gap is specified before the tones, not after, since the danger is that we mess with the previous tone. If it is the the user who specifies 0 gap and it messes up, it is his/her responsibility. But 0 gap should not be the default policy.

zolkis commented 11 years ago

Check http://www.etsi.org/deliver/etsi_ts/101200_101299/10123502/01.01.01_60/ts_10123502v010101p.pdf

4.2.4.2: "Where the DTMF signalling pause duration is controlled automatically by 
the transmitter the duration of the pause between any individual DTMF tone 
combination shall not be less than 65 ms. The time shall be measured from the 
time when the tone has dropped to 10 % of its steady-state value, until it has risen 
to 10 % of its steady-state value.
NOTE: In order to ensure correct reception of all the digits in a network address 
sequence, some networks may require a sufficient pause after the last DTMF 
digit signalled and before normal transmission starts"

But there is no way to control a previous tone. So the only option is to specify a pre-gap.

marcoscaceres commented 11 years ago

So it really just means the minimum delay that must have occurred before the next tone is sent by the system (even in the case of the first send). In the case of the first one, the system knows that the min gap time has passed (as it hasn't sent anything yet). So, it basically avoids a race condition and flooding the exchange (which, of course, is good).