Commit Graph

215 Commits

Author SHA1 Message Date
Pau Espin 03bc63a1da Bump version: → 1.6.0
Change-Id: I72fa9fdc5c6f1c5cfc6e4cb0b7d0e8ea4557b1ab
2021-11-16 14:52:09 +01:00
Vadim Yanitskiy bd66804082 mncc: rework passing GCR over the MNCC interface
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
2021-10-27 17:03:42 +03:00
Vadim Yanitskiy f3eb44f54b sip: use osmo_{enc,dec}_gcr() from libosmocore
Change-Id: I46fa46fc79494d337f2f4657215b91c39207eea4
Depends: I06babb959fdc82f4e82d92260131d60c98b0abd2
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164
2021-10-27 16:46:00 +03:00
Vadim Yanitskiy 5e178d2c55 sip: fix memory leak (x_gcr) in send_invite()
Change-Id: I6a2e5e15061010f6e62d0f3b0acd2c040dbe3249
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164
2021-10-27 16:26:57 +03:00
Keith Whyte 364f237b42 MNCC v8: Implement Basic Support for Global Call Reference.
* 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
2021-10-05 20:30:16 +00:00
Oliver Smith 1c76aadeed debian/control: remove dh-systemd build-depend
Related: OS#5223
Change-Id: I769bf61a2f3a97d55c65999436d2cb079c9170a0
2021-09-01 16:07:07 +02:00
Neels Hofmeyr e7d05f40ba SIP re-INVITE: log media connection
Change-Id: I2d11be9fe65aa76e044a91f88ba0e9a1d8e756ec
2021-06-01 04:17:49 +02:00
Neels Hofmeyr 0294e38243 SIP re-INVITE: fix media connection change detection
Use the correct variable in address comparison.
The type cast hid the incompatible type from the compiler.

Change-Id: I701150f22f0eb49fae821996358568d60a385035
2021-06-01 04:16:19 +02:00
Neels Hofmeyr 97c7916892 fix use-after-free in SIP re-INVITE
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
2021-06-01 03:35:53 +02:00
Pau Espin Pedrol d9e57e5f08 Bump version: → 1.5.0
Change-Id: I2cafda295513b019cda424f09655061fa7a0fa10
2021-02-23 13:42:08 +01:00
Pau Espin Pedrol 9484ad9a87 mncc: Fix write len
Fixes bug introduced recently.

Closes: OS#4957
Fixes: 0f27b1bd39
Change-Id: Ibbff004e2b76fbfe8962d14628c916afb19f30e6
2021-02-02 16:32:55 +00:00
Pau Espin Pedrol d2a85888aa .gitignore: Get rid of new autofoo tmp files
Change-Id: I5e0735c2e99e868f8cbfffc19ac005df7c289dd8
2021-02-02 16:42:12 +01:00
Pau Espin Pedrol 462ec86ff3 mncc: Log write error code
Change-Id: If7b49bee6fec3a188c978c0606c524776a577927
2021-02-02 16:41:44 +01:00
Oliver Smith ad353b885e set -std=gnu11
Change-Id: Ic95981af622dd713638bec775514dc4ef25594d4
2021-01-28 09:29:00 +00:00
Alexander Couzens 1bd26902d2 mncc: mncc_create_remote_leg: use mncc_write instead of write direct to the fd
Change-Id: I870c16d7ee5e5424304f3c1c9fb78af418ae2577
2021-01-14 21:27:55 +01:00
Alexander Couzens 0f27b1bd39 mncc: Introduce mncc_rtp_write similiar to mncc_write
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
2021-01-14 21:27:50 +01:00
Alexander Couzens ef646b07e2 mncc: add return code for write/send function
Allow to get errors back for the caller to clean up state.

Change-Id: Ic926d192c238ef84fb3ad2be27e507e010b0e93f
2021-01-14 03:41:34 +01:00
Alexander Couzens 3b95463d09 mncc: remove callref argument from mncc_write()
The callref is always included in the struct mncc argument.

Change-Id: Ia156010194c1f4334a4966d01aadfd02fa7097a8
2021-01-14 03:41:34 +01:00
Oliver Smith e590dc15f4 contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: Iae17e6d6f4242f98676dd3a1b01c419ac7288047
2021-01-13 12:59:45 +01:00
Pau Espin 05eea1ef0a contrib/jenkins: Enable parallel make in make distcheck
Change-Id: I17e1adac40ac01daee0dd83da0a6aaebd78ea0dc
Related: OS#4421
2020-10-12 19:46:19 +02:00
Pau Espin cebab664a8 sdp: Don't select addresses failing to parse
Change-Id: Ibfc308bdfab77d0032d8f20c2f0df913e336b75b
2020-09-18 00:32:01 +02:00
Pau Espin b6cb607d12 mncc: Support IPv6 addresses (new version mncc 7)
Change-Id: I3b1bebbcc9e36be43d8d055c8d28cbb38ff21b37
2020-09-10 17:08:19 +02:00
Alexander Couzens f678caa819 Revert "sip: Specify invite contact tag"
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

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
2020-09-05 23:13:55 +02:00
Matt Johnson 52b2afce2c sip: Specify invite contact tag
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
2020-08-13 19:31:58 +00:00
Vadim Yanitskiy 39a2e19309 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: Id7a258c52e72101920a1c0de5534a2ed9f488203
2020-08-13 14:59:51 +00:00
Harald Welte 79d76480ac Bump version: → 1.4.1
Change-Id: I66c64cae47e32a16ef605348d02884172ef04d70
2020-08-13 12:38:17 +02:00
Oliver Smith e02b4dc84c EXTRA_DIST: debian, contrib/*
Change-Id: Ifee945e89b8b3d1a9ef9cf57e36cad306c244657
2020-05-22 13:46:54 +02:00
Oliver Smith d02c8f72b1 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Related: OS#4550
Change-Id: I387b41b6c524cd3f6baad7e89b4b6b347d9998ac
2020-05-19 15:49:42 +02:00
Oliver Smith afb705309f contrib: import RPM spec
Copy the RPM spec file from:

Related: OS#4550
Change-Id: I00f13acd541ec492e4671cf88c92010f5cf61e9e
2020-05-14 11:53:26 +02:00
Pau Espin e58ead7ac4 Bump version: 1.3.1 → 1.4.0
Change-Id: Ia6693372994791bac4ab86808729f5e568dd9176
2020-01-02 21:35:01 +01:00
Neels Hofmeyr 037c6c1ba8 logging from sofia: add missing newline
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
2019-12-17 13:52:21 +00:00
Oliver Smith 18cf9f39c5 switch to python 3
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
2019-12-11 09:43:11 +01:00
Neels Hofmeyr 2e2db3e0ad MNCC v6: add optional SDP to the socket protocol
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

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
2019-11-28 21:05:49 +01:00
Oliver Smith b544ea396a mncc.c: fix gsm_mncc_rtp size checks
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

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
2019-11-28 15:11:33 +01:00
Alexander Couzens 632156a4a8 exit if the sip agent failed to start
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
2019-11-23 08:07:01 +00:00
Alexander Couzens 5e3c9d7224 .service: require to ran after
Relates: OS#4197
Change-Id: I09bf8139582ef198fdbe664be32b14d8c9c99f1a
2019-09-16 19:51:07 +02:00
Philipp Maier e49a3d714c mncc: check fd before closing a connection
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

Related: OS#4159
Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
2019-09-02 14:23:36 +02:00
Keith Whyte 5319d4d979 coverity: Address issue found by coverity
Add NULL checks on the return value of call_leg_other() in

If the remote side has requested media change and we cannot
find the other leg, then release call. This should not

Also, Add an assert to show that we cannot be here
without call type of SIP or MNCC (not related to coverity)

Fixes: CID#202863
Change-Id: I6f1f26533a25c93f243090bc02f1bc83b9108d42
2019-08-09 14:12:32 +02:00
Pau Espin f56af15181 Bump version: → 1.3.0
Change-Id: I3d3d048380753431c313cffa82de430dfbd3b93c
2019-08-08 17:54:49 +02:00
Pau Espin ff8a4ed3d6 Require newer libosmocore 1.0.0
Use of osmo_mncc_name() requires libosmocore 0.12.0
Use of gsm48_cc_cause_name() requires libosmocore 1.0.0

Change-Id: I466140a9c1e05c191fe1b079cf3615fd6ac5fb8c
2019-08-08 17:54:11 +02:00
Keith Whyte eb0a93e037 In hold/retrieve/reinvite, add check that other_leg exists
We should always check that the other leg did not somehow
dissapear before accessing it.

Change-Id: I947aab6c0cc5019929bde1c7012e1a8c3d3472a5
2019-08-07 13:10:51 +02:00
Keith Whyte b43c296f19 Logging: Make use of Levels, clarify some messages
Up to now most logging is on LDEBUG, lets make more use of Log Levels.
reserve NOTICE for unusual events
INFO: normal call setup/teardown
DEBUG, well.. it's DEBUG

* BYE is not an Error.
* 4XX or 5XX response to INVITE is not an Error don't log as such.
* 183 does not necessarily mean "ringing".
Change those log messages for clarity.

Change-Id: Ie0014043d93303a87cbb8bb351e439ff78651cbe
2019-08-07 13:09:44 +02:00
Keith Whyte f9a0f3af42 Handle case where SIP side hangsup while MNCC is on hold
Change-Id: Ie32690e036180e6b80a1b59177c1a72a6fd78d15
2019-08-07 02:16:07 +02:00
Keith Whyte 5311868c26 Cosmetic: Logging and Comments, spelling and clarity changes
Also removes a comment in sdp_create_file() about the
IP address in o= and c= having to be the same.
It is completely legal in SDP and often normal for the
originator and the connection information IP to be different.

Change-Id: I057573467c335fc27ead391c0bb4c775f2f6ba0a
2019-08-07 02:16:07 +02:00
Keith Whyte a2b7c8e29f Define hold/retrieve functions for MO calls
My original patch that introduced this functionality,
only did so for MT calls.

Change-Id: Ifd42ed94053f6a38abfe6d6b18e2fe3582d037bb
2019-08-06 17:48:37 +00:00
Keith Whyte 5f79d5a319 Fix bug with MO calls not connecting.
Fixes a bug I introduced in 5f73c2033b
where we would not call mncc_call_leg_connect() on receiving 200 from
SIP side, and therefore never send MNCC_SETUP_RSP to the MS

Fixes: 5f73c2033b

Change-Id: Ic7cc56c0d68a27eb1229c0c4aa1fa54d00b660b6
2019-08-06 17:40:17 +00:00
Keith Whyte a5b65505f9 inet_ntoa() is deprecated, use inet_ntop() instead
Change-Id: If6a96ede7d5e73884c32fbfdb03052e2bda50a77
2019-08-06 16:53:29 +02:00
Keith Whyte 279e910a4a Following from previous commit, assume other->ip is network byte order
Change-Id: I3641a843a3b4a9b2686c1a07d48f52527dce46a2
2019-08-06 15:00:02 +02:00
Keith Whyte 1f1f3f6fb9 IPs stored in the call struct are NETWORK byte order
As far as I can make out, the intention is to always store ip address in the call struct
in network byte order, whereas the ip address sent on MNCC are in host byte order.

Change-Id: I89ef26aa32a672f394699251cf560b53ae01a814
2019-08-06 14:38:32 +02:00
Pau Espin d0a8fa9062 Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.
API osmo_stats_vty_add_cmds never had a param list but has seem problem
(no "void"), so some users decided to pass a parameter to it.

Change-Id: Ie519d4a4064a95803c33fd6969b53e1ef27045b7
Related: OS#4138
2019-08-05 17:50:01 +00:00