diff --git a/include/osmocom/mgcp/mgcp_network.h b/include/osmocom/mgcp/mgcp_network.h index b9cf5e3b4..e3fa3b11b 100644 --- a/include/osmocom/mgcp/mgcp_network.h +++ b/include/osmocom/mgcp/mgcp_network.h @@ -110,8 +110,8 @@ struct mgcp_rtp_end { uint32_t packet_duration_ms; int maximum_packet_time; /* -1: not set */ char *fmtp_extra; - /* are we transmitting packets (1) or dropping (0) outbound packets */ - int output_enabled; + /* are we transmitting packets (true) or dropping (false) outbound packets */ + bool output_enabled; /* FIXME: This parameter can be set + printed, but is nowhere used! */ int force_output_ptime; diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index 5c3c60e85..9c2fb0faa 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -108,7 +108,7 @@ static int mgcp_rtp_conn_init(struct mgcp_conn_rtp *conn_rtp, struct mgcp_conn * /* Set default values */ end->frames_per_packet = 0; /* unknown */ end->packet_duration_ms = DEFAULT_RTP_AUDIO_PACKET_DURATION_MS; - end->output_enabled = 0; + end->output_enabled = false; end->maximum_packet_time = -1; conn_rtp->rate_ctr_group = rate_ctr_group_alloc(conn, &rate_ctr_group_desc, rate_ctr_index++); diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index f36fa7178..4581b7631 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -110,8 +110,7 @@ int mgcp_parse_conn_mode(const char *mode, struct mgcp_endpoint *endp, /* Special handling for RTP connections */ if (conn->type == MGCP_CONN_TYPE_RTP) { - conn->u.rtp.end.output_enabled = - conn->mode & MGCP_CONN_SEND_ONLY ? 1 : 0; + conn->u.rtp.end.output_enabled = !!(conn->mode & MGCP_CONN_SEND_ONLY); } LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "conn:%s\n", mgcp_conn_dump(conn)); @@ -121,7 +120,7 @@ int mgcp_parse_conn_mode(const char *mode, struct mgcp_endpoint *endp, /* Special handling für RTP connections */ if (conn->type == MGCP_CONN_TYPE_RTP) { - LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "output_enabled %d\n", + LOGPCONN(conn, DLMGCP, LOGL_DEBUG, "output_enabled %u\n", conn->u.rtp.end.output_enabled); } diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index a8aad1400..9b4933c55 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -868,7 +868,7 @@ static void test_messages(void) printf("Connection mode not set\n"); OSMO_ASSERT(conn->end.output_enabled - == (conn->conn->mode & MGCP_CONN_SEND_ONLY ? 1 : 0)); + == !!(conn->conn->mode & MGCP_CONN_SEND_ONLY)); conn->conn->mode |= CONN_UNMODIFIED;