When using that, the return value must always
be checked, because the parsing itself can indeed fail.
Fixes such things as:
** CID 583412: Error handling issues (CHECKED_RETURN)
/core/AmB2BSession.cpp: 340 in AmB2BSession::acceptPendingInvite(AmSipRequest *, const AmMimeBody *)()
_____________________________________________________________________________________________
*** CID 583412: Error handling issues (CHECKED_RETURN)
/core/AmB2BSession.cpp: 340 in AmB2BSession::acceptPendingInvite(AmSipRequest *, const AmMimeBody *)()
334 return;
335 }
336
337 /* port must reflect actual port in SDP offer coming in */
338 if (sdp) {
339 AmSdp fake_sdp;
>>> CID 583412: Error handling issues (CHECKED_RETURN)
>>> Calling "parse" without checking return value (as is done elsewhere 12 out of 15 times).
340 fake_sdp.parse((const char *)sdp->getPayload());
341 desired_port = getMediaPort(fake_sdp);
342 }
343
344 if (desired_port) {
345 ILOG_DLG(L_DBG, "Desired port for fake 200OK is '%d'\n", desired_port);
Change-Id: I7bd177a624ebe2df2629863eb31f97f99bd921bb
Set the port in fake SDP answer (to the other side)
coming from the leg, which now replaces the previously
existing one, to the port gotten from the replace INVITE.
Otherwise, if to use the port from the pending transaction
(towards pick-up'er) it confuses rtpengine with a case
when same port talks to himself, and then can later be
used to update the pick-uper's leg once again.
Change-Id: I4c001f7956a005b64285c05586839f01216cfd91
Force the leg being connected instead of the replaced one
to the rtp_relay_mode = RTP_Direct, because otherwise
legs can get SEMS involved into rtp relay after a transfer
is finished.
Change-Id: Ifb55feaa7813fc303a663ac132b0bfe175772ce0
Don't re-exploit the connection information and port
(taken from the coming SDP offer) for creation of faked
SDP answer (200OK). This is confusing and can break things
in rtpengine monologues handling.
Better to create fake SDP answer based on already learned
local SDP port and entirely connection information.
Change-Id: Id71453022fd6c93f6743f1046588447b52c38c07
Make the AmOfferAnswer model actual and introduce
according class API updates.
Accordingly update CallLeg, SBCCallLeg and AmSipDialog.
Change-Id: Iab26f4a7577af56df68ffe693859eaac08913b7f
In case of INVITE pending UAC transactions for the other leg,
and new coming in (like 200OK send to this leg, and just right
after that re-INVITE), just provide a fake SDP answer (200OK)
in the meanwhile.
And expect that a finished UAC transaction on the other side,
must trigger a consequent update for this leg, what will finish
these media negotiations.
Change-Id: I190dfcd5467c728e2192940dfac8454f708cecaf
Add class wrapping around a void* and make it call dlclose in its dtor.
Use a shared_ptr-based container to keep all dlhandles until end of
lifetime.
This way we get automatic dlclose when all references are gone.
Change-Id: I4bf94fc9825a9d20e68e8a6fbd4a96e8fd442a1a
Apps registered through registerFactory4App or registerApplication get
put into the same name2app map as apps registered from loadAppPlugIn.
For consistent references, refcount these as well.
Change-Id: I9b616257555533a8ea5847a95b4fa5c0f2e91877
Increase refcount also for DI plugins and log plugins, as they also have
their refcount decreased for unloading.
Change-Id: I0b9d2f671a2a1acda4e5210855aafd47f8cb62c3
The `di_method` object accesses fields of the `s` server in its dtor.
Therefore delete that one first, and `s` second.
Change-Id: Ib5f86753c7801b0b67d92e4c0f97464c2aecdaed
New class inheriting from AmEventQueueBase to be used in threads that
run in a loop processing events until thread shutdown is requested.
Change-Id: Ib63837997659a944fc217712ff2472c7900e7525
Rename most of it to AmEventQueueBase. Remove the integrated mutex and
condition variable.
Add refactored AmEventQueue, which now inherits from AmEventQueueBase
and includes the previously existing mutex and condition variable.
No behavioural or usage difference, other than that now AmEventQueueBase
must be used as base class where previously AmEventQueue was used.
Remove pointless locking in dtor.
Use lock guards where appropriate.
Introduce virtual ::shouldSleep() to determine whether a looping thread
should sleep and wait for an event, or go to process pending events.
Change-Id: Ib90ff47e0c9c279e54f23cd33bf31042fdf08015
AmThread already inherits atomic_ref_cnt virtually. For cases of child
classes inheriting both AmThread and AmEventQueue, make sure only one
instance of atomic_ref_cnt is present.
Change-Id: I611db51f0b36e7cca2bcdfe8befa20bce975030b
Use AmMutex facilities to protect members dictating whether to run or
not. Replaces `runcond`, `process_sessions_mut`, and ::on_stop().
Remove redundant wake-up.
Change-Id: I75c5c4ff2be2b66b36c7354c1e127bc4f5d9993c
This module initialises and starts the StatsUDPServer. Stop its worker
when the module is destroyed.
Change-Id: I265d7ee103866a5946b066e4e7d42376e3510cac
Use the new AmThread facilities to get notified about shutdown. Use the
new `run_mut` in place of the existing mutex to protect `thread_list`
Stop watcher thread from main thread on shutdown.
Change-Id: I4214a5d2324dd7d7d5a424e425d3e2d0ef20aa14
Add a central mutex and condition variable to AmThread, which can be
used by subclasses in their ::run() to determine whether they should
sleep, run, or shut down. This will replace identical mechanism in
subclasses that have this implemented on their own.
Subclasses which don't need this are not affected.
Add `_state` to the list of members protected by this mutex, obsoleting
the need for atomic ops.
Refactor `_joined` as an enum state, also protected by run_mutex,
replacing the separate mutex. Use run_cond as signal to wake up thread
waiting on the join to the complete.
Notify this cond on shutdown, after setting the state to "stopping."
Add ::stop_requested_unlocked() for threads which use `run_mut`.
Change-Id: I0b640b54c9f601e86cbb25413cacb67e31fbe913
If the CallLeg isn't SIP relayable, then makes no sense
to relay INVITE to the other leg, otherwise it gets stuck
on the other side.
Change-Id: I43dff24981084885a20f697537419a6dac75b806
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