call_sip_create() returns NULL only when memory allocation failed. Do
not log "No supported codec", just assert that a call was allocated,
like we usually do in such cases.
Related: SYS#5066
Change-Id: Id7fd16b92bbd10e886892d0c425cf1bc5d5429cf
We have added support for sending SDP via MNCC a long time ago, but so
far the SDP section remained empty. Now, implement actually forwarding
SDP codec information between SIP and MNCC.
The aim is to let the MSC know about all codec choices the remote SIP
call leg has to offer, so that finding a codec match between local and
remote call leg becomes possible.
Store any SDP info contained in incoming SIP and MNCC messages, and send
the stored SDP to the other call leg in all outgoing SIP and MNCC
messages.
In sdp_create_file(), we used to compose fixed SDP -- instead, take the
other call leg's SDP as-is, only make sure to modify the mode (e.g.
"a=sendrecv") to reflect the current call hold state.
The RTP address and codec info in the MNCC structures is now essentially
a redundant / possibly less accurate copy of the SDP info, but leave all
of that as-is, for backwards compat.
There is codec checking that may reject unexpected codecs. The
overall/future aim is to leave all codec checking up to the MSC, but so
far just leave current behaviour unchanged, until we notice problems.
Related: SYS#5066
Change-Id: I3df5d06f38ee2d122706a9ebffde7db4f2bd6bae
Commit bd66804082 established that the
MNCC field flag MNCC_F_GCR should be set when the GCR is present,
but did not set it.
Change-Id: Idad3210055a0d25be6220301b965e3d4c7323692
By default systemd will execute service with root directory
(or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it
to 'osmocom' subdir of state directory
(/var/lib for system instance) instead.
Related: OS#4821
Change-Id: Idad82186d6ef7f00487cf162306b0733886fc129
README.md in-line with that of other osmocom CNI projects:
* markdown syntax
* link to manuals, issue tracker, gerrit contributions, etc.
Change-Id: Ieadbbe4d2963e713d569460d053460f4f99d40eb
Using *unpacked* 'struct osmo_gcr_parsed' in the MNCC PDUs makes
the protocol even more complicated than it currently is, and
moreover complicates implementing MNCCv8 in the ttcn3-sip-test.
Replace 'struct osmo_gcr_parsed' in 'struct gsm_mncc' with a
fixed-length buffer, which is supposed to hold the Global Call
Reference encoded as per 3GPP TS 29.205.
Check / indicate presence of GCR using the MNCC_F_GCR flag.
Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164, OS#5282
* Add GCR to mncc struct and therefore bump mncc version.
* Pass the GCR as a SIP Header to SIP UA and retrieve any such header
from incoming SIP calls, passing the GCR on to MNCC
Related: #OS5164
Depends: osmo-msc I705c860e51637b4537cad65a330ecbaaca96dd5b
Change-Id: Id40d7e0fed9356f801b3627c118150055e7232b1
Use the correct variable in address comparison.
The type cast hid the incompatible type from the compiler.
Change-Id: I701150f22f0eb49fae821996358568d60a385035
Copy the m_mode before freeing the parser.
Address sanitizer aborted with:
20210601033017695 DSIP INFO re-INVITE for call 854A5CDA8037073 (sip.c:192)
=================================================================
==8583==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000003250 at pc 0x55c3b4624dc5 bp 0x7ffe8a4464d0 sp 0x7ffe8a4464c8
READ of size 8 at 0x612000003250 thread T0
#0 0x55c3b4624dc4 in sdp_get_sdp_mode ../../../src/osmo-sip-connector/src/sdp.c:72
#1 0x55c3b462be9e in sip_handle_reinvite ../../../src/osmo-sip-connector/src/sip.c:202
#2 0x55c3b462d676 in nua_callback ../../../src/osmo-sip-connector/src/sip.c:397
[...]
Change-Id: I4c48832f01e61e98536de8f164ab5a3caa64f34a
Concentrate the write() to the socket in 2 places.
One for struct gsm_mncc and one for struct gsm_mncc_rtp.
Improve debugging as now all function debug print the
MNCC primitiv.
Change-Id: Ia84602955b913a3bb13de7a6a92048799f2e1955
This reverts commit 52b2afce2c.
The contact header is generated by the original sofia-sip library.
By adding the contact header explicit as user header it violates the
SIP RFC because sofia will add the Contact header to the BYE message as
well.
Let's fix the bugs in the freeswitch sofia-sip and make it compatible
(not bug compatible) with the original sofia-sip.
Change-Id: I712f17fecbc372d1e486e80673a548e281b37800
Version 1.12.12 of libsofia-sip-ua no longer automatically generates a
contact header element from the local ip address and port. Specifying
the contact tag does not break operation with the existing
library (1.12.11), but allows for operation on a system with
freeswitch 1.10.4 or later installed, which is built against this new
version of libsofia-sip-ua.
Change-Id: I5c35c5a4bad2fbe76c22ac6d7ee37c832e0ba246
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.
Related: OS#4550
Change-Id: I387b41b6c524cd3f6baad7e89b4b6b347d9998ac
Sometimes, logging from sofia lacks the final newline character, messing up log
output. First snprintf() to a buffer, add '\n' if necessary and then log.
Change-Id: Ia26c0b57a0166cf7de87c49471ce6f528a366dd5
Make build and external tests work with python3, so we can drop
the python2 dependency.
This should be merged shortly after osmo-python-tests was migrated to
python3, and the jenkins build slaves were (automatically) updated to
have the new osmo-python-tests installed.
Related: OS#2819
Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7
Change-Id: Ic913e336a5a962fe9515479b03eecdbef0917721
Add the new SDP section to the MNCC socket protocol, but do not yet implement
forwarding SDP from SIP. Implementing SDP forwarding follows in a subsequent
patch.
It is still possible to establish a call with empty SDP: the new osmo-msc on
the MT side, receiving an MNCC_SETUP_REQ, will hit an error log:
"Got no information of remote audio codecs: neither SDP nor Bearer Capability.
Trying anyway."
and then hold thumbs to hit a codec match, analogous to previous behavior.
Note that osmo-sip-connector should actually always have encoded a Bearer
Capability in the MNCC protocol in the MT MNCC_SETUP_REQ message, but never
has. Now we are ready to leapfrog from zero codec info to full SDP.
This patch must be merged at the same time as osmo-msc patch
Ie16f0804c4d99760cd4a0c544d0889b6313eebb7, so that both sides have a matching
MNCC protocol version number.
Change-Id: Iaca9ed6611fc5ca8ca749bbbefc31f54bea5e925
Verify is the parsed data is at least the size of the struct, not
exactly the size. Make it accept messages with additional data, like
the SDP information the TTCN-3 testsuite is sending since
Ic9568c8927507e161aadfad1a4d20aa896d8ae30.
This change makes the size checks consistent with the two other size
checks in the file:
if (rc < sizeof(*rtp)) {
if (rc < sizeof(**mncc)) {
Related: OS#4282
Change-Id: I522ce7f206932a816a64f03d916799c3215bb8c7
When the sip agent start fails (i.e. port can not bind
because IP doesn't exist) exit the sip-connector
Relates: OS#4197
Change-Id: I22ed16c77391b4f270df498dda587ed657279390
The function close_connection() closes the fd without marking it as
closed. Lets set the fd to -1 and check at the beginning if it is
greater than zero. This prevents us from closing an already closed fd
again.
Related: OS#4159
Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e