mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					7d236cca56 | ||
| 
						 | 
					2fdedc0715 | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -9,6 +9,7 @@ Makefile.in
 | 
			
		||||
bscconfig.h
 | 
			
		||||
bscconfig.h.in
 | 
			
		||||
include/osmocom/mgcp_client/mgcp_common.h
 | 
			
		||||
include/osmocom/mgcp_client/version.h
 | 
			
		||||
src/osmo-mgw/osmo-mgw
 | 
			
		||||
*.*~
 | 
			
		||||
*.sw?
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
BUILT_SOURCES = \
 | 
			
		||||
	mgcp_common.h \
 | 
			
		||||
	version.h \
 | 
			
		||||
	$(NULL)
 | 
			
		||||
 | 
			
		||||
noinst_HEADERS = \
 | 
			
		||||
@@ -11,4 +12,20 @@ mgcp_common.h: $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h
 | 
			
		||||
	echo -e "/*\n\n   DO NOT EDIT THIS FILE!\n   THIS IS OVERWRITTEN DURING BUILD\n   This is an automatic copy of <osmocom/mgcp/mgcp_common.h>\n\n */" > mgcp_common.h
 | 
			
		||||
	cat $(top_srcdir)/include/osmocom/mgcp/mgcp_common.h >> mgcp_common.h
 | 
			
		||||
 | 
			
		||||
CLEANFILES = mgcp_common.h
 | 
			
		||||
version.h: version.h.tpl
 | 
			
		||||
	$(AM_V_GEN)$(MKDIR_P) $(dir $@)
 | 
			
		||||
	$(AM_V_GEN)sed \
 | 
			
		||||
		-e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \
 | 
			
		||||
		-e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \
 | 
			
		||||
		-e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \
 | 
			
		||||
		-e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \
 | 
			
		||||
		$< > $@
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = \
 | 
			
		||||
	     version.h.tpl \
 | 
			
		||||
	     $(NULL)
 | 
			
		||||
 | 
			
		||||
CLEANFILES = \
 | 
			
		||||
	     mgcp_common.h \
 | 
			
		||||
	     version.h \
 | 
			
		||||
	     $(NULL)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								include/osmocom/mgcp_client/version.h.tpl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								include/osmocom/mgcp_client/version.h.tpl
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION {{VERSION}}
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION_STR "{{VERSION}}"
 | 
			
		||||
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION_MAJOR {{VERSION_MAJOR}}
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION_MINOR {{VERSION_MINOR}}
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION_PATCH {{VERSION_PATCH}}
 | 
			
		||||
 | 
			
		||||
#define LIBOSMO_MGCP_CLIENT_VERSION_GREATER_EQUAL(major, minor, patch) \
 | 
			
		||||
	(LIBOSMO_MGCP_CLIENT_VERSION_MAJOR > (major) || \
 | 
			
		||||
	 (LIBOSMO_MGCP_CLIENT_VERSION_MAJOR == (major) && \
 | 
			
		||||
	  LIBOSMO_MGCP_CLIENT_VERSION_MINOR > (minor)) || \
 | 
			
		||||
	 (LIBOSMO_MGCP_CLIENT_VERSION_MAJOR == (major) && \
 | 
			
		||||
	  LIBOSMO_MGCP_CLIENT_VERSION_MINOR == (minor) && \
 | 
			
		||||
	  LIBOSMO_MGCP_CLIENT_VERSION_PATCH >= (patch)))
 | 
			
		||||
@@ -211,6 +211,7 @@ osmux_handle_find_or_create(const struct mgcp_trunk *trunk, const struct osmo_so
 | 
			
		||||
int conn_osmux_send_rtp(struct mgcp_conn_rtp *conn, struct msgb *msg)
 | 
			
		||||
{
 | 
			
		||||
	int ret;
 | 
			
		||||
	size_t msg_len;
 | 
			
		||||
 | 
			
		||||
	if (!conn->end.output_enabled) {
 | 
			
		||||
		rtpconn_osmux_rate_ctr_inc(conn, OSMUX_RTP_PACKETS_TX_DROPPED_CTR);
 | 
			
		||||
@@ -234,15 +235,17 @@ int conn_osmux_send_rtp(struct mgcp_conn_rtp *conn, struct msgb *msg)
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	msg_len = msgb_length(msg);
 | 
			
		||||
	while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.remote_cid)) > 0) {
 | 
			
		||||
		/* batch full, build and deliver it */
 | 
			
		||||
		osmux_xfrm_input_deliver(conn->osmux.in);
 | 
			
		||||
	}
 | 
			
		||||
	/* NOTE: At this point msg is now owned by osmux subsystem and may have been potentially freed. */
 | 
			
		||||
	if (ret < 0) {
 | 
			
		||||
		rtpconn_osmux_rate_ctr_inc(conn, OSMUX_RTP_PACKETS_TX_DROPPED_CTR);
 | 
			
		||||
	} else {
 | 
			
		||||
		rtpconn_osmux_rate_ctr_inc(conn, OSMUX_RTP_PACKETS_TX_CTR);
 | 
			
		||||
		rtpconn_osmux_rate_ctr_add(conn, OSMUX_AMR_OCTETS_TX_CTR, msgb_length(msg) - sizeof(struct rtp_hdr));
 | 
			
		||||
		rtpconn_osmux_rate_ctr_add(conn, OSMUX_AMR_OCTETS_TX_CTR, msg_len - sizeof(struct rtp_hdr));
 | 
			
		||||
	}
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user