When this leg being reconnected, is still in progress
of posting remaining events to update the other side
(the reconnect originator), don't consider it as
sip relay ready. Otherwise any INVITE updates coming
to it, will lead to stumbled INVITEs coming to the other leg,
but without a possibility to use it here (because e.g. this
other side never seen 200OK answer even).
Change-Id: I183d0f70433c156030de38238db395e2c1372352
In the following funcs:
- AmB2BSession::acceptPendingInviteB2B()
- AmB2BSession::acceptPendingInvite()
That ensures we do not interfere into SDP
when creating fictitious replies.
Change-Id: Ic2e6ccc273cd6079c4b21839cfee38455e60ebc2
The parsing code expect a null-terminated string. Make sure the string
is.
Use correct ssize_t as return value.
Change-Id: I2590dead0db5ca839ebe5fe7506b4edfe524d164
Expose the queue_mut for external users.
Supposed to only be used with a snapshot mechanism,
because it is partially a data incapsulation violation.
The container itself and lock mechanism is meant
to be reworked in the future, to not expose locks anymore.
Change-Id: I4f8b90ab60f3ab564e2b858c588a94eb78da6acf
A a mechanism to get the AmSession object
stored polymorphically on the EvQueueMap.
Follow the classes hierarchy:
AmEventQueueInterface -> AmEventQueue -> AmSession
to retrieve AmSession by down casting it from base class.
When retrieved, acquire the snapshot dedicated lock
to prevent other thread destroying this gotten AmSession.
As soon as AmSessionSnapshot is ready,
release the lock and let other (real owner) thread do anything with it.
Left corner cases:
- by the time the AmEventQueueInterface is retrieved and down-casted
into the AmSession, returned to the user and the snapshot lock
is acquired, this thread can simply destroy the AmSession object
- this is an undefined behavior
Change-Id: Ia62b5cb27618e2c077ae5a247bb914be74e17fa9
This makes sure we use the system library, with any updates coming from
upstream, including security fixes.
Change-Id: I03a33869bcd0c3ccc09cf8fafc4258e3a65a2f6b
This makes sure we use the system library, with any updates coming from
upstream, including security fixes.
Change-Id: I3bc01b99fa4c5f107d28a819dc0e1c1eac155e91
Use static_cast for the up-cast of AmSession.
Static cast is equivalent to the C-style implicit cast,
when doing an up-cast, but C-style cast is less clear.
So just use static_cast here.
Change-Id: I7a41f2ee389a4bd48734a75a0d736d8d5a75ed28
Add spaces around variables assignments to make it clear that these are
make variables and equal signs to not bind to multiple variables.
Split multivalue variables into one value per line to make it easier to
sort and modify entries without creating unrelated diff damage.
Change-Id: I87532c3446ae61cc5003ab0714f6b36f89429b56
These variables used to be shell variables passed to the make
invocations in various rules. But those got refactored into make
variables. The problem is that in make the equal sign does not bind
according to surrounding lack of spaces, and the first equal sign
will mark an assignment for the rest of the string including subsequent
equal signs.
The other problem is with the CPPFLAGS assignment where it will assign
append the value and then subsequent conditional assignments will not
take place. Switch to use DEB_CPPFLAGS_APPEND, which was designed
precisely for this purpose.
Fixes: commit 9b5df2495e
Change-Id: Ice82295903729fed3f0fb11f750f3f2fdde2e09f
We can now use the sets to iterate the bindings in order of their
expiry and exit the loop when we encounter the first one with an expiry
in the future.
Change-Id: I093bea9807b4a432ac965b402394edc43eef5a1f
Add an ordered set of all AorEntry objects, ordered by expire time.
Amend modifier methods to update the set whenever some expire time is
updated or an entry or binding removed.
Change-Id: I2afe5becfa2124dbc8c33b38fe1a3e6d4b8a20d5
Move deletion of bindings into AorHash, similar to how expire times are
set. This makes it possible to manage expiry in a central place.
Change-Id: I76a72881ed202e85fb70e9d8526bac55863d07db
Make AorEntry keep an ordered set of all bindings, ordered by expire
time. This makes it easy to quickly tell when the next binding is set to
expire, and which one. Store iterators to bindings in the set so that
they can be used to directly remove the binding when expired.
Change-Id: Ib63c15d5f6e8990e2f4d237726be54da76194a20
Provide accessor methods. Put the setter into AorHash and require
iterators. All bindings must be in an AorEntry container and all
AorEntry objects must be in the AorHash container. By putting the setter
in AorHash and using iterators we can make sure that the binding is in
the container already and that expiry values are kept consistent.
Change-Id: I1c5140d1a7547059f61e47cd317680fcb6eae9fe
Provide a proper class for key matching/ordering instead of
hand-crafting a key to be used as index in several places. Use a simple
ordered map instead of the bucket-based approach.
Change-Id: I9e1918a48e103b655caac160c125a0393d261fca
Put all AorEntry objects into a single hash map. Eliminates the need for
AorBucket. Use an unorered hash map for performance. Use lock guards
instead of manual lock/unlock. Remove an unused argument to gbc().
Switch to the full tick cycle length instead of the tick-based one as
there are no more buckets to iterate.
Change-Id: I7da3bacaa5a28b7e628695ab879394fc6d56f5d2
Simplify the little-used RegisterCache alias hash by using the new
hash_map template. Eliminates the need for AliasBucket. Use an unordered
hash map for performance. Use lock guards instead of manual lock/unlock.
Manually `delete` contained objects as our table's .erase() doesn't do
that.
Change-Id: Ia9721460ce8264fc0a90184a91beca46012b64dd
Instead of relying on a short tick duration to make sure the thread
exits when requested, add a dedicated condition flag and variable. Use
AmThread on_stop to set it and wake up the thread. Use the condition
variable's timed wait instead of nanosleep for the ticks.
This somewhat duplicates what other threads are doing, and what
stop_requested() is doing, and should be unified into a single mechanism
provided by AmThread in the future.
Change-Id: I364e747b4acc1986fa262588c47d83c063ff2d69
The existing hash_table and ht_map_bucket implementations are a nice
performance optimisation, but are over-engineered for certain use cases
which don't see a lot of activity. They also make housekeeping and
iterating the table contents more difficult.
Provide a simpler alternative which is directly based on STL map and
unordered_map. Retain semantic compabilitity by including a mutex and
also providing a dump() method.
Change-Id: I62664b5bb4b1bbef10ba8c85ac1e1221e71bb9de
Eliminate the need to specify the "less than" operator explicitly as
part of the template arguments by specialising std::less, which is the
default operator.
Change-Id: I435792a5b9bd1783275c9632dc7c917e47d2e2f1
This was probably intended as a helper to facilitate reference counted
pointers, but this isn't used anywhere, and the only "allocator" in use
is the default wrapper around `delete`. If reference counted pointers
are ever relevant, they can be done using a shared_ptr.
Change-Id: I2adb561b76efcaf5fb119939f25a7c2438196a5b