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
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
Create the unique pointer based on the AmSession raw
pointer right away and assign, instead of doing
separately the declaration and initialization.
Change-Id: I71cd7084ae03768431b1eded130b0c70d58db78b
To make the Coverity Scan happy and also
make the code a bit more excplicit in terms of
managing the ownership over the session in
(`startSessionUAS()` and `startSessionUAC()`)
just add a code commentary describing what's going on.
Change-Id: I6383c50bf99cbacc29cd77085b787c51bdbee039
startSessionUAC():
Move the session smart pointer into the try statement,
on the same manner as done in `startSessionUAS()`.
Change-Id: I34d9176fd9c740614f822083b4a3f2dcde53b0f8
Make it using spaces, instead of the EMACS based
tabulation/space combination, which makes it
messy for modern IDEs.
Change-Id: I44b632a5a3a5451bee58726370d907e3634ea709
When building up the AmSession and assigning
the app parameters to it, do the move operation
instead of copying.
Fixes defect:
569 // ... and do nothing !
570
571 DBG("onInvite/onRefer returned NULL\n");
572 }
573 else {
574 // save session parameters
>>> CID 550234: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "app_params" is copied in call to copy assignment for class
"std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >", when it could be moved instead.
575 session->app_params = app_params;
576 }
577
578 return session;
579 }
580
Change-Id: I3502a4c36ab6ef24fe53d57e2d5fb01777232b2b
Update the AmArg argument to const as these functions never change it,
and it may come from a const source. (The `string` counterpart in the
other overload is already const qualified.)
Change-Id: I1e527425a70e0c6468b8b59de7e4a20fa1f5c218
C++20 deprecates implicit conversion of enumerations
during math operations like division.
Instead deprecate enum CPS_SAMPLERATE which is used
in a role of pre-proc definition and add a `const float`
value of which is defined by the constructor and is
unchangable.
Also don't use straight-forward (old style) cast with `(<type>)`
but use C++ designed type casts like a static cast, for the
rest of operands in the formula.
Change-Id: Idbfff86f4ec805f3f6db144f3aa041f8fe2c017a
Eliminate the `auto_ptr` usage for core/* ,
since this pointer type has been deprecated in C++11.
Use, as recommended, `unique_ptr` instead.
Change-Id: I352e03bd0c8401d9a4890d8a1845913e4c22dab3
Remark: this commit is created as an attempt to keep PRO / CE sems repositories
consistent in terms of the provided code and functionality.
We need to have a possibility to detect emergency calls and let them
pass through the SEMS, even if the license limitation (CPSLimit) is triggered.
Also taking into account the global policy defined by the cfg parameter
'skip_cpslimit_emergency'.
If set to 'yes' (in the code will be treated as True)
then we do not drop emergency calls on CPSLimit triggering.
If set to 'no' - we treat emergency calls
as if they were usual calls in terms of checking CPSLimit license limitation.
(real ticket number: TT#138356)
Change-Id: I152747271bb5d0a6838f721493fd2660a35e10f8
* remotes/origin/1.4: (27 commits)
b/f: getHeader: find correct hdr also if it's substring of another hdr
b/f: support values at end of SDP without CR (master 8ec8a910a2)
b/f: T38 streams in SBC/B2B (udptl transport); proper media direction passthrough
click2dial: b/f: fix crash when using without credentials
Add systemd-related files to the pkg/rpm dir
Add libzrtp support to the CMakeFile
Fix c/p typo in cmake-files
Missing include for close(FILE *)
Drop privileges for SEMS process
b/f: in webconference app, handle session timer timeout and RTP timeout
b/f: on RTP timeout, end dialog with sending BYE
b/f: make listRooms return only non-expired rooms
b/f: B2BUA: fixed replies for error handling
b/f: fixing b6d5f726 (fix SBC SDP filter)
b/f: fix SBC SDP filter with connection per media only
add Retry-After: 0 to NOTIFY 500 response on low CSeq
b/f: click2dial: save content_type, cseq to connect callee
b/f: use proper empty string value
b/f: use proper failure return value
b/f: reset RTP-received timestamp when (re)starting process RTP stream
...
If an INVITE has been forked and more than one branch is aimed at SEMS,
then the branch parameter of the top-via is necessary to distinguish the
different sessions.
By default, SEMS will now accept forked INVITEs.
This behavior can be switched off by setting "accept_forked_dialogs" to "no" (default=yes).
Conflicts:
core/AmSipDispatcher.cpp
- the session pointer should not be touched after the session has been started (could be immediately destroyed).
- return 481 on CANCEL if the transaction cannot be found.
- reply properly with 482 if the UAS dialog already exists.
SIGHUP - broadcast shutdown, usually sends BYE and stops all calls. The server does not terminate.
SIGINT - broadcast shutdown (usually sends BYE and stops all calls), and stop.
SIGTERM - stop the server, without broadcasting shutdown (no BYEs sent).
to prevent SEMS from stopping if there are hanging sessions,
a limit on the maximum shutdown time (actually time to wait
for sessions to stop) can be configured
default: 10 seconds
turn off by setting to 0
to use it, set USE_THREADPOOL in Makefile.defs and configure thread pool
size with session_processor_threads= parameter in sems.conf :
+# compile with session thread pool support?
+# use this for very high concurrent call count
+# applications (e.g. for signaling only)
+# if compiled with thread pool, there will be a
+# thread pool of configurable size processing the
+# signaling and application logic of the calls.
+# if compiled without thread pool support, every
+# session will have its own thread.
+#
+#USE_THREADPOOL = yes
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1782 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- active sessions and other event receivers
get a SystemEvent::ServerShutdown,
default behaviour of AmSession is setStopped()
- session container waits for all sessions to be ended
- signaling server, rtp receiver, media processor, event dispatcher
are stopped and deleted
based on a patch by Rui Jin Zheng rjzheng at boronetworks dot com
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1087 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- removed AmSIPEventHandler (its functionalities are now in AmEventDispatcher).
- added possibility for each plug-in to receive out-of-dialog messages (any kind).
- added possibility to handle dialogs without creating a session (=AmSession).
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1006 8eb893ce-cfd4-0310-b710-fb5ebe64c474