Add helper functions wrapping around reserve_port which directly return
a socket_port_link object. This allows us to rework
__get_consecutive_ports and release_reserved_port to eliminate mixing
different port numbers in the same list, which makes for cleaner code.
Change-Id: Ia9808f71c854f6efd0e93ce8df4527c4aea311bd
Empty subscriptions are not supported and would be an internal bug.
Remove expectations that the contents can be NULL.
Change-Id: Ibd7b0d86e7fb147135a93316575954aca546eac2
This flag is relevant to copy the state from A to B during an
offer/answer. It should only be set on one side, not on both.
Change-Id: Ie5c6de58a4ca11b37526b719b1937ffb08ebf512
Have one function to just set flags and init a single media, and another
one to set up sink pointers
Change-Id: I3207ea9f36a0e3575c2149e077e6106fd065fe1b
Directly return the just-created subscription from the respective
function. Saves a hash table lookup.
Change-Id: I42d9c75ebae2cc92619e78badb8ac594397b614b
Turns out that g_ptr_array_new_full or g_ptr_array_new_sized only
preallocates array members, but doesn't set the length.
Change-Id: I722e29a13c415f2a5ff62830dce60205f273b445
Grab source monologue and source media only once, and pass the object
down to the various functions, instead of doing the retrieval several
times in multiple places.
Change-Id: I88d019dbf9493fa0037161390fdb9efda58f5441
We know whether we're printing for monologues or for medias, so there's
no need to have a generic function signature.
Change-Id: I356747686adb34c19ba2ba4c77c2d0a77b85a364
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
Add a simple function that acts as an encryption callback to just update
the ext_seq (index) of the egress SSRC context. The kernel module
already does this, but the daemon only did it when SRTP was involved.
This now tracks egress packet indexes in all cases.
Change-Id: I9460744de55ead4b05aceb322fd8482442ff2b41
Some components (the timer thread used by the codec handlers in
particular) may hold references to components owned by the codeclib (the
.so handles in particular). Move codeclib cleanup towards the end.
Change-Id: Ic581588c27b69c025576c14a69e999c9ca5d1597
Fixes a corner case that happens when trying to delete a call created with
ng offer and no-redis-update flag and for which no ng answer was received.
In such cases, one would receive warning messages from Redis
"ERR DB index is out of range".
What happens is that on call creation redis_hosted_db defaults to -1. This
value is changed when writing to Redis, but the writing is not done for a
ng offer with no-redis-update.
Kudos go to Pawel Kuzak.
Closes#1910
Change-Id: Iad19ec8ac69b169e6352662697b17eb23e6970fb
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
Avoid repeated calls to the memory allocated for port pool list
management by picking out the list elements without freeing them,
storing them in the stream_fd object, and then returning them to the
list when the port is released.
Change-Id: I67cd5039e62e4d2965e85d7ba7f0454f08f40494
The parser currently relies on the appropriate parsing functions
(dict_iter, list_iter) to be called to advance into and back out of any
sub-objects containd within the flags string. However, if an unknown key
is encountered, no parsing functions would be invoked, resulting in the
parser not skipping over the sub-object and subsequently a stray error
message in the log. Work around this by detecting unparsed objects and
then using a dummy list_iter to return to a good parsing position.
Change-Id: I908aff8b9be8d12644a9faea0dcf3bf3535faf32