Projects
osmocom:latest
osmo-sip-connector
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
osmo-sip-connector.spec
Deleted
@@ -1,81 +0,0 @@ -# -# spec file for package osmo-sip-connector -# -# Copyright (c) 2016, Martin Hauke <mardnh@gmx.de> -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -Name: osmo-sip-connector -Requires: osmocom-latest -Version: 1.6.3 -Release: 0 -Summary: MNCC to SIP bridge for osmo-nitb -License: AGPL-3.0-or-later AND GPL-2.0-or-later -Group: Productivity/Telephony/Servers -URL: https://osmocom.org/projects/osmo-sip-conector -Source: osmo-sip-connector_1.6.3.tar.xz -Source1: rpmlintrc -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool -BuildRequires: pkgconfig >= 0.20 -%if 0%{?suse_version} -BuildRequires: systemd-rpm-macros -%endif -BuildRequires: pkgconfig(libosmocore) >= 1.9.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 -BuildRequires: pkgconfig(libosmovty) >= 1.9.0 -BuildRequires: pkgconfig(sofia-sip-ua-glib) >= 1.12.0 -%{?systemd_requires} - -%description -Use the osmo-nitb MNCC interface and bridge it to SIP. - -%prep -%setup -n osmo-sip-connector -q - -%build -echo "%{version}" >.tarball-version -autoreconf -fi -%configure \ - --docdir="%{_docdir}/%{name}" \ - --with-systemdsystemunitdir=%{_unitdir} -make %{?_smp_mflags} - -%install -%make_install - -%if 0%{?suse_version} -%preun -%service_del_preun %{name}.service - -%postun -%service_del_postun %{name}.service - -%pre -%service_add_pre %{name}.service - -%post -%service_add_post %{name}.service -%endif - -%check -make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) - -%files -%license COPYING -%doc README.md -%doc %{_docdir}/%{name}/examples -%{_bindir}/osmo-sip-connector -%dir %{_sysconfdir}/osmocom -%config(noreplace) %{_sysconfdir}/osmocom/osmo-sip-connector.cfg -%{_unitdir}/%{name}.service - -%changelog
View file
osmo-sip-connector_1.6.3.tar.xz/contrib/osmo-sip-connector.spec.in
Deleted
@@ -1,80 +0,0 @@ -# -# spec file for package osmo-sip-connector -# -# Copyright (c) 2016, Martin Hauke <mardnh@gmx.de> -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -Name: osmo-sip-connector -Requires: osmocom-latest -Version: @VERSION@ -Release: 0 -Summary: MNCC to SIP bridge for osmo-nitb -License: AGPL-3.0-or-later AND GPL-2.0-or-later -Group: Productivity/Telephony/Servers -URL: https://osmocom.org/projects/osmo-sip-conector -Source: %{name}-%{version}.tar.xz -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool -BuildRequires: pkgconfig >= 0.20 -%if 0%{?suse_version} -BuildRequires: systemd-rpm-macros -%endif -BuildRequires: pkgconfig(libosmocore) >= 1.9.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.9.0 -BuildRequires: pkgconfig(libosmovty) >= 1.9.0 -BuildRequires: pkgconfig(sofia-sip-ua-glib) >= 1.12.0 -%{?systemd_requires} - -%description -Use the osmo-nitb MNCC interface and bridge it to SIP. - -%prep -%setup -q - -%build -echo "%{version}" >.tarball-version -autoreconf -fi -%configure \ - --docdir="%{_docdir}/%{name}" \ - --with-systemdsystemunitdir=%{_unitdir} -make %{?_smp_mflags} - -%install -%make_install - -%if 0%{?suse_version} -%preun -%service_del_preun %{name}.service - -%postun -%service_del_postun %{name}.service - -%pre -%service_add_pre %{name}.service - -%post -%service_add_post %{name}.service -%endif - -%check -make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) - -%files -%license COPYING -%doc README.md -%doc %{_docdir}/%{name}/examples -%{_bindir}/osmo-sip-connector -%dir %{_sysconfdir}/osmocom -%config(noreplace) %{_sysconfdir}/osmocom/osmo-sip-connector.cfg -%{_unitdir}/%{name}.service - -%changelog
View file
osmo-sip-connector_1.6.3.dsc -> osmo-sip-connector_1.7.0.dsc
Changed
@@ -2,20 +2,20 @@ Source: osmo-sip-connector Binary: osmo-sip-connector, osmo-sip-connector-dbg, osmo-sip-connector-doc Architecture: any all -Version: 1.6.3 +Version: 1.7.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://osmocom.org/projects/osmo-sip-conector/wiki Standards-Version: 3.8.4 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-sip-connector Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-sip-connector -Build-Depends: debhelper (>= 10), autotools-dev, pkg-config, libsofia-sip-ua-glib-dev, libsofia-sip-ua-dev, dh-autoreconf, libosmocore-dev (>= 1.9.0), osmo-gsm-manuals-dev (>= 1.5.0) +Build-Depends: debhelper (>= 10), autotools-dev, pkg-config, libsofia-sip-ua-glib-dev, libsofia-sip-ua-dev, dh-autoreconf, libosmocore-dev (>= 1.10.0), osmo-gsm-manuals-dev (>= 1.6.0) Package-List: osmo-sip-connector deb net optional arch=any osmo-sip-connector-dbg deb debug extra arch=any osmo-sip-connector-doc deb doc optional arch=all Checksums-Sha1: - 53ab00ee1613b2cd73154ab48f46b5312c9e1e3e 68568 osmo-sip-connector_1.6.3.tar.xz + 281ab4707f21012ea6009eb9b9d7c08cc3ca4606 70176 osmo-sip-connector_1.7.0.tar.xz Checksums-Sha256: - 1f64915e4fa1bd607303e6daa6f2fae7587890c756337504282e5cb54f53414c 68568 osmo-sip-connector_1.6.3.tar.xz + 287653c9ddbf8422c3663c8129e4975821afc98895e9c7cfc5251f325e708813 70176 osmo-sip-connector_1.7.0.tar.xz Files: - 42fa797d356d15e538c8eb0e3163bc6d 68568 osmo-sip-connector_1.6.3.tar.xz + 7a72aaad7379f31548b089b7c3f30ad1 70176 osmo-sip-connector_1.7.0.tar.xz
View file
osmo-sip-connector_1.6.3.tar.xz/.tarball-version -> osmo-sip-connector_1.7.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.6.3 +1.7.0
View file
osmo-sip-connector_1.6.3.tar.xz/Makefile.am -> osmo-sip-connector_1.7.0.tar.xz/Makefile.am
Changed
@@ -5,7 +5,7 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = \ .version \ - contrib/osmo-sip-connector.spec.in \ + README.md \ debian \ git-version-gen \ osmoappdesc.py \
View file
osmo-sip-connector_1.6.3.tar.xz/README.md -> osmo-sip-connector_1.7.0.tar.xz/README.md
Changed
@@ -73,7 +73,7 @@ Our coding standards are described at <https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards> -We us a gerrit based patch submission/review process for managing +We use a Gerrit based patch submission/review process for managing contributions. Please see <https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for more details
View file
osmo-sip-connector_1.6.3.tar.xz/TODO-RELEASE -> osmo-sip-connector_1.7.0.tar.xz/TODO-RELEASE
Changed
@@ -1,9 +1,9 @@ # When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install -# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info -# In short: +# according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release +# In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info # LIBVERSION=c:r:a # If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. -# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:a. # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. -#library what description / commit summary line +#library what description / commit summary line
View file
osmo-sip-connector_1.6.3.tar.xz/configure.ac -> osmo-sip-connector_1.7.0.tar.xz/configure.ac
Changed
@@ -24,9 +24,9 @@ m4_ifdef(AM_SILENT_RULES, AM_SILENT_RULES(yes)) AC_PROG_CC -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.10.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.10.0) PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0) AC_ARG_ENABLE(sanitize, @@ -148,7 +148,6 @@ doc/manuals/Makefile contrib/Makefile contrib/systemd/Makefile - contrib/osmo-sip-connector.spec doc/Makefile doc/examples/Makefile Makefile)
View file
osmo-sip-connector_1.6.3.tar.xz/contrib/systemd/osmo-sip-connector.service -> osmo-sip-connector_1.7.0.tar.xz/contrib/systemd/osmo-sip-connector.service
Changed
@@ -8,6 +8,8 @@ Restart=always StateDirectory=osmocom WorkingDirectory=%S/osmocom +User=osmocom +Group=osmocom ExecStart=/usr/bin/osmo-sip-connector -c /etc/osmocom/osmo-sip-connector.cfg RestartSec=2
View file
osmo-sip-connector_1.6.3.tar.xz/debian/changelog -> osmo-sip-connector_1.7.0.tar.xz/debian/changelog
Changed
@@ -1,3 +1,29 @@ +osmo-sip-connector (1.7.0) unstable; urgency=medium + + Neels Hofmeyr + * drop misleading error message + * sdp_get_sdp_mode(): fix wrong return value + * forward SDP between SIP and MNCC + * verbosely log MNCC and SDP + + Andreas Eversberg + * Use uniform log format for default config files + + Vadim Yanitskiy + * build: include README.md into the release tarball + * README.md: cosmetic: fix a typo + + Max + * .deb/.rpm: add osmocom user during package install + + Oliver Smith + * .deb/.rpm: various fixes related to non-root + * contrib: remove rpm spec file + * debian/postinst: add checks, be verbose + * Change-Id: I828fb19a9bba9e71087a69ee1b4206b3eb26f004 + + -- Oliver Smith <osmith@sysmocom.de> Thu, 25 Jul 2024 10:34:23 +0200 + osmo-sip-connector (1.6.3) unstable; urgency=medium arehbein
View file
osmo-sip-connector_1.6.3.tar.xz/debian/control -> osmo-sip-connector_1.7.0.tar.xz/debian/control
Changed
@@ -8,8 +8,8 @@ libsofia-sip-ua-glib-dev, libsofia-sip-ua-dev, dh-autoreconf, - libosmocore-dev (>= 1.9.0), - osmo-gsm-manuals-dev (>= 1.5.0) + libosmocore-dev (>= 1.10.0), + osmo-gsm-manuals-dev (>= 1.6.0) Standards-Version: 3.8.4 Homepage: https://osmocom.org/projects/osmo-sip-conector/wiki Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-sip-connector
View file
osmo-sip-connector_1.7.0.tar.xz/debian/postinst
Added
@@ -0,0 +1,38 @@ +#!/bin/sh -e +case "$1" in + configure) + # Create the osmocom group and user (if it doesn't exist yet) + if ! getent group osmocom >/dev/null; then + groupadd --system osmocom + fi + if ! getent passwd osmocom >/dev/null; then + useradd \ + --system \ + --gid osmocom \ + --home-dir /var/lib/osmocom \ + --shell /sbin/nologin \ + --comment "Open Source Mobile Communications" \ + osmocom + fi + + # Fix permissions of previous (root-owned) install (OS#4107) + if dpkg --compare-versions "$2" le "1.7.0"; then + if -e /etc/osmocom/osmo-sip-connector.cfg ; then + chown -v osmocom:osmocom /etc/osmocom/osmo-sip-connector.cfg + chmod -v 0660 /etc/osmocom/osmo-sip-connector.cfg + fi + + if -d /etc/osmocom ; then + chown -v root:osmocom /etc/osmocom + chmod -v 2775 /etc/osmocom + fi + + mkdir -p /var/lib/osmocom + chown -R -v osmocom:osmocom /var/lib/osmocom + fi + ;; +esac + +# dh_installdeb(1) will replace this with shell code automatically +# generated by other debhelper scripts. +#DEBHELPER#
View file
osmo-sip-connector_1.6.3.tar.xz/doc/examples/osmo-sip-connector.cfg -> osmo-sip-connector_1.7.0.tar.xz/doc/examples/osmo-sip-connector.cfg
Changed
@@ -1,3 +1,11 @@ +log stderr + logging color 1 + logging print category-hex 0 + logging print category 1 + logging timestamp 0 + logging print file basename last + logging print level 1 + app mncc socket-path /tmp/msc_mncc
View file
osmo-sip-connector_1.6.3.tar.xz/src/call.c -> osmo-sip-connector_1.7.0.tar.xz/src/call.c
Changed
@@ -172,3 +172,20 @@ return "Unknown call type"; } } + +void call_leg_rx_sdp(struct call_leg *leg, const char *rx_sdp) +{ + /* If no SDP was received, keep whatever SDP was previously seen. */ + if (!rx_sdp || !*rx_sdp || !strncmp(leg->rx_sdp, rx_sdp, sizeof(leg->rx_sdp))) { + LOGP(DAPP, LOGL_DEBUG, "call(%u) leg(0x%p) no new SDP in %s\n", leg->call->id, leg, + osmo_quote_str(rx_sdp, -1)); + LOGP(DAPP, LOGL_DEBUG, "call(%u) leg(0x%p) keep stored SDP=%s\n", leg->call->id, leg, + osmo_quote_str(leg->rx_sdp, -1)); + return; + } + LOGP(DAPP, LOGL_DEBUG, "call(%u) leg(0x%p) received new SDP=%s\n", leg->call->id, leg, osmo_quote_str(rx_sdp, -1)); + LOGP(DAPP, LOGL_DEBUG, "call(%u) leg(0x%p) replaced old SDP=%s\n", leg->call->id, leg, + osmo_quote_str(leg->rx_sdp, -1)); + OSMO_STRLCPY_ARRAY(leg->rx_sdp, rx_sdp); + leg->rx_sdp_changed = true; +}
View file
osmo-sip-connector_1.6.3.tar.xz/src/call.h -> osmo-sip-connector_1.7.0.tar.xz/src/call.h
Changed
@@ -62,7 +62,11 @@ /* SDP as received for this call leg. If this is an MNCC call leg, contains the SDP most recently received in an * MNCC message; if this is a SIP call leg, contains the SDP most recently received in a SIP message. If no SDP * was received yet, this string is empty. Otherwise a nul terminated string. */ - char sdp1024; + char rx_sdp1024; + /* If the contents of rx_sdp changes, set rx_sdp_changed = true. When the other call leg transmits the next + * message, it can decide whether to include SDP because there is new information, or whether to omit SDP + * because it was already sent identically earlier. */ + bool rx_sdp_changed; /** * Remote started to ring/alert @@ -167,6 +171,8 @@ struct call_leg *call_leg_other(struct call_leg *leg); +void call_leg_rx_sdp(struct call_leg *cl, const char *rx_sdp); + void call_leg_release(struct call_leg *leg);
View file
osmo-sip-connector_1.6.3.tar.xz/src/mncc.c -> osmo-sip-connector_1.7.0.tar.xz/src/mncc.c
Changed
@@ -134,12 +134,14 @@ { int rc; + LOGP(DMNCC, LOGL_DEBUG, "tx MNCC %s with SDP=%s\n", osmo_mncc_name(mncc->msg_type), + osmo_quote_str(mncc->sdp, -1)); + /* * TODO: we need to put cause in here for release or such? shall we return a * static struct? */ rc = write(conn->fd.fd, mncc, sizeof(*mncc)); - LOGP(DMNCC, LOGL_DEBUG, "MNCC sent message type: %s\n", osmo_mncc_name(mncc->msg_type)); if (rc != sizeof(*mncc)) { LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u)\n", mncc->callref); close_connection(conn); @@ -160,8 +162,10 @@ { int rc; + LOGP(DMNCC, LOGL_DEBUG, "tx MNCC %s with SDP=%s\n", osmo_mncc_name(rtp->msg_type), + osmo_quote_str(rtp->sdp, -1)); + rc = write(conn->fd.fd, rtp, sizeof(*rtp)); - LOGP(DMNCC, LOGL_DEBUG, "MNCC sent message type: %s\n", osmo_mncc_name(rtp->msg_type)); if (rc != sizeof(*rtp)) { LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u): %d\n", rtp->callref, rc); close_connection(conn); @@ -170,12 +174,14 @@ return rc; } -static int mncc_rtp_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref) +static int mncc_rtp_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref, const char *sdp) { struct gsm_mncc_rtp mncc = { 0, }; mncc.msg_type = msg_type; mncc.callref = callref; + if (sdp) + OSMO_STRLCPY_ARRAY(mncc.sdp, sdp); return mncc_rtp_write(conn, &mncc); } @@ -195,6 +201,10 @@ mncc.callref = leg->callref; mncc.addr = other->addr; mncc.payload_type = other->payload_type; + + /* Forward whichever SDP was last received on the other call leg */ + OSMO_STRLCPY_ARRAY(mncc.sdp, other->rx_sdp); + /* * FIXME: mncc.payload_msg_type should already be compatible.. but * payload_type should be different.. @@ -408,6 +418,8 @@ return; } + call_leg_rx_sdp(&leg->base, rtp->sdp); + /* extract information about where the RTP is */ if (rtp->addr.ss_family != AF_UNSPEC || osmo_sockaddr_port((const struct sockaddr *)&rtp->addr) != 0 || @@ -446,6 +458,7 @@ leg->base.addr = rtp->addr; leg->base.payload_type = rtp->payload_type; leg->base.payload_msg_type = rtp->payload_msg_type; + call_leg_rx_sdp(&leg->base, rtp->sdp); /* TODO.. now we can continue with the call */ LOGP(DMNCC, LOGL_INFO, @@ -485,6 +498,8 @@ const struct gsm_mncc_number *called; struct call *call; struct mncc_call_leg *leg; + struct call_leg *other_leg; + const char *sdp = NULL; struct osmo_gcr_parsed gcr; if (rc < sizeof(*data)) { @@ -557,6 +572,7 @@ memcpy(&leg->called, called, sizeof(leg->called)); memcpy(&leg->calling, &data->calling, sizeof(leg->calling)); memcpy(&leg->imsi, data->imsi, sizeof(leg->imsi)); + call_leg_rx_sdp(&leg->base, data->sdp); if (data->fields & MNCC_F_GCR) { leg->base.call->gcr_present = true; @@ -567,8 +583,14 @@ "Created call(%u) with MNCC leg(%u) IMSI(%.16s)\n", call->id, leg->callref, data->imsi); + other_leg = call_leg_other(&leg->base); + if (other_leg && *other_leg->rx_sdp && other_leg->rx_sdp_changed) { + sdp = other_leg->rx_sdp; + other_leg->rx_sdp_changed = false; + } + start_cmd_timer(leg, MNCC_RTP_CREATE); - mncc_rtp_send(conn, MNCC_RTP_CREATE, data->callref); + mncc_rtp_send(conn, MNCC_RTP_CREATE, data->callref, sdp); } /*! Find MNCC Call leg by given MNCC message @@ -672,6 +694,8 @@ if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + LOGP(DMNCC, LOGL_INFO, "leg(%u) is now connected.\n", leg->callref); stop_cmd_timer(leg, MNCC_SETUP_COMPL_IND); leg->state = MNCC_CC_CONNECTED; @@ -701,17 +725,28 @@ { const struct gsm_mncc *data; struct mncc_call_leg *leg; + struct call_leg *other_leg; + const char *sdp = NULL; leg = find_leg(conn, buf, rc, &data); if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + + /* Forward SDP received from the other side */ + other_leg = call_leg_other(&leg->base); + if (other_leg && *other_leg->rx_sdp && other_leg->rx_sdp_changed) { + sdp = other_leg->rx_sdp; + other_leg->rx_sdp_changed = false; + } + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) confirmed. creating RTP socket.\n", leg->callref); start_cmd_timer(leg, MNCC_RTP_CREATE); - mncc_rtp_send(conn, MNCC_RTP_CREATE, data->callref); + mncc_rtp_send(conn, MNCC_RTP_CREATE, data->callref, sdp); } static void check_alrt_ind(struct mncc_connection *conn, const char *buf, int rc) @@ -724,6 +759,8 @@ if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) is alerting.\n", leg->callref); @@ -802,6 +839,8 @@ if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) setup completed\n", leg->callref); other_leg = call_leg_other(&leg->base); @@ -831,6 +870,8 @@ if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) DTMF key=%c\n", leg->callref, data->keypad); other_leg = call_leg_other(&leg->base); @@ -853,6 +894,8 @@ if (!leg) return; + call_leg_rx_sdp(&leg->base, data->sdp); + LOGP(DMNCC, LOGL_DEBUG, "leg(%u) DTMF key=%c\n", leg->callref, data->keypad); mncc_fill_header(&out_mncc, MNCC_STOP_DTMF_RSP, leg->callref); @@ -945,11 +988,17 @@ msgb_free(msg); } + /* The call->initial leg is a SIP call leg that starts an MT call. There was SDP received in the SIP INVITE that + * started this call. This here will be the call->remote, always forwarding the SDP that came in on + * call->initial. */ + if (call->initial && call->initial->rx_sdp_changed) { + OSMO_STRLCPY_ARRAY(mncc.sdp, call->initial->rx_sdp); + call->initial->rx_sdp_changed = false; + } + /* * TODO/FIXME: - * - Determine/request channel based on offered audio codecs * - Screening, redirect? - * - Synth. the bearer caps based on codecs? */ rc = mncc_write(conn, &mncc); if (rc != sizeof(mncc)) {
View file
osmo-sip-connector_1.6.3.tar.xz/src/sdp.c -> osmo-sip-connector_1.7.0.tar.xz/src/sdp.c
Changed
@@ -65,7 +65,7 @@ if (!sdp->sdp_media || !sdp->sdp_media->m_mode) { sdp_parser_free(parser); - return sdp_sendrecv; + return false; } *mode = sdp->sdp_media->m_mode; @@ -124,6 +124,7 @@ } sdp_parser_free(parser); + /* FIXME: osmo-sip-connector should not interfere in codecs at all */ return false; success: @@ -131,6 +132,9 @@ return true; } +/* Extract RTP address, port and payload type from SDP received in SIP message, in order to populate the legacy MNCC + * fields, for backwards compatibility. osmo-sip-connector now always sends the entire SDP info unchanged via MNCC, + * which obsoletes the legacy fields. But for backwards compatibility, still populate the legacy fields. */ bool sdp_extract_sdp(struct sip_call_leg *leg, const sip_t *sip, bool any_codec) { sdp_connection_t *conn; @@ -191,7 +195,9 @@ continue; for (map = media->m_rtpmaps; map; map = map->rm_next) { - if (!any_codec && strcasecmp(map->rm_encoding, leg->wanted_codec) != 0) + if (!any_codec + && leg->wanted_codec + && strcasecmp(map->rm_encoding, leg->wanted_codec) != 0) continue; port = media->m_port; @@ -208,6 +214,7 @@ LOGP(DSIP, LOGL_ERROR, "leg(%p) did not find %d/%d\n", leg, found_conn, found_map); sdp_parser_free(parser); + /* FIXME: osmo-sip-connector should not interfere in codecs at all */ return false; } @@ -226,21 +233,43 @@ return true; } +/* One leg has sent a SIP or MNCC message, which is now translated/forwarded to the counterpart MNCC or SIP. + * Take as much from the source's SDP as possible, but make sure the connection mode reflects the 'mode' arg (sendrecv, + * recvonly, sendonly, inactive). + * For example, if the MSC sent an MNCC_SETUP_IND, the SDP from the MNCC is found in 'other', while 'leg' reflects the + * SIP side that should receive this SDP in the SIP Invite that is being composed by the caller of this function. + * \param leg The target for which the returned SDP is intended. + * \param other The source of which we are to reflect the SDP. + * \return SDP string, using 'leg' as talloc ctx. + */ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other, sdp_mode_t mode) { - char *fmtp_str = NULL, *sdp; - char *mode_attribute; - char ip_addrINET6_ADDRSTRLEN; - char ipv; - - osmo_sockaddr_ntop((const struct sockaddr*)&other->addr, ip_addr); - ipv = other->addr.ss_family == AF_INET6 ? '6' : '4'; - leg->wanted_codec = app_media_name(other->payload_msg_type); - - if (strcmp(leg->wanted_codec, "AMR") == 0) - fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); + sdp_parser_t *parser; + sdp_session_t *sdp; + sdp_media_t *media; + const char *sdp_data; + sdp_printer_t *printer; + char buf1024; + const char *sdp_str; + char *ret; + + sdp_data = other->rx_sdp; + + if (!*sdp_data) { + /* Legacy compat: We have not received any SDP from the other call leg. Compose some original SDP from + * the RTP information we have. */ + char *fmtp_str = NULL; + char *mode_attribute; + char ip_addrINET6_ADDRSTRLEN; + char ipv; + + osmo_sockaddr_ntop((const struct sockaddr *)&other->addr, ip_addr); + ipv = other->addr.ss_family == AF_INET6 ? '6' : '4'; + leg->wanted_codec = app_media_name(other->payload_msg_type); + if (strcmp(leg->wanted_codec, "AMR") == 0) + fmtp_str = talloc_asprintf(leg, "a=fmtp:%d octet-align=1\r\n", other->payload_type); - switch (mode) { + switch (mode) { case sdp_inactive: mode_attribute = "a=inactive\r\n"; break; @@ -256,25 +285,67 @@ default: OSMO_ASSERT(false); break; + } + + return talloc_asprintf(leg, + "v=0\r\n" + "o=Osmocom 0 0 IN IP%c %s\r\n" + "s=GSM Call\r\n" + "c=IN IP%c %s\r\n" + "t=0 0\r\n" + "m=audio %d RTP/AVP %d\r\n" + "%s" + "a=rtpmap:%d %s/8000\r\n" + "%s", + ipv, ip_addr, ipv, ip_addr, + osmo_sockaddr_port((const struct sockaddr *)&other->addr), + other->payload_type, + fmtp_str ? fmtp_str : "", + other->payload_type, + leg->wanted_codec, + mode_attribute); + } + + /* We have received SDP from the other call leg. Forward this as-is, only apply the mode the caller requests: + * parse SDP, set media mode, recompose. */ + /* TODO: currently, we often detect the media mode from parsing SDP, and then forward the same SDP, applying the + * same mode to it below. It may make sense to completely skip parsing and composition: the mode is usually + * already in the received SDP. + * However, there are some invocations of this function (sdp_create_file()) with hardcoded modes. Take a look if + * that is really necessary, and if not, just drop below parsing + recomposition and use the sdp_data as is. + */ + parser = sdp_parse(NULL, sdp_data, strlen(sdp_data), 0); + if (!parser) { + LOGP(DSIP, LOGL_ERROR, "leg(%p) failed to parse SDP\n", other); + return talloc_strdup(leg, sdp_data); + } + + sdp = sdp_session(parser); + if (!sdp) { + LOGP(DSIP, LOGL_INFO, "leg(%p) no SDP session in %s, returning SDP unchanged\n", other, osmo_quote_str(sdp_data, -1)); + sdp_parser_free(parser); + return talloc_strdup(leg, sdp_data); + } + + for (media = sdp->sdp_media; media; media = media->m_next) + media->m_mode = mode; + + printer = sdp_print(NULL, sdp, buf, sizeof(buf), sdp_f_mode_always); + if (!printer) { + LOGP(DSIP, LOGL_ERROR, "leg(%p) failed to print SDP\n", other); + sdp_parser_free(parser); + return talloc_strdup(leg, sdp_data); + } + + sdp_str = sdp_message(printer); + if (!sdp_str) { + LOGP(DSIP, LOGL_ERROR, "leg(%p) failed to print SDP: %s\n", other, sdp_printing_error(printer)); + sdp_str = sdp_data; } - sdp = talloc_asprintf(leg, - "v=0\r\n" - "o=Osmocom 0 0 IN IP%c %s\r\n" - "s=GSM Call\r\n" - "c=IN IP%c %s\r\n" - "t=0 0\r\n" - "m=audio %d RTP/AVP %d\r\n" - "%s" - "a=rtpmap:%d %s/8000\r\n" - "%s", - ipv, ip_addr, ipv, ip_addr, - osmo_sockaddr_port((const struct sockaddr *)&other->addr), - other->payload_type, - fmtp_str ? fmtp_str : "", - other->payload_type, - leg->wanted_codec, - mode_attribute); - talloc_free(fmtp_str); - return sdp; + ret = talloc_strdup(leg, sdp_str); + + sdp_parser_free(parser); + sdp_printer_free(printer); + return ret; }
View file
osmo-sip-connector_1.6.3.tar.xz/src/sdp.h -> osmo-sip-connector_1.7.0.tar.xz/src/sdp.h
Changed
@@ -11,5 +11,4 @@ bool sdp_get_sdp_mode(const sip_t *sip, sdp_mode_t *mode); bool sdp_screen_sdp(const sip_t *sip); bool sdp_extract_sdp(struct sip_call_leg *leg, const sip_t *sip, bool any_codec); - -char *sdp_create_file(struct sip_call_leg *, struct call_leg *, sdp_mode_t mode); +char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other, sdp_mode_t mode);
View file
osmo-sip-connector_1.6.3.tar.xz/src/sip.c -> osmo-sip-connector_1.7.0.tar.xz/src/sip.c
Changed
@@ -46,6 +46,12 @@ static void sip_hold_call(struct call_leg *_leg); static void sip_retrieve_call(struct call_leg *_leg); +static const char *sip_get_sdp(const sip_t *sip) +{ + if (!sip || !sip->sip_payload) + return NULL; + return sip->sip_payload->pl_data; +} /* Find a SIP Call leg by given nua_handle */ static struct sip_call_leg *sip_find_leg(nua_handle_t *nh) @@ -137,12 +143,7 @@ } call = call_sip_create(); - if (!call) { - LOGP(DSIP, LOGL_ERROR, "No supported codec.\n"); - nua_respond(nh, SIP_500_INTERNAL_SERVER_ERROR, TAG_END()); - nua_handle_destroy(nh); - return; - } + OSMO_ASSERT(call); /* Decode Decode the Global Call Reference (if present) */ if (xgcr_hdr_present) { @@ -201,6 +202,8 @@ nua_handle_bind(nh, leg); leg->sdp_payload = talloc_strdup(leg, sip->sip_payload->pl_data); + call_leg_rx_sdp(&leg->base, sip_get_sdp(sip)); + app_route_call(call, talloc_strdup(leg, from), talloc_strdup(leg, to)); @@ -241,6 +244,8 @@ osmo_sockaddr_ntop((struct sockaddr*)&prev_addr, ip_addr), osmo_sockaddr_port((struct sockaddr*)&prev_addr)); + call_leg_rx_sdp(&leg->base, sip_get_sdp(sip)); + if (mode == sdp_sendonly) { /* SIP side places call on HOLD */ sdp = sdp_create_file(leg, other, sdp_recvonly); @@ -353,13 +358,15 @@ void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags) { - LOGP(DSIP, LOGL_DEBUG, "SIP event%s status(%d) phrase(%s) %p\n", - nua_event_name(event), status, phrase, hmagic); + LOGP(DSIP, LOGL_DEBUG, "SIP event%s status(%d) phrase(%s) SDP(%s) %p\n", + nua_event_name(event), status, phrase, sip_get_sdp(sip), hmagic); if (event == nua_r_invite) { struct sip_call_leg *leg; leg = (struct sip_call_leg *) hmagic; + call_leg_rx_sdp(&leg->base, sip_get_sdp(sip)); + /* MT call is moving forward */ /* The dialogue is now confirmed */ @@ -401,8 +408,10 @@ * respond to the re-INVITE query. */ if (sip->sip_payload && sip->sip_payload->pl_data) { struct sip_call_leg *leg = sip_find_leg(nh); - if (leg) + if (leg) { + call_leg_rx_sdp(&leg->base, sip_get_sdp(sip)); sip_handle_reinvite(leg, nh, sip); + } } } else if (event == nua_r_bye || event == nua_r_cancel) { /* our bye or hang up is answered */ @@ -428,10 +437,12 @@ if (status == 100) { struct sip_call_leg *leg = sip_find_leg(nh); - if (leg) + if (leg) { + call_leg_rx_sdp(&leg->base, sip_get_sdp(sip)); sip_handle_reinvite(leg, nh, sip); - else + } else { new_call((struct sip_agent *) magic, nh, sip); + } } } else if (event == nua_i_cancel) { struct sip_call_leg *leg; @@ -526,6 +537,7 @@ OSMO_ASSERT(_leg->type == CALL_TYPE_SIP); leg = (struct sip_call_leg *) _leg; + /* 180 Ringing should not contain any SDP. */ nua_respond(leg->nua_handle, SIP_180_RINGING, TAG_END()); }
View file
rpmlintrc
Deleted
@@ -1,5 +0,0 @@ -# Don't abort the build when finding a library that depends on a package with -# a specific version. This is intentional for nightly builds, we don't want -# libraries from different build dates to be mixed as they might have ABI -# incompatibilities. -setBadness('shlib-fixed-dependency', 0)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.