Interface Call1.Content.Interface.DTMF1

Interface Index (Compact) | Summary | Description | Methods | Signals | Properties | Types

Methods

StartTone (y: Event) nothing
StopTone () nothing
MultipleTones (s: Tones) nothing

Signals

TonesDeferred (s: Tones)
SendingTones (s: Tones)
StoppedTones (b: Cancelled)

Properties

CurrentlySendingTones b Read only
DeferredTones s Read only

Types

DTMF_Event Enum y
Added in 0.25.2. (as stable API)
Objects implementing this interface must also implement:

Description

An interface that gives audio Contents the ability to send DTMF events which have been established using the Call1 channel type. The event codes used are in common with those defined in RFC4733, and are listed in the DTMF_Event enumeration.

Methods

(Permalink)

StartTone (y: Event) → nothing

Parameters

  • Event — y (DTMF_Event)
  • A numeric event code from the DTMF_Event enum.

Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until StopTone is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.

Rationale:
The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.


Possible Errors

(Permalink)

StopTone () → nothing

Stop sending any DTMF tones which have been started using the StartTone or MultipleTones methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal.
Rationale:
On some protocols it might be impossible to cancel queued tones immediately.

Possible Errors

  • Network Error
  • Raised when there is an error reading from or writing to the network.
  • Not Available
  • Continuous tones are not supported by this stream. Deprecated, since stream IDs are ignored.
(Permalink)

MultipleTones (s: Tones) → nothing

Parameters

  • Tones — s
  • A string representation of one or more DTMF events. Implementations of this method MUST support all of the following characters in this string:

    • the digits 0-9, letters A-D and a-d, and symbols '*' and '#' correspond to the members of DTMF_Event
    • any of 'p', 'P', 'x', 'X' or ',' (comma) results in an implementation-defined pause, typically for 3 seconds
    • 'w' or 'W' waits for the user to continue, by stopping interpretation of the string, and if there is more to be played, emitting the TonesDeferred signal with the rest of the string as its argument: see that signal for details

Send multiple DTMF events to all eligible streams in the channel. Each tone will be played for an implementation-defined number of milliseconds (typically 250ms), followed by a gap before the next tone is played (typically 100ms). The duration and gap are defined by the protocol or connection manager.

Rationale:

In cases where the client knows in advance the tone sequence it wants to send, it's easier to use this method than manually start and stop each tone in the sequence.

The tone and gap lengths may need to vary for interoperability, according to the protocol and other implementations' ability to recognise tones. At the time of writing, GStreamer uses a minimum of 250ms tones and 100ms gaps when playing in-band DTMF in the normal audio stream, or 70ms tones and 50ms gaps when encoding DTMF as audio/telephone-event.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.


Possible Errors

Signals

(Permalink)

TonesDeferred (s: Tones)

Added in 0.21.3.

Parameters

Emitted when 'w' or 'W', indicating "wait for the user to continue", is encountered while playing a DTMF string queued by MultipleTones or InitialTones. Any queued DTMF events after the 'w', which have not yet been played, are placed in the DeferredTones property and copied into this signal's argument.

When the channel handler is ready to continue, it MAY pass the value of DeferredTones to MultipleTones, to resume sending. Alternatively, it MAY ignore the deferred tones, or even play different tones instead. Any deferred tones are discarded the next time a tone is played.

This signal SHOULD NOT be emitted if there is nothing left to play, i.e. if the 'w' was the last character in the DTMF string.

(Permalink)

SendingTones (s: Tones)

Parameters

  • Tones — s
  • DTMF string (one or more events) that is to be played.

DTMF tone(s)are being sent to all eligible streams in the channel. The signal is provided to indicating the fact that the streams are currently being used to send one or more DTMF tones, so any other media input is not getting through to the audio stream. It also serves as a cue for the StopTone method.

(Permalink)

StoppedTones (b: Cancelled)

Parameters

  • Cancelled — b
  • True if the DTMF tones were actively cancelled via StopTone.

DTMF tones have finished playing on streams in this channel.

Properties

Accessed using the org.freedesktop.DBus.Properties interface.
(Permalink)

CurrentlySendingTones — b

Read only
Indicates whether there are DTMF tones currently being sent in the channel. If so, the client should wait for StoppedTones signal before trying to send more tones.
(Permalink)

DeferredTones — s

Read only

The tones waiting for the user to continue, if any.

When this property is set to a non-empty value, TonesDeferred is emitted. When any tones are played (i.e. whenever SendingTones is emitted), this property is reset to the empty string.

Types

Enum (Permalink)

DTMF_Event — y

  • Digit_0 (0)
  • 0
  • Digit_1 (1)
  • 1
  • Digit_2 (2)
  • 2
  • Digit_3 (3)
  • 3
  • Digit_4 (4)
  • 4
  • Digit_5 (5)
  • 5
  • Digit_6 (6)
  • 6
  • Digit_7 (7)
  • 7
  • Digit_8 (8)
  • 8
  • Digit_9 (9)
  • 9
  • Asterisk (10)
  • *
  • Hash (11)
  • #
  • Letter_A (12)
  • A
  • Letter_B (13)
  • B
  • Letter_C (14)
  • C
  • Letter_D (15)
  • D