This commit fixes this:
In file included from sip_parser_async.cpp:1:
sip_parser_async.h: In member function 'void parser_state::reset_hdr_parser()':
sip_parser_async.h:32:37: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct sip_header'; use assignment or value-initialization instead [-Wclass-memaccess]
32 | memset(&hdr,0,sizeof(sip_header));
| ^
In file included from sip_parser_async.h:4,
from sip_parser_async.cpp:1:
parse_header.h:44:8: note: 'struct sip_header' declared here
44 | struct sip_header
| ^~~~~~~~~~
sip_parser_async.cpp: In function 'int parse_headers_async(parser_state*, char*)':
sip_parser_async.cpp:215:36: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct sip_header'; use assignment or value-initialization instead [-Wclass-memaccess]
215 | memset(hdr,0,sizeof(sip_header));
| ^
In file included from sip_parser_async.h:4,
from sip_parser_async.cpp:1:
parse_header.h:44:8: note: 'struct sip_header' declared here
44 | struct sip_header
| ^~~~~~~~~~
In general, using `var1 = {};` approach to initialize/clear a struct is
equivalent to using `memset(var1, 0, sizeof(MyOwnStruct1));`.
So there shouldn't be any big risks associated with swapping one for the other.
The `memset()` may be slightly more efficient in terms of performance,
especially when dealing with array of structures, but in this situation
we are dealing with quite a small struct, which represents: a type, a name and a value.
As long as `var1 = {};` approach is supported by our compiler and
we don't need to initialize a large array of structures (in our case it isn't),
there shouldn't be any big risks associated with swapping one for the other.
Change-Id: I10570b628d3e5a634d764b83f7558d38ecc6a757
This commit fixes that:
AmSdp.cpp: In function 'void parse_sdp_media(AmSdp*, char*)':
AmSdp.cpp:858:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
858 | if (next > media_line)
| ^~
AmSdp.cpp:860:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
860 | m.type = media_type(media);
| ^
Change-Id: Ie5b7760d3e11ec825ea68138d06eaeb150da202c
This fixes that:
AmRtpReceiver.cpp: In member function 'virtual void AmRtpReceiverThread::run()':
AmRtpReceiver.cpp:92:7: warning: ignoring return value of 'int pipe(int*)' declared with attribute 'warn_unused_result' [-Wunused-result]
92 | pipe(fake_fds);
| ~~~~^~~~~~~~~~
Change-Id: I7a9488ce07f59955e94efa1812fb74cb86e2387d
This fixes that:
AmOfferAnswer.cpp: In member function 'int AmOfferAnswer::onReplyOut(AmSipReply&)':
log.h:143:30: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'unsigned int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
AmOfferAnswer.cpp:367:9: note: in expansion of macro 'DBG'
367 | DBG("Forcing no OA state update (no SDP changes, same session version: was <%llu>, now is <%llu>).\n",
| ^~~
AmOfferAnswer.cpp:367:88: note: format string is defined here
367 | DBG("Forcing no OA state update (no SDP changes, same session version: was <%llu>, now is <%llu>).\n",
| ~~~^
| |
| long long unsigned int
| %u
In file included from AmArg.h:43,
from AmSipMsg.h:3,
from AmOfferAnswer.h:32,
from AmOfferAnswer.cpp:29:
log.h:143:30: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'unsigned int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
AmOfferAnswer.cpp:367:9: note: in expansion of macro 'DBG'
367 | DBG("Forcing no OA state update (no SDP changes, same session version: was <%llu>, now is <%llu>).\n",
| ^~~
AmOfferAnswer.cpp:367:103: note: format string is defined here
367 | DBG("Forcing no OA state update (no SDP changes, same session version: was <%llu>, now is <%llu>).\n",
| ~~~^
| |
| long long unsigned int
| %u
Change-Id: I15c6e37756a55ea5c917b123030b30e0ddc55724
The fix for:
AmMimeBody.cpp: In member function 'void AmContentType::resetBoundary()':
AmMimeBody.cpp:122:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
122 | if ((*l_it)->type == Param::BOUNDARY)
| ^~
AmMimeBody.cpp:124:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
124 | params.erase(l_it);
| ^~~~~~
Change-Id: I96ff98ff20c83949f294fd863e5d6d3880ece9d8
Fix for the following warning:
In function 'char* strncpy(char*, const char*, size_t)',
inlined from 'bool fillSysIntfList()' at AmConfig.cpp:1014:14,
inlined from 'static int AmConfig::finalizeIPConfig()' at AmConfig.cpp:1137:18:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: 'char* __builtin_strncpy(char*, const char*, long unsigned int)'
specified bound 16 equals destination size [-Wstringop-truncation]
| return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
Change-Id: If1610c7ac408ce596b02d95a43558475b87d061b
The following distribution are no longer supported:
- jessie
- precise
- trusty
- wheezy
On the same manner as in PRO version, we keep only the
pkg/deb/debian.
Change-Id: I0d3b4c5543267498ee11f87aa8051d10ac35722c
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
It's been noticed that the compiler reports us:
`Missing parentheses in call to 'print'. Did you mean print(...)?`
Affected files:
- apps/dsm/mods/mod_py/python_inc.py
- apps/dsm/mods/mod_py/python_lib.py
- apps/ivr/python_inc.py
- apps/ivr/python_lib.py
- apps/py_sems/python_inc.py
- apps/py_sems/python_lib.py
Change-Id: I501d69b5681e6cd570b6c3a7c552d268d531d289
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
We don't have to change the SDP OA state, in case
the 183 response has exactly the same SDP content
(same SDP session version) as we already have seen
before in previous 183 message.
Change-Id: Ica008104c31e979cdcb352cefea39db4d1ff3c56
We have to treat 18X replies coming from DSM (usually it's 183)
in `Proceeding` state on the same manner as we do for the `Early` state.
This is because it affects entirely the following call flow after that,
and has to do with a proper clearing of the dialog, when receiving
4XX class of messages (which stop playback and have to terminate this
session: 4XX -> BYE conversion).
Additionally: set the status to the `Disconnected` for the 4XX class
response, which ends up the DSM playback.
Original ticket's number: 56806
Change-Id: I3b0f3ff360cd774fcc7862d34e75747454660d9a
Remove a logging, which produces too much noise in
the sems-b2b.log and isn't too much informative.
Original ticket's number: 56354
Change-Id: I5886520379fa0637551631918351551f6e3e17f7
OPUS requires own Hz frequency for telephone-event (48000Hz),
without which DTMF events using it would be not spotted.
Such an example is Auto-Attendant, which is dependent on the
supported payloads of the sems-b2b. When the caller uses
the OPUS (48kHz) then DTMFs are not spotted.
Original ticket's number: 56278
Change-Id: Ic6f4d9632e4f35e460ed7f9df03f77e829a7bd5f
Because of messy organizing of the code in the function,
it's hard to read that and work with that.
Original ticket's number: 56278
Change-Id: I50f20b034f997214e01ff7810b33c225c6ff26e4
We have to add multi-line headers parsing support, to be able
to properly detect and apply filters to such headers.
Since the SEMS prefers to work with single line values,
multi-line values are getting converted into signle line, like that:
Accept: application/sdp,
application/isup,
multipart/mixed
gets converted into:
Accept: application/sdp, application/isup, multipart/mixed
Additionally:
Support of spaces detection in hf names has been added.
We do not consider spaces as part of the hf name, if they are added.
Original ticket number: 56354
Change-Id: I6adda8218ee6b88035fa9297187187d868f4eb60
Because of messy organizing of the code in the functions,
it's not possible to read that and work with that.
Original ticket number: 56354
Change-Id: Ic07317116cdc043a9431d6469a63eeabc2c1f71b
Improvement of the way we detect, whether or not the
received SDP offer is the on-hold request.
Now we do not take into account the 'recvonly' cases,
when the offer arrives with that
(only 'inactive', 'sendonly' or "zeroed" on-hold).
From now on we also want to consider 'recvonly' as
the completely equal on-hold request, which expects
that the end recipient of that will return us the 'sendonly'
(or worst case 'sendrecv').
Original ticket number: 0055934
Change-Id: Ice3b767c4aef2c6e3e96199219ad0d0e04e93ecf
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Original ticket number: 0055878
Change-Id: I6c093ccc09015c9d4745af6b3c21365220b81386
The new parameter of the 'P-DSM-App:' header is introduced:
- ';reset-to-tag=''
It affects the processing of 18X (especially it relates to 183).
If this is set to '1', then the To-tag stored as the remote tag in
the 'dlg' object, must be updated to the latest one provided by this 183.
This fixes the case as the following one:
- A calls B (B is an owner of the callqueue)
- B starts ringing, and provides the To-tag with 180
- this in its turn, will initiate generation of own "internally"
generated To-tags in all the internal legs between Proxy <-> B2B,
which are crossed by this 180
- B responds with 486 Busy and a processing gets inside the route[ROUTE_EARLY_REJECT]
- the brand-new INVITE is generated and sent to the DSM early_dbprompt app
- A brand-new 183 is provided by the DSM app, which has another (new) To-tag
- this will mismatch in the very original leg with Proxy and B2B
and 183 will be not sent towards the caller, which makes impossible
to provide an early reject playback to it
Original ticket number: 0055878
Change-Id: I96abbe0b8427d40752967607d2fdd0e11145a06a
Strip doublequotes on SDP boundary when the Content-Type header
contains them.
for example:
Content-Type: multipart/mixed;boundary="unique-boundary-1"
will now produce something like that
--unique-boundary-1
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 10.0.0.179
s=-
c=IN IP4 10.0.0.179
t=0 0
m=audio 30000 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:30001
a=ptime:50
--unique-boundary-1
Content-Type: application/vnd.cirpack.isdn-ext
Content-Disposition: signal;handling=required
...
and not
--"unique-boundary-1"
Change-Id: I2efb749c6ff9be4e8ccde62bcf544c72cdb5ad6e
We have to add more SIP response codes, which will be checked against
the isDSMPlaybackFinished(). So that when the DSM playback is finished,
the call is properly released on the caller's side.
Exceptionally 487 is added, for cases like:
a call to HG, where nobody answers and the timeout triggers
a cancelation of all the legs.
Change-Id: I1f7cf81dd5966843713fc41c21ea0249174c13ab
We have to optimize our code:
- substitute all repeating (DSM related) code with a helper static functions
- remove all excessive stuff, which plays no role
Change-Id: I27170509d84a634dc4a9a865ea8395e4e8cc2f3d
Introduce a new header file "global_defs.h" in order to use that
for global definitions or macroses, which are not particularly
related to the SIP headers. Such as DSM applications names.
This will simplify handling and decrease hardcoding all around
the project.
With this commit additionally:
- stop hardcoding values related to DSM applications specific names
- move all the DSM definitions into the global_defs.h or defs.h
Change-Id: I389f632434f0ae1e62540e8df584fdc5e1e07e39
We need to add the 'early-dbprompt' DSM application into
the processing of the 480 replies, which have
'P-DSM-App: <app-name>;playback=finished' parameter set.
Change-Id: I3e561f510d8e56ca7d0cece714c0330f3bfa9ecd
Since the P-Early-Announce has gotten deprecated, it's required
to stop using it. And instead start using the P-DSM-App header, which
now carries the same information as parameter ';early-annonce='.
Change-Id: I7f0f378143d0b6600a239084cd51935a31df3d08
B2BSipReply
We have to update the media session with the caller, if the 183 response
with the 'P-Early-Announce: force' has been received.
Change-Id: Iec67c6b6cc5284afbcfb492fc53108439a427b1d
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Change-Id: Iab28ba34ba0cc970e3f100f8cc61bcbbdabee2bb
B2BSipReply
We have to update the media session with the caller, if the 183 response
with the 'P-Early-Announce: force' has been received.
Change-Id: Ib39dc124ef5e8934ff617d562b222bd07dfcacc1
If we get the 480 reply from the office-hours DSM application,
and there is a header 'P-DSM-App: office-hours' added, with
a parameter ';playback=finished', then it means the following:
- there was either AA or transfer involved into the call, before
the call got to the DSM office-hours
- caller remains in the hold state (so there was 200/ACK)
- the office-hours playback has been finished, and now we mustn't
forward 480 to the caller's leg, but just terminate it with BYE
Change-Id: I389c6993185008c51c61bacd8eb23ac1562871b8
We have to take care of keeping the actual 'Allow:' header in the
request, if the incoming request has had it.
One of the use cases for that is for example the INVITE coming
to the AA, when we must respond with the 200OK,
but there is no 'Allow:' header inside the 200OK.
Certain systems can be confused by that, even though the RFCs are
not forcing us to do so. Which can even lead to an impossibility to use
a normal call clearing with the BYE method, from behalf of the caller.
Change-Id: I9bafb89e4aa5e53077450068f847c07a497b43f1
We have to improve AmOfferAnswer functions in terms of adding
more logging, to let the debug of the OA be more clear.
Also in parallel the refactoring is done in scope of AmOfferAnswer
in order to make reading more convenient.
Change-Id: If7353f1285057760dd5fbeada984a5ef96af9854
Re-use existing local sdp, in case there is a sequential 183 coming,
but it has no SDP.
This will fix the cases, when:
- first 183 has been sent, and provided to the system the SDP
- second/third etc. 183 is coming, but has no SDP body
To not confuse the recipient (end subscriber) of these 183,
the media description in the scenario with 183 having no SDP body,
mustn't be changed (session id, media and attributes).
Previously the behavior was to generate local SDP with
a new session id and add sems-b2b into the media processing by that
(new media port, codecs and other attributes).
However, this change doesn't have an influence on very first 183
sent with no SDP body, because there was essentially no local SDP
saved before. So in this situation behavior is not changed.
Change-Id: I53dd57ae8a4739d5356d94fff45fb290896fd777
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Change-Id: I4a56000a6f33051f9267048dcb620fb1a4eba7c6
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Change-Id: I558685c46358caabe55193c1e27d9531728ea7d6
There is a need to add an exception processing for 183 Session Progress,
and the following in-dialog requests/responses, in case the 183
has been previously sent to the B2B with the hf
'P-Early-Announce: force'.
This adds the following behavior.
When 183 is received, and the caller has been updated with the
new media capabilities, according to those needed to embed early
media into the media session with the caller (via re-INVITE), then:
- even though the 183 is treated similarly to 200OK in terms of media
updates, do not send ACK to the leg going towards DSM,
becausethe sems-b2b giving the DSM, it's still in stage INVITE/183
- do not re-negotiate the leg going towards the DSM,
after the caller has been updated with the new media (a usual behavior)
because the sems-b2b giving the DSM still considers the dialog here
in the Early stage
- do not set the leg going towards DSM into the Connected state,
because by the fact, it's still in the Early stage, and setting of
it into the Connected state, will break processing of BYE / CANCEL.
- upon receiving the BYE from the caller (after the DSM announce is heard),
answer right away with 200OK, but do not forward BYE to the let going
towards DSM. Instead initiate the CANCEL towards it, because this leg
is technically still in the Early stage of the dialog.
Original ticket number: TT#187351
Change-Id: Id6e05202add1bcbd358eecbcd5e2cbda1a995b32
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Original ticket number: TT#187351
Change-Id: I6673fd7acdb058cf0d32fc902dbee2f8767f5e3e
We have to add support for playing an early announce for those
failed trasnfers, which for example reach the timeout.
This means there is a need to do the following:
- send 183 from early announce DSM module
- receive 183 on the B2B leg, which was sending an INVITE to
the transfer destination
- update the caller with an actual media capabilities,
so it is able to receive the early announcement
The mechanism behind that is that:
- if Proxy in the other leg, which was used to reach the party
(to which the transfer has been done),
requests the force usage of the announcement for the caller
in the very first leg (with the caller who is on hold now)
- then the DSM functionality adds the 'P-Early-Announce: force' header in 183
to let sems-b2b in the very first leg know, that there is a need to embed
the audio from the early media into the media session with the caller.
- hence, caller gets a media re-negotiation
- and the leg with the DSM doesn't get updated, since it's still remains
in the Early stage of the dialog
All the solution is built around two important things:
- Proxy uses the P-App-Param called ';force_early_announce=1' to show to the
DSM that it needs a "forcive" early media, which must "override" the MoH
for the caller, if it's being played.
- Sems-b2b uses the header 'P-Early-Announce' to let the very original leg
with sems-b2b know, that there is a need to embed early media into
the already established media session with a caller
Original ticket number: TT#187351
Change-Id: I2cda231e877d9ba91eaa1738322b0981618c1dbf
Because of messy organizing of the code in the function,
it's not possible to read that and work with that.
Original ticket number: TT#187351
Change-Id: I3c92889d44c03b11380fc923e0b22c1ec8961380
We don't have to compare a const char pointer with '>' / '<' operands
agains 0.
The conditional code will not get executed, if 'data->version' is null -
but not that it will, if it's not null.
We should use a classical check for null pointers agains 0 using '!=',
this has the least potential for subtle bugs, and is guaranteed to be portable.
(real ticket number: MT#55816)
Change-Id: I8a6fc38eb947c8908545925fae866c92ab4e3d5f
We need to rework the utils_get_count_files(), because it improperly
treats the given list of numbers, especially what relates to zeroes.
Previous approach gets deprecated, and another approach is applied.
(real ticket number: TT#143150)
Change-Id: Idf1332d12a40e2555d61c16e9f6635bdced82c6d
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
We need to add a possibility to control (add/modify/delete) registrations
for SIP peerings using NGCP-panel. For that to work NGCP-panel uses XMLRPC
requests being sent towards SEMS, which in its turn takes care of work with:
- locally cached map structures:
* registrations / registrations_peers
* registration_ltags / registration_ltags_peers
* registration_timers / registration_timers_peers
- MySQL database (our scope of interest is 'sems_registrations')
- triggering events
Main amount of work is concentrated on interaction with map structures which keep
an actual information on registrations of either subscribers and peerings,
and less amount of work is related to the SQL side.
Basically, the main idea is to add an identifier, which will be used by
NGCP-panel when sending XMLRPC messages to SEMS, which will let SEMS know,
whether it's an event for a usual subscriber or a SIP peering.
Also we take care of loading time, when SEMS retrieves all previously saved data
from the DB using: peer / subscriber auth preferences and loads this to be usable.
A new query has been added for peering type, to let peerings be loadable after restart.
(real ticket number: TT#66577)
Change-Id: I0a815d50dd2728f2fa1411d21adfb084434766b2
There are cases when calls coming to a subscriber of C5 CE,
is being challenged by this subscriber, the use case for that could be
if for e.g. we have a PBX/SBC connected to NGCP via subscriber's object.
Current implementation of SEMS works so, that in case parameters;
'enable_auth' and 'enable_aleg_auth' are set to value 'yes',
SEMS tries to pass the digest for the calling party.
This leads to the empty 'username' and wrong 'response' parameters of
the Proxy-Authorization header, eventually the Authorization process is failed.
This is to be changed, so in case 'u=', 'p=' and 'd=' have not been
previously sent by the Proxy (in 'P-App-Param:'), or rather they are empty, authentication should be transparent,
hence be processed by the calling side, with no interfer from SEMS into that.
(real ticket number: TT#128701)
Change-Id: I989dbe3ed9d5a1d2ec73cb0ad081254c9b9eca32
Otherwise we're missing plenty of audio files in /usr/lib/ngcp-sems/audio/,
several plugins in /usr/lib/ngcp-sems/plug-in/, as well as a bunch of binaries:
* /usr/sbin/ngcp-sems-get-callproperties
* /usr/sbin/ngcp-sems-list-active-calls
* /usr/sbin/ngcp-sems-list-calls
* /usr/sbin/ngcp-sems-list-finished-calls
* /usr/sbin/ngcp-sems-sbc-get-activeprofile
* /usr/sbin/ngcp-sems-sbc-get-regex-map-names
* /usr/sbin/ngcp-sems-sbc-list-profiles
* /usr/sbin/ngcp-sems-sbc-load-callcontrol-modules
* /usr/sbin/ngcp-sems-sbc-load-profile
* /usr/sbin/ngcp-sems-sbc-reload-profile
* /usr/sbin/ngcp-sems-sbc-reload-profiles
* /usr/sbin/ngcp-sems-sbc-set-activeprofile
* /usr/sbin/ngcp-sems-sbc-set-regex-map
* /usr/sbin/ngcp-sems-sbc-teardown-call
* /usr/sbin/ngcp-sems-webconference-addparticipant
* /usr/sbin/ngcp-sems-webconference-roomcreate
* /usr/sbin/ngcp-sems-webconference-roominfo
This fixes a regression introduced in commit 1619876f76 (TT#101059).
Ported the python2 scripts we ship with our Debian package to python3
(AKA py3k), fixed inconsistent use of tabs and spaces in indentation
and indention in several files:
* apps/sbc/tools/sems-sbc-*
* apps/examples/db_announce/announcement.py
* apps/examples/py_sems_ex/*py
We're also not installing the *.pyc files (see
apps/ivr/Makefile.ivr_application +
apps/py_sems/Makefile.py_sems_application), they don't exist in py3k
builds and it wouldn't make any sense to ship them in Debian packages
anyway.
(real ticket number: TT#105412)
Change-Id: I44f0f76b4577501eb31fe814781f47087cfd16dd