pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/39216?usp=email )


Change subject: mgw: Cleanup rtp_endp fields in its own function
......................................................................

mgw: Cleanup rtp_endp fields in its own function

Change-Id: I0b2ccb94129dc7aed6fe13bb20f9910a53d8a41e
---
M include/osmocom/mgcp/mgcp_rtp_end.h
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_rtp_end.c
3 files changed, 11 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/16/39216/1

diff --git a/include/osmocom/mgcp/mgcp_rtp_end.h 
b/include/osmocom/mgcp/mgcp_rtp_end.h
index 69208e5..c08f00d 100644
--- a/include/osmocom/mgcp/mgcp_rtp_end.h
+++ b/include/osmocom/mgcp/mgcp_rtp_end.h
@@ -46,5 +46,6 @@
 };

 void mgcp_rtp_end_init(struct mgcp_rtp_end *end);
+void mgcp_rtp_end_cleanup(struct mgcp_rtp_end *end);
 bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end);
 void mgcp_rtp_end_free_port(struct mgcp_rtp_end *end);
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 68b6b39..088d3e3 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -113,10 +113,6 @@
        conn_rtp->state.out_stream.err_ts_ctr = 
rate_ctr_group_get_ctr(conn_rtp->ctrg, OUT_STREAM_ERR_TSTMP_CTR);

        mgcp_rtp_end_init(&conn_rtp->end);
-
-       /* Make sure codec table is reset */
-       mgcp_codecset_reset(&conn_rtp->end.cset);
-
        return 0;
 }

@@ -127,9 +123,8 @@
                conn_osmux_disable(conn_rtp);
        if (mgcp_conn_rtp_is_iuup(conn_rtp))
                mgcp_conn_iuup_cleanup(conn_rtp);
-       mgcp_rtp_end_free_port(&conn_rtp->end);
+       mgcp_rtp_end_cleanup(&conn_rtp->end);
        rate_ctr_group_free(conn_rtp->ctrg);
-       mgcp_codecset_reset(&conn_rtp->end.cset);
 }

 void mgcp_conn_watchdog_cb(void *data)
diff --git a/src/libosmo-mgcp/mgcp_rtp_end.c b/src/libosmo-mgcp/mgcp_rtp_end.c
index 422c199..e48eaeb 100644
--- a/src/libosmo-mgcp/mgcp_rtp_end.c
+++ b/src/libosmo-mgcp/mgcp_rtp_end.c
@@ -47,6 +47,15 @@
        end->packet_duration_ms = DEFAULT_RTP_AUDIO_PACKET_DURATION_MS;
        end->output_enabled = false;
        end->maximum_packet_time = -1;
+
+       /* Make sure codec table is reset */
+       mgcp_codecset_reset(&end->cset);
+}
+
+void mgcp_rtp_end_cleanup(struct mgcp_rtp_end *end)
+{
+       mgcp_rtp_end_free_port(end);
+       mgcp_codecset_reset(&end->cset);
 }

 bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end)

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39216?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I0b2ccb94129dc7aed6fe13bb20f9910a53d8a41e
Gerrit-Change-Number: 39216
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to