Preamble: no functional changes.
AmSdp::parse() mixes int values with bool,
what makes the behavior not really clear, not defined
and can lead to the unpredicted result (even though the
compiler *should* actually fix that, but one ought to
not rely on this).
Hence make the parse method only be working with bool values.
Then, reverse the return value so that it's clear
that wrongly parsed is `false`, and good parsed is `true`.
Refactor all users accordingly.
Also rework those users, who indeed need `int` value
be returned, e.g. when having -1.
Do the same thing with the `parse_sdp_line_ex()` helper,
whereas parse() is the only user of it. And also reverse
the interpretation of true/false.
Then, make `parse()` working with a plain `char*`, so not a const.
Because doing a tricks like:
cast `char*` to const (user level) -> cast `const char*` to non-const
in a function (in a old C-like manner), has really no sense.
Refactor everything accordingly.
Other than that, refactor AmMimeBody:
Refactor it to work with a plain `char *` pointer instead of working
with `unsigned char *`, which nowadays has really no sense and
rather is a rudiment of C-like code base coming from the past.
Convert `payload` from `unsigned char*` to `char *` accordingly.
Refactor everything in AmMimeBody implementation accordingly.
Remove rudiment C-like casting everywhere, where possible.
Update `parseMultipart()` to work with a plain `const char *`
instead of `const unsigned char*`
P.S.: leave a list of TODO's for further rework, which
is not directly related to this scope of rework.
Change-Id: Ie1e132429245e0d2cc740d5b1c1fc17cf037a820
These are all instances of an object being put into a container just
before it goes out of scope. Use move semantics to avoid copying.
Change-Id: I9c40a56c4a67df2b8e244d51f068b50ec286f5bf
Warned-by: Coverity
Use overloading for the various flavours of str2int functions. This has
the benefit of automatically choosing the appropriate function for
aliased types that may be one or the other underlying type, such as
size_t.
Do a mass renaming of all relevant instances.
Change-Id: I7abb6b9031ee53332d2b04a6cba4a6cc667a4807
Don't use the `B2BgetHeaderReply()`, it's based on
last received positive reply (200OK), so quite useless
for provisional replies processing (18X).
Thus e.g. for 180 Ringing handling it will never
return anything, because it has no data to parse.
Instead cast event into B2BSipReplyEvent and
parse headers from there.
Change-Id: I4bc4ad5d3aebd7b9ea497bcd53f63736e89d61db
This function replaces escaped `\r\n` occurences
into normal its view: `\r\n`.
Make this a function, to let it be reusable
for other DSM implementations.
Change-Id: Ica737df259fbf136b9a6855bc9439cbe005be6c1
Save last reply gotten and processed with
`DSMCallCalleeSession::onSipReply()`.
E.g. 18X are getting processed for DSM sessions there.
Change-Id: Ie0c44b1ddc8acd3fb07e01c6353eb2dce7a45a6e
Use `b2b_mark_dsm_for_updates` DSM session variable
to let updates towards caller have `P-DSM-App:`
header with a given value.
Change-Id: I4bc92f8ec9e2ec51bae70550c294a40581f92443
If requested by `b2b_build_pai_from_hdr` DSM parameter,
then get the value of PAI using this parameter and pass
it further for `B2BSipReplyEvent` processing.
Use event params to pass the value.
`b2b_build_pai_from_hdr` keeps the name of header
coming in the latest reply, from which the PAI's value
is to be built.
Update the `reinviteCaller()` function's signature,
to pass headers towards `dlg->sendRequest()`.
Change-Id: Ic6e66e326f26a830c3ed06c19a6ab7be4ebe0135
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
Introduce getters for headers in requests
and replies:
- `B2B.getHeaderRequest()`
- `B2B.getHeaderReply()`
Change-Id: I1dfc24658a9e044407f95de9507032f1b041b451
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
based on a patch by Emil Kroymann
Conflicts:
apps/dsm/DSMCall.cpp
apps/dsm/DSMCall.h
apps/dsm/DSMSession.h
apps/dsm/DSMStateEngine.h
apps/dsm/SystemDSM.cpp
apps/dsm/SystemDSM.h
doc/dsm/dsm_syntax.txt
Conflicts:
doc/dsm/dsm_syntax.txt
applications which are doing outbound calls should implement
onFailedOutboundCall if the behavior should be different than
setting stopped.
Reported by Andrei Samusenko
- B2BUA app with SIP Session Timer (SST) now can also use UPDATE
(see session_refresh_method in sst_b2b.conf)
- if re-INVITE is used, normal SDP OA (INVITE+SDP/200+SDP) is done
using last established SDP (instead of delayed SDP negotiation
and SDP ping-pong)
- SDP is compared only after o= line (no SDP ping-pong with UAs which
always increase SDP version)
Due to the multiplexing of requests from several sources on to
json-rpc connections, when Jsonrpc requests are sent, the
application can not know the request ID which is to be used.
A new AmArg parameter to jsonrpc sendMessage and execRpc functions
can provide user data, which is copied into the response event,
and thus can be matched to the request in the application.
B2B.clearHeaders()
clear the headers used for outgoing INVITE on B leg
B2B.addHeader(string header)
add a header for outgoing INVITE on B leg
B2B.setHeaders(string headers [, replace_crlf=true|false])
set headers for outgoing INVITE on B leg
replace_crlf=true for replacing \r\n with CRLF
e.g.
B2B.setHeaders("P-One: value\r\nP-Two: anothervalue", true)
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1623 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- actions set $errno or throw exceptions
- throwOnError() throws exception if $errno set
- $strerror has details, in exception as #text
- documented
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1570 8eb893ce-cfd4-0310-b710-fb5ebe64c474