Re-use previously offered SDP body, when processing
a call session with an involvement of DSM, and getting
newer SIP invite having no SDP offer.
This affects applications using the B2B `connectCollee()`
functionality and doesn't actually touch the B2B core itself.
(Which would be wrong if changed in a usual core SDP
processing, whereas original request can be empty and
an offer/answer is postponed to 200OK/ACK exchange)
(Re)invites towards DSM applications technically must
not be empty, because DSMs don't support late offering.
In order to overcome that just pretend that empty
re-INVITEs are using previous body version.
Change-Id: I252eb9f32e7dc073454a2258b176f77bf15d35c9
For cases when used in testing environment
add sw_vsc to the list of `exclude_app_modules`.
We cannot link this to the swrate library
while compiling locally, because swrate lib has
a separate repository.
Change-Id: Id5df2c197139a454b9338bb6bdccba87b1c78424
Fix a list of compilation warnings like:
warning: format ‘%llu’ expects argument of
type ‘long long unsigned int’, but argument 5 has
type ‘uint64_t’ {aka ‘long unsigned int’}
Change-Id: I93ca45869c33040d1e53bb8d29fdf7e7e70603bf
Add handling of the `ZeroedHold` and also handle the default action
in the switch inside `CallLeg::updateLocalSdp()`.
This eliminates the warning:
CallLeg.cpp: In member function 'virtual void CallLeg::updateLocalSdp(AmSdp&)':
CallLeg.cpp:2019:15: warning: enumeration value 'NonHold' not handled in switch [-Wswitch]
2019 | switch(hold_method_requested)
| ^
CallLeg.cpp:2019:15: warning: enumeration value 'ZeroedHold' not handled in switch [-Wswitch]
Change-Id: If0eebda2182b44aa591eb9aedd43481c94788b13
Exclude `mod_swrating` for the test environment,
because otherwise requires linkage with swrate
which is a separate, not visible library
for sems repository.
Change-Id: Ib4deaeebf6a1a411e473388920db017c1836842d
For cases when not defined explicitely
by given compilation variables, add
mod_py to the list of `exclude_dsm_modules`.
It's not used and relies on older python2,
which is not to see in newer environments.
Change-Id: Ic0b3bdb8530b21e9c25484487cbba075b8fea156
Improve Makefile so, that if the `exclude_app_modules`
isn't defined, it has a default value.
Also introduce the `TEST_ENVIRONMENT` variable
which defines, whether to take the `exclude_app_modules`
from given variables or take the one from the Makefile.
Change-Id: I046aa22be8042a053a844b9dd3ee283f7638b95e
Introduce getters for headers in requests
and replies:
- `B2B.getHeaderRequest()`
- `B2B.getHeaderReply()`
Change-Id: I1dfc24658a9e044407f95de9507032f1b041b451
To simplify the work in DSM with strings, the new function
which removes patterns from the source string, has been added.
This allows us to remove unneeded stuff from the given value,
avoiding usage of complex regexes.
Change-Id: I07fd08938a10475120affb395c5b506e8d412f78
To simplify the work in DSM with error codes handling,
a new function, which reads error codes string with
corresponding playbacks, has been added.
This allows to get a custom playback name of the file,
corresponding to a particularly selected error code.
Change-Id: I3f6ba47f346021b6dc761ebef5c31abb415e6d56
The old PCRE library provided C++ bindings created by Google, but with
the new PCRE2 library those bindings have not been ported, instead
Google created a new project called RE2, which is a successor of those
bindings, although it does no longer use the PCRE library underneath,
so some of its features are no longer available.
Change-Id: I77ccbe617ea1fb9c2e5495fc38ddf3760f2c8014
Resolves:
AnswerMachine.cpp:857:39: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
857 | if (a_greeting.fpopen(DEFAULT_TYPE"."DEFAULT_AUDIO_EXT,
|
Change-Id: I1bc154d18d2d2165698fa0c0ab44ea0a7169c8c3
SDP session origin id and version are limited by it's size
to 64 bits (8 bytes), that is because we are using `unsigned long long`
type for both id and version. Hence the maximum value it can hold
is two sixty-forth power, so equals: 18,446,744,073,709,551,615
In case one intentionally sets it to something like:
"o=- 18446744073709551615 18446744073709551615 IN IP4 192.168.0.1"
SEMS gets overwhelmed with that conversion inside the code make
it just to a string literal 'F'.
To overcome it, just use __uint128 (which is of 128bits size)
for the session origin id and version.
Change-Id: I2ad9659aa81dad79969749053dc3fd0d69e2cbd2
Use `unsigned long long` for SDP session id and version
instead of unsigned int.
Refactor all usage of them accordingly.
Additionally intrdouce new utils functions for conversion:
- `ulonglong2str()` - converts `unsigned long long` to `string`
- `str2ull()` - converts `string` to `unsigned long long`
Change-Id: I4210349a5442d4173b14227497f4a01d68cad7a4
Save SDP origin after a call leg is held.
Successive reinvites in the session version must be incremented
based on hold/resume reinvite and not based on the original SDP origin.
Change-Id: I771778dbc26f329561fd928ec70e17ab644b19be
Increment the sessV each time,
when creating new hold request.
Instead of blindly using `established_body` AmMimeBody,
properly treat the sessV, and keep it updated.
`updateLocalSdp()` stores updated body then as `CallLeg::non_hold_sdp`
Which will be later on used to resume held.
During resume keep sessV incremented, because each time new
SDP offer is sent out, sessV has to be updated.
Change-Id: Ifaa6ead0a36f9fe77e032e64547a490d856c44d6
- remove `hm` type, which used to be a crutch
- only use the `holdMethod` type for hold method detection
(so instead of `hm` used)
- move `holdMethod` from .cpp to .h
- make `CallLeg::hold` to a `enum holdAction` data type
(so this enum can be reused)
- make `CallLeg::hold_method_requested` to a `enum holdType` data type
(so this enum can be reused)
- move the `isHoldRequest()` helper to class methods instead of being static
- rename `hold_method_requested` to `hold_type_requested` to have less
confusion in naming (with `enum holdMethod` for example)
Change-Id: Ib40a9e1c40419d6ffd444b59f92958c893c7f268
This commit affects cases when the on-hold is requested,
and the MoH emulation on the SEMS is additionally used.
Currently regardless the method used by the one who sets the call
on-hold, the answer will be always 'a=sendrecv', which leads to
a premature termination of the call at the RTPEngine
(because RTPEngine takes the 'a=sendrecv' into account and
terminates the call due to no seeing the audio)
We need to make sure, that an originator of the on-hold, is being
answered:
- with the 'a=recvonly', if an originator requests the 'a=sendonly'
method of the on-hold to be used.
- with the 'a=inactive', if an originator requests the 'a=inactive'
method of the on-hold to be used.
And after the on-hold is restored (by 'a=sendrecv'),
make sure to send the SDP answer with the 'a=sendrecv' as well.
Change-Id: I50df81be16a75d9e813484012938e2a94ec422e1
Add a function to the AmSipDialog class interface,
to be able to check whether the OA currently expects an offer.
Use it then in the `CallLeg::updateLocalSdp(AmSdp &sdp)`
Change-Id: I1c4f4364ce13c7b03e22e0f037d19b99245a0be8
Make the `isHoldRequest()` safer in terms of operating
on a given `AmSdp &sdp`, we still don't change anything in
the body, but just checking if the request is a hold one.
Change-Id: I82fa3da1a11c686050dc482106735139b800ff2d
Do not take into account `send_491_on_pending_session_leg`
when processing pending updates for call-pick call scenario.
This is required to let the A side (so caller) be updated,
which in a cascading manner later triggers 200OK sending
towards the call pick-up'er, and further media updates
via re-invite.
`send_491_on_pending_session_leg` is used to prevent
overlapping updates towards the same other leg.
In this situation however, two updates towards the caller
is a proper way to finish the call-pickup, so the media update.
A new header for interaction between SBC<->B2B introduced:
`P-Force-491`, which takes either of values '1' or '0'.
If set to '0' the `send_491_on_pending_session_leg` will always
be ignored by SBC, and hence re-invite will reach the target,
regardless if there has been anyone shortly before.
Change-Id: Iee7d2c6ef38e568e7c57a89358b22be0b1cb0438
We need to take care of cases, when one leg has pending
transaction(s), and an opposite leg triggers media re-negotiations,
which assumes we have to update the first leg as well (the one which
has a pending transaction).
Perviously we used to only support sending a fake 200OK to the one,
who triggered a media attributes re-negotiation, and scheduling
an update for the opposite leg for a later time (as soon as its done
with its own transaction(s) ).
For now we can optionally decide whether:
- to send 200OK to the one who triggers re-INVITE
- to send 491 Pending to the one who triggers re-INVITE
Using the approach with 491, gives a solution to the problem,
when a fake 200OK is sent to the remote side, and ACK after a while
is not matched to any of the existing local transactions.
This can happen in case, we have sent a fake 200OK, but SBC triggers
one more transaction towards the same side (over already existing one).
This behavior leads to a failure when trying to match coming ACK to the fake 200OK.
By default, enabled behavior - generate fake 200OK.
Optionally it's now possible to enable 491 Pending response,
by setting sems.conf option:
- send_491_on_pending_session_leg = 'yes'
Change-Id: I17f41833651eb006666315c1f9a7cfd4c0441f8a
Sync the `CallLeg::onB2BReconnect()` with PRO code version,
and add second part of SDP origin manipulation fix.
Change-Id: I7d7558bc88ab91d00bac72a22e1f713afd218233
Remove dependency on AmAppTimer's wall_clock ticks by switching to
direct call of gettimeofday() and converting the internally used time
units to milliseconds instead of the tick-based wall clock time.
Remove ::getLastUpdate() as it's unused.
Change-Id: Ia3a026103b594351c0a6943de67dd94883e30578
During refreshing of the media for the call leg in the
`CallLeg::adjustOffer()`, when the resume is required,
but the `on_hold` wasn't set before (so is false),
then additionally check, whether the SDP body
(media sessions of `MT_AUDIO` type) has state like:
- sendonly
- recvonly
- inactive
This will properly fix the attributes (like: `a=sendonly`)
in the re-INVITE, which is supposed to resume the session.
Change-Id: I1c45b7db55d2a5174f3fd96f3fcd0201b48345f2
The hiredis library does not provide a direct way
to retrieve the allocated port number.
We hav to retrieve the socket file descriptor (redis_context->fd)
from the `redisContext` structure and using the `getsockname()`
get the local address associated with that socket.
Then the `sin_port` field of the resulting `sockaddr_in` structure
will contain the allocated ephemeral port.
By using `ntohs()`, just convert the port number from network
byte order to host byte order for printing. However make an additional
on-the-go type casting into the `unsigned int` also, to be able to print.
(unsigned int is guaranteed to be at least 16 bits,
so this is not a lossy conversion).
Change-Id: Id2a8e9ee4fad6f28db099323fb68fd2db0bfafc2
Backport from the upstream to fix NOTIFY to URI.
Upstream commit: c2908dcb50342e3c8400695b43280181a850fc34
Change-Id: Iff9c0d82ab798f4646284de61365422e48c50a59
Backport from the upstream to fix Python versioning.
Upstream commit: e943f98a8d09a06c88eca10d93e51f7a13056e31
Change-Id: Ia7d6b49270c9f3fa3cc7cb8d921334b2afc1db9b
Fix instances of make rules not being parallel execution safe, where the
targets declare a list of dependencies which depend on the order they
have been declared to be executed serially, otherwise these can cause
race conditions.
Either move some of the dependencies down into their transitive
dependencies, or rearrange them to call $(MAKE) to force a serial
point. In other instances add missing dependencies to make sure the
objects to install have previously been built.
Change-Id: I21b499557ac5e9faa603841fa1882b58239ee650
This was a workaround for Solaris specific issues in the install program
there. The problem is that this can end up generating empty files, that
will not be detected by the packaging system as it will find the file is
present on destination and thus does not need to be installed.
Change-Id: Ib6107957cbf03c4e7da6cf2998d9103224f674d3
Give an exact size of the buf to the `snprintf()` and also treat the
returned value from it to eliminate this warning:
src/XmlRpcValue.cpp: In member function 'std::string XmlRpc::XmlRpcValue::timeToXml() const':
src/XmlRpcValue.cpp:404:53: warning: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
404 | snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
| ^~~~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/c++/10/ext/string_conversions.h:43,
from /usr/include/c++/10/bits/basic_string.h:6545,
from /usr/include/c++/10/string:55,
from src/XmlRpcValue.h:14,
from src/XmlRpcValue.cpp:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: '__builtin___snprintf_chk' output between 18 and 70 bytes into a destination of size 19
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Ic545bbc942715f433610f49286ee9d0f92ee25f6
This commit takes care of the following:
SBCDSMInstance.cpp:55:18: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
55 | throw string("DSM SBC call control "DSM_SBC_CCVAR_START_DIAG" parameter not set (see call profile)'");
|
Change-Id: I9c5ddd5b438d672e29ce0028c00df177adfbfd33
This fixes the warning:
CallLeg.cpp: In member function 'void CallLeg::adjustOffer(AmSdp&)':
CallLeg.cpp:1670:7: warning: 'hm' may be used uninitialized in this function [-Wmaybe-uninitialized]
1670 | if (hm != RecvonlyStream)
| ^~
Change-Id: I7479d1107cb36b733441a3a0ec130658a6786e50
Fix for the:
SBC.cpp:238:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
238 | ERROR("registering "MOD_NAME" application\n");
| ^
SBC.cpp:243:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
243 | ERROR("registering "MOD_NAME" DI interface\n");
| ^
Change-Id: I0199671c027f61f617afc497f2e22cf09e75f78f
Just removal of a few unsed variables:
rtmp.c: In function 'RTMP_ReadPacket':
rtmp.c:2854:7: warning: variable 'didAlloc' set but not used [-Wunused-but-set-variable]
2854 | int didAlloc = FALSE;
| ^~~~~~~~
and this:
rtmp.c:1393:35: warning: 'av_record' defined but not used [-Wunused-const-variable=]
1393 | #define SAVC(x) static const AVal av_##x = AVC(#x)
| ^~~
rtmp.c:1706:1: note: in expansion of macro 'SAVC'
1706 | SAVC(record);
| ^~~~
Change-Id: I8a2bc2c415b44c99b6d881fb7118475f4020c713
The commit fixes this:
JsonRPCServer.cpp: In static member function 'static int JsonRpcServer::processMessage(char*, unsigned int*, JsonrpcPeerConnection*)':
JsonRPCServer.cpp:135:49: warning: enum constant in boolean context [-Wint-in-bool-context]
135 | if (peer->flags && JsonrpcPeerConnection::FL_CLOSE_WRONG_REPLY) {
|
Change-Id: I7894f3e2727e384458ea736ad9555864894b0386
We should provide a proper formation of the timestamp
in the `timeToXml()`. Just unify that in the manner
it's done in the rest of places.
It will fix then this:
src/XmlRpcValue.cpp: In member function 'std::string XmlRpc::XmlRpcValue::timeToXml() const':
src/XmlRpcValue.cpp:404:53: warning: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
404 | snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
| ^~~~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/c++/10/ext/string_conversions.h:43,
from /usr/include/c++/10/bits/basic_string.h:6545,
from /usr/include/c++/10/string:55,
from src/XmlRpcValue.h:14,
from src/XmlRpcValue.cpp:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: '__builtin___snprintf_chk' output between 18 and 70 bytes into a destination of size 19
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Iadfed6c14e1bdb0c8ed0b8b36b996ed08b129c42
A mistake in the bool of the return in the XmlRpc::tmEq():
src/XmlRpcValue.cpp: In function 'bool XmlRpc::tmEq(const tm&, const tm&)':
src/XmlRpcValue.cpp:144:52: warning: self-comparison always evaluates to true [-Wtautological-compare]
144 | t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday &&
|
Second one should be of the `t2` variable.
Change-Id: I7fbf3b1b2f9becdb14db2e994fb4d0abf0937964
This commit fixes this:
ModSbc.cpp:611:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
611 | ERROR("Could not find "DSM_AVAR_REQUEST" avar for request");
| ^
ModSbc.cpp:616:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
616 | ERROR("Could not find "DSM_AVAR_REQUEST" avar as pointer");
| ^
ModSbc.cpp:622:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
622 | ERROR("Could not find "DSM_AVAR_REQUEST" avar as request");
| ^
ModSbc.cpp:634:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
634 | ERROR("Could not find "DSM_AVAR_REPLY" avar for reply");
| ^
ModSbc.cpp:639:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
639 | ERROR("Could not find "DSM_AVAR_REPLY" avar as pointer");
| ^
ModSbc.cpp:645:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
645 | ERROR("Could not find "DSM_AVAR_REPLY" avar as reply");
| ^
Change-Id: I68fe83180b39c34ec365000208527ddc2eff15d4
We have to manually cast the `->len` of type `size_t` to the `int` type,
when it's used for the printing of logs.
Change-Id: I7e116425aecf5ee7e39d8df868edc05b33581014
It's been noticed that in the DSMCall::onInvite() we get this:
DSMCall.cpp: In member function 'virtual void DSMCall::onInvite(const AmSipRequest&)':
DSMCall.cpp:112:34: warning: the compiler can assume that the address of 'req' will never be NULL [-Waddress]
112 | avar[DSM_AVAR_REQUEST] = AmArg(&req);
| ^~~~
DSMCall.cpp:112:34: warning: 'nonnull' argument 'req' compared to NULL [-Wnonnull-compare]
112 | avar[DSM_AVAR_REQUEST] = AmArg(&req);
| ^~~~
Just manage the AmArg construction via the `DSMSipRequest`.
Change-Id: I007e319dd64bf60788efa2d46dfc15b056ee33d7
This commit takes care of this:
../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
../../core/log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
DBRegAgent.cpp:298:4: note: in expansion of macro 'DBG'
298 | DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
| ^~~
DBRegAgent.cpp:298:62: note: format string is defined here
298 | DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
| ~^
| |
| int
| %ld
../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
../../core/log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
DBRegAgent.cpp:423:7: note: in expansion of macro 'DBG'
423 | DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
| ^~~
DBRegAgent.cpp:423:62: note: format string is defined here
423 | DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
| ~^
| |
| int
| %ld
Change-Id: I088f9a1a2861d1f7aae7b7cab84ce0e66b3127c2
This commit takes care of this:
DBRegAgent.cpp: In member function 'bool DBRegAgent::loadRegistrations()':
DBRegAgent.cpp:293:24: warning: NULL used in arithmetic [-Wpointer-arith]
293 | if (object_id == NULL || object_id == 0) {
It makes no sense to compare the `object_id` of type long against
the NULL.
Change-Id: I60cdde2dd459dbfa9c7c942cd8f0d111096411e7
It's been noticed that the compiler reports us:
`Sorry: TabError: inconsistent use of tabs and spaces in indentation`
for the following files:
- apps/examples/mixin_announce/mix_announce.py
- apps/examples/tutorial/annc_service/annc_service.py
This commit fixes it.
Change-Id: I7367af707b50799997d8d2f9c6f1dbff0907f459