if a delay buffer is enabled, the packets get scheduled in the future,
but media playback packets are scheduled immediately. this results
in choppy playback due to the packets coming in at the same time.
This change adds a new bool to chu_args that gets enabled when
play-media is called and passed in to codec_handlers_stop so the delay
buffer queue is cleared instead of flushed
Change-Id: Id534f9087d934481f17341bc577099dc2362f8e1
The GLib slice allocator has been obsoleted. Having a mixture of two
allocators can lead to hidden issues on systems that use different
implementations. Take the leap and replace everything with g_new/g_free.
Change-Id: I025c8383ef47b2c2472573360407fd6a6ca339b3
This mode is only supposed to be used by cases when:
- in-dialog offerer doesn't have own MoH capabilities; and
- still want the recipient to hear the MoH music; hence
- an offerer checks whether a recipient is capable of MoH,
and launches a player based on given capabilities;
- the rest functions the same as with usual MoH hold;
Other information:
- `mode=reflect` is only to be used within dialog,
so, it's not meant for a session origination,
and hence stands alone from other MoH option flags
that actually give a metadata (e.g. blob data)
- `mode=reflect` hence contradicts with `mode=sendrecv`
which in its turn serves another purpose
Usage:
- `moh => { mode => 'reflect' }`
Change-Id: I8d0d55f2711c6b47bfca17691582c1ffe66eae3d
Protects against double MoH played,
e.g. when inadvertently two rtpengine instances try to trigger MoH.
This gives a clue to the current rtpengine instance,
that another one already started MoH for this call.
By default is set to false.
Change-Id: I7cc36a177b0ce1bdb64ff8b42bf31f13fb1e4c91
Centralize opts setting, leave it only for
the `media_player_new()`.
Even though it's allowed them to be empty.
Change-Id: Ia347673f891c6c698909f57bdc7126fa5caf42bf
When MoH is triggered with `sendrecv` flag (so that
the recipient, the one who is put on hold, sees
the sendrecv state instead of sendonly/inactive),
we have to correctly process the answer coming back
to the MoH originator.
The originator of MoH must see:
- recvonly to his sendonly
- inactive to his inactive
Hence OA model is kept correct for the originator's leg.
Additionally: accordingly correct MoH tests.
Change-Id: Ida5f074d302c419c1e57e4fd624a55bfddae5587
If MoH originator has inactive stream
allow him to trigger media player.
This ensures that we support two
ways of putting on hold:
- sendonly
- inactive
Change-Id: I81b33184d1f1bcb0ad7c2bb3e7ada96b2c52b1ac
Add a possibility to add opts when actually
creating new media player.
This can be useful for cases with MoH implementation.
Change-Id: Ie7f9d290cd5e46063dd4095d57a521396b58bcfb
Mark the media player as used for MoH (via .opts),
before actually calling the play media
implementation.
This allows to differentiate a default
play media case from those used by MoH.
Change-Id: Ic7a60b6653a505bc856fec767f88988f624bdea0
If the receiver of a previously passthrough T.30 stream gets switched to
a generated PCM stream from a T.38 gateway, continue the sequencing of
the previous SSRC. Technically this is not necessary as the generated
PCM stream gets a new SSRC, but at least Asterisk seems to ignore this
and expect sequencing to continue, and will ignore PCM if the sequence
jump is too large.
Change-Id: Ia4656770db11f5fa1a1e9bf5bd71a0398deb1e00
Make sure a codec is not only known to us, but that it can actually be
used, in places where it makes sense. This is partially redundant
because ensure_codec_def_type already takes care of this, but a codec
definition may come from a different source, so it doesn't help to
double check.
Change-Id: I91af84afc2477840f1400674b2538ad8fb7746ee
The media blob is owned by the call, so we need to hold a reference to
the call until decoding is finished.
Change-Id: I6ed0d35edb485aad2811b287706ef101c4aa2c3f