summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--configure.ac8
-rwxr-xr-xcontrib/jenkins.sh5
-rw-r--r--contrib/osmo-sip-connector.spec.in6
-rw-r--r--debian/changelog29
-rw-r--r--debian/control2
-rw-r--r--src/mncc.c60
7 files changed, 79 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index c73387f..e69f3c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ Makefile
.deps
*.sw?
.version
+*~
aclocal.m4
autom4te.cache
diff --git a/configure.ac b/configure.ac
index 39d10f1..de19d88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,13 +18,15 @@ dnl include release helper
RELMAKE='-include osmo-release.mk'
AC_SUBST([RELMAKE])
+CFLAGS="$CFLAGS -std=gnu11"
+
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_PROG_CC
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.0.0)
-PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.0.0)
-PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.0.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.5.0)
+PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.5.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.5.0)
PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)
AC_ARG_ENABLE(sanitize,
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 6d9a9d9..90234e7 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -28,7 +28,6 @@ export PATH="$inst/bin:$PATH"
# Additional configure options and depends
CONFIG=""
if [ "$WITH_MANUALS" = "1" ]; then
- osmo-build-dep.sh osmo-gsm-manuals
CONFIG="--enable-manuals"
fi
@@ -45,12 +44,12 @@ autoreconf --install --force
$MAKE $PARALLEL_MAKE
$MAKE check \
|| cat-testlogs.sh
-DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE distcheck \
+DISTCHECK_CONFIGURE_FLAGS="$CONFIG" $MAKE $PARALLEL_MAKE distcheck \
|| cat-testlogs.sh
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
make -C "$base/doc/manuals" publish
fi
-$MAKE maintainer-clean
+$MAKE $PARALLEL_MAKE maintainer-clean
osmo-clean-workspace.sh
diff --git a/contrib/osmo-sip-connector.spec.in b/contrib/osmo-sip-connector.spec.in
index 4361daa..29baf9b 100644
--- a/contrib/osmo-sip-connector.spec.in
+++ b/contrib/osmo-sip-connector.spec.in
@@ -27,9 +27,9 @@ BuildRequires: pkgconfig >= 0.20
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
%endif
-BuildRequires: pkgconfig(libosmocore) >= 1.0.0
-BuildRequires: pkgconfig(libosmogsm) >= 1.0.0
-BuildRequires: pkgconfig(libosmovty) >= 1.0.0
+BuildRequires: pkgconfig(libosmocore) >= 1.5.0
+BuildRequires: pkgconfig(libosmogsm) >= 1.5.0
+BuildRequires: pkgconfig(libosmovty) >= 1.5.0
BuildRequires: pkgconfig(sofia-sip-ua-glib) >= 1.12.0
%{?systemd_requires}
diff --git a/debian/changelog b/debian/changelog
index c983128..e147a38 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,32 @@
+osmo-sip-connector (1.5.0) unstable; urgency=medium
+
+ [ Vadim Yanitskiy ]
+ * debian/control: change maintainer to the Osmocom team / mailing list
+
+ [ Matt Johnson ]
+ * sip: Specify invite contact tag
+
+ [ Alexander Couzens ]
+ * Revert "sip: Specify invite contact tag"
+ * mncc: remove callref argument from mncc_write()
+ * mncc: add return code for write/send function
+ * mncc: Introduce mncc_rtp_write similiar to mncc_write
+ * mncc: mncc_create_remote_leg: use mncc_write instead of write direct to the fd
+
+ [ Pau Espin Pedrol ]
+ * mncc: Support IPv6 addresses (new version mncc 7)
+ * sdp: Don't select addresses failing to parse
+ * contrib/jenkins: Enable parallel make in make distcheck
+ * mncc: Log write error code
+ * .gitignore: Get rid of new autofoo tmp files
+ * mncc: Fix write len
+
+ [ Oliver Smith ]
+ * contrib/jenkins: don't build osmo-gsm-manuals
+ * configure.ac: set -std=gnu11
+
+ -- Pau Espin Pedrol <pespin@espeweb.net> Tue, 23 Feb 2021 13:42:08 +0100
+
osmo-sip-connector (1.4.1) unstable; urgency=medium
[ Oliver Smith ]
diff --git a/debian/control b/debian/control
index 4692ea5..0de3953 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 7.0.0~),
libsofia-sip-ua-dev,
dh-systemd (>= 1.5),
dh-autoreconf,
- libosmocore-dev (>= 1.0.0),
+ libosmocore-dev (>= 1.5.0),
osmo-gsm-manuals-dev
Standards-Version: 3.8.4
Homepage: https://osmocom.org/projects/osmo-sip-conector/wiki
diff --git a/src/mncc.c b/src/mncc.c
index 0725d4c..9d75950 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -130,7 +130,7 @@ static void mncc_fill_header(struct gsm_mncc *mncc, uint32_t msg_type, uint32_t
}
}
-static void mncc_write(struct mncc_connection *conn, struct gsm_mncc *mncc, uint32_t callref)
+static int mncc_write(struct mncc_connection *conn, struct gsm_mncc *mncc)
{
int rc;
@@ -141,32 +141,43 @@ static void mncc_write(struct mncc_connection *conn, struct gsm_mncc *mncc, uint
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", callref);
+ LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u)\n", mncc->callref);
close_connection(conn);
}
+
+ return rc;
}
-static void mncc_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref)
+static int mncc_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref)
{
struct gsm_mncc mncc = { 0, };
mncc_fill_header(&mncc, msg_type, callref);
- mncc_write(conn, &mncc, callref);
+ return mncc_write(conn, &mncc);
}
-static void mncc_rtp_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref)
+static int mncc_rtp_write(struct mncc_connection *conn, struct gsm_mncc_rtp *rtp)
{
int rc;
+
+ 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);
+ }
+
+ return rc;
+}
+
+static int mncc_rtp_send(struct mncc_connection *conn, uint32_t msg_type, uint32_t callref)
+{
struct gsm_mncc_rtp mncc = { 0, };
mncc.msg_type = msg_type;
mncc.callref = callref;
- rc = write(conn->fd.fd, &mncc, sizeof(mncc));
- if (rc != sizeof(mncc)) {
- LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u)\n", callref);
- close_connection(conn);
- }
+ return mncc_rtp_write(conn, &mncc);
}
/* Send a MNCC_RTP_CONNECT to the MSC for the given call legs */
@@ -191,7 +202,7 @@ static bool send_rtp_connect(struct mncc_call_leg *leg, struct call_leg *other)
LOGP(DMNCC, LOGL_DEBUG, "SEND rtp_connect: IP=(%s) PORT=(%u)\n",
osmo_sockaddr_ntop((const struct sockaddr*)&other->addr, ip_addr),
osmo_sockaddr_port((const struct sockaddr*)&other->addr));
- rc = write(leg->conn->fd.fd, &mncc, sizeof(mncc));
+ rc = mncc_rtp_write(leg->conn, &mncc);
if (rc != sizeof(mncc)) {
LOGP(DMNCC, LOGL_ERROR, "Failed to send message for call(%u)\n",
leg->callref);
@@ -264,7 +275,7 @@ static void mncc_call_leg_ring(struct call_leg *_leg)
out_mncc.progress.location = GSM48_CAUSE_LOC_PRN_S_LU; /* Private network serving the local user */
out_mncc.progress.descr = GSM48_PROGR_IN_BAND_AVAIL; /* In-band information or appropriate pattern now available */
- mncc_write(leg->conn, &out_mncc, leg->callref);
+ mncc_write(leg->conn, &out_mncc);
/*
* If we have remote IP/port let's connect it already.
@@ -393,7 +404,8 @@ static void check_rtp_connect(struct mncc_connection *conn, const char *buf, int
leg = mncc_find_leg_not_released(rtp->callref);
if (!leg) {
LOGP(DMNCC, LOGL_ERROR, "leg(%u) can not be found\n", rtp->callref);
- return mncc_send(conn, MNCC_REJ_REQ, rtp->callref);
+ mncc_send(conn, MNCC_REJ_REQ, rtp->callref);
+ return;
}
/* extract information about where the RTP is */
@@ -426,7 +438,8 @@ static void check_rtp_create(struct mncc_connection *conn, const char *buf, int
leg = mncc_find_leg_not_released(rtp->callref);
if (!leg) {
LOGP(DMNCC, LOGL_ERROR, "call(%u) can not be found\n", rtp->callref);
- return mncc_send(conn, MNCC_REJ_REQ, rtp->callref);
+ mncc_send(conn, MNCC_REJ_REQ, rtp->callref);
+ return;
}
/* extract information about where the RTP is */
@@ -488,7 +501,8 @@ static void check_setup(struct mncc_connection *conn, const char *buf, int rc)
LOGP(DMNCC, LOGL_ERROR,
"MNCC leg(%u) without called addr fields(%u)\n",
data->callref, data->fields);
- return mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ return;
}
/* Emergency without a called number present. Use the standard "emergency" number. */
@@ -499,14 +513,16 @@ static void check_setup(struct mncc_connection *conn, const char *buf, int rc)
LOGP(DMNCC, LOGL_ERROR,
"MNCC leg(%u) without calling addr fields(%u)\n",
data->callref, data->fields);
- return mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ return;
}
/* TODO.. bearer caps and better audio handling */
if (!continue_setup(conn, data)) {
LOGP(DMNCC, LOGL_ERROR,
"MNCC screening parameters failed leg(%u)\n", data->callref);
- return mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ return;
}
/* Create an RTP port and then allocate a call */
@@ -514,7 +530,8 @@ static void check_setup(struct mncc_connection *conn, const char *buf, int rc)
if (!call) {
LOGP(DMNCC, LOGL_ERROR,
"MNCC leg(%u) failed to allocate call\n", data->callref);
- return mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ mncc_send(conn, MNCC_REJ_REQ, data->callref);
+ return;
}
leg = (struct mncc_call_leg *) call->initial;
@@ -807,7 +824,7 @@ static void check_dtmf_start(struct mncc_connection *conn, const char *buf, int
mncc_fill_header(&out_mncc, MNCC_START_DTMF_RSP, leg->callref);
out_mncc.fields |= MNCC_F_KEYPAD;
out_mncc.keypad = data->keypad;
- mncc_write(conn, &out_mncc, leg->callref);
+ mncc_write(conn, &out_mncc);
}
static void check_dtmf_stop(struct mncc_connection *conn, const char *buf, int rc)
@@ -825,7 +842,7 @@ static void check_dtmf_stop(struct mncc_connection *conn, const char *buf, int r
mncc_fill_header(&out_mncc, MNCC_STOP_DTMF_RSP, leg->callref);
out_mncc.fields |= MNCC_F_KEYPAD;
out_mncc.keypad = data->keypad;
- mncc_write(conn, &out_mncc, leg->callref);
+ mncc_write(conn, &out_mncc);
}
static void check_hello(struct mncc_connection *conn, const char *buf, int rc)
@@ -905,11 +922,10 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call)
* - Screening, redirect?
* - Synth. the bearer caps based on codecs?
*/
- rc = write(conn->fd.fd, &mncc, sizeof(mncc));
+ rc = mncc_write(conn, &mncc);
if (rc != sizeof(mncc)) {
LOGP(DMNCC, LOGL_ERROR, "Failed to send message leg(%u)\n",
leg->callref);
- close_connection(conn);
talloc_free(leg);
return -1;
}