This development package was inherited from the upstream sems packaging,
but we have never have had any user for the CE version.
Change-Id: Iacbacecbe014a4eabdf91005d7b00fe4d4b0dea5
Add to the compilation flags the standard,
which has to be used during the compilation
process.
Wasn't the case before.
Change-Id: I51d2303040a6b31d56411e7e4a89da8c0adf7170
When replying with 200OK generated by SEMS to INVITE requests,
which have no SDP body included, just answer with empty 200OK.
This sets the `OAState` of the call leg to `OA_None`.
Change-Id: Ic28e80d670ba4ce98be6abac9d17689688f99f71
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
We ship /lib/systemd/system/sems.service as symlink pointing
to ngcp-sems.service, ignore in lintian as reported by
lintian v2.118.1 as present in current Debian/testing AKA trixie.
Fixes:
| E: ngcp-sems: service-file-is-not-a-file [lib/systemd/system/sems.service]
Change-Id: I62a162facf01afd59c19100db9b6b1fdae783981
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
Don't store the `st` variable in a processor register
but store as usually in memory.
Resolves:
AmUriParser.cpp:97:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
97 | register int st = ST1;
|
Change-Id: Ia38feab1e58aeab20e2f7319bee268feca919a82
Don't store variables in a processor register
but store as usually in memory.
Resolves:
10: 32:12 AmSdp.cpp: In function 'bool parse_sdp_line_ex(AmSdp*, char*&)':
10: 32:12 AmSdp.cpp:571:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 571 | register parse_st state;
10: 32:12 | ^~~~~
10: 32:12 AmSdp.cpp: In function 'char* parse_sdp_connection(AmSdp*, char*, char)':
10: 32:12 AmSdp.cpp:757:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 757 | register sdp_connection_st state;
10: 32:12 | ^~~~~
10: 32:12 AmSdp.cpp: In function 'void parse_sdp_media(AmSdp*, char*)':
10: 32:12 AmSdp.cpp:838:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 838 | register sdp_media_st state;
10: 32:12 | ^~~~~
10: 32:12 AmSdp.cpp: In function 'char* parse_sdp_attr(AmSdp*, char*)':
10: 32:12 AmSdp.cpp:1038:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 1038 | register sdp_attr_rtpmap_st rtpmap_st;
10: 32:12 | ^~~~~~~~~
10: 32:12 AmSdp.cpp:1039:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 1039 | register sdp_attr_fmtp_st fmtp_st;
10: 32:12 | ^~~~~~~
10: 32:12 AmSdp.cpp: In function 'void parse_sdp_origin(AmSdp*, char*)':
10: 32:12 AmSdp.cpp:1253:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
10: 32:12 1253 | register sdp_origin_st origin_st;
10: 32:12 |
Change-Id: Ice87c3659816003c94359f891a490db0910ff74a
Explicitly set port and nports to 0 when initializing
a brand new instance of SdpMedia.
This resolves warnings:
../../core/AmSdp.h:168:8: warning: '*(__vector(2) unsigned int*)((char*)&<unnamed> + offsetof(SdpMedia, SdpMedia::port))' may be used uninitialized [-Wmaybe-uninitialized]
168 | struct SdpMedia
| ^~~~~~~~
../../core/AmSdp.h:168:8: warning: '<unnamed>.SdpMedia::nports' may be used uninitialized [-Wmaybe-uninitialized]
168 | struct SdpMedia
Change-Id: Ifa2838ba0ef2f1a48b4fdc07b7bfaf8c5aefcfaa
Don't store `fin` variable in a processor register
but store as usually in memory.
Resolves:
parse_100rel.cpp: In function 'bool parse_rseq(unsigned int*, const char*, int)':
parse_100rel.cpp:19:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
19 | register bool fin; \
| ^~~
parse_100rel.cpp:55:3: note: in expansion of macro 'READ_NUMBER'
55 | READ_NUMBER(rseq, pos, end);
| ^~~~~~~~~~~
parse_100rel.cpp: In function 'bool parse_rack(sip_rack*, const char*, int)':
parse_100rel.cpp:19:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
19 | register bool fin; \
| ^~~
parse_100rel.cpp:84:3: note: in expansion of macro 'READ_NUMBER'
84 | READ_NUMBER(rseq, pos, end);
| ^~~~~~~~~~~
parse_100rel.cpp:19:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
19 | register bool fin; \
| ^~~
parse_100rel.cpp:91:3: note: in expansion of macro 'READ_NUMBER'
91 | READ_NUMBER(cseq, pos, end);
| ^~~~~~~~~~~
Change-Id: I9030a5ac8b7ebb0dd1b932296f73a7987639fc26
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
Core in CE is missing currently functions to accept
pending invitations, introduce them from PRO version:
- `acceptPendingInviteB2B()`
- `acceptPendingInvite()`
Additionally:
- add a helper to create fake replies `createFakeReply()`
Change-Id: Icc5be22051f68f269d4b93637f2b3b59498dbd25
Sync the `CallLeg::onB2BReconnect()` with PRO code version,
and add second part of SDP origin manipulation fix.
Change-Id: I7d7558bc88ab91d00bac72a22e1f713afd218233
If there are no timers then it makes no senes to process ticks in real
time. Sleep up to 0.5 seconds in that case. When timers are added we
are immediately woken up through the conditional variable. Only setting
the shutdown flag would not wake up the thread, but a sleep time of half
a second should be an acceptable delay for shutdowns.
Analogous to 695d902841
Change-Id: I37adf078825470af99e6a7755df3d8786d3eeaa6