mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-04 05:53:26 +00:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					e81c1176aa | ||
| 
						 | 
					ed0c1aa9d5 | ||
| 
						 | 
					ac69ea9cdf | 
@@ -24,4 +24,3 @@
 | 
				
			|||||||
# If any interfaces have been removed or changed since the last public release, a=0.
 | 
					# If any interfaces have been removed or changed since the last public release, a=0.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#library		what		description / commit summary line
 | 
					#library		what		description / commit summary line
 | 
				
			||||||
libosmo-mgcp-client	various         Drop legacy API functions and mgcp_client_conf members
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,10 +39,10 @@ AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
 | 
				
			|||||||
AC_SUBST(LIBRARY_DL)
 | 
					AC_SUBST(LIBRARY_DL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0)
 | 
					PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.0.0)
 | 
				
			||||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0)
 | 
					PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.0.0)
 | 
				
			||||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0)
 | 
					PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.0.0)
 | 
				
			||||||
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0)
 | 
					PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.4.0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AC_ARG_ENABLE(sanitize,
 | 
					AC_ARG_ENABLE(sanitize,
 | 
				
			||||||
	[AS_HELP_STRING(
 | 
						[AS_HELP_STRING(
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										107
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										107
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,110 @@
 | 
				
			|||||||
 | 
					osmo-mgw (1.5.0) unstable; urgency=medium
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Pau Espin Pedrol ]
 | 
				
			||||||
 | 
					  * gitignore: Filter *.pc
 | 
				
			||||||
 | 
					  * configure: Find correct libgsm's gsm.h header
 | 
				
			||||||
 | 
					  * vty: Fix typo writing bts-jitter-buffer-delay-{min,max}
 | 
				
			||||||
 | 
					  * Remove libosmo-legacy-mgcp and osmo-bsc-mgcp
 | 
				
			||||||
 | 
					  * debian: Remove dangling symlink to osmo-bsc-mgcp.service
 | 
				
			||||||
 | 
					  * Install systemd services with autotools
 | 
				
			||||||
 | 
					  * Install sample cfg file to /etc/osmocom
 | 
				
			||||||
 | 
					  * mgcp: Fix osmux_cid_bitmap static array size calculation
 | 
				
			||||||
 | 
					  * mgcp_osmux: Use define to calculate rtp_ssrc_winlen
 | 
				
			||||||
 | 
					  * osmux: Avoid initing output without enabling osmux
 | 
				
			||||||
 | 
					  * mgcp: Log endpoint nr consistently as hex
 | 
				
			||||||
 | 
					  * osmux_send_dummy: Avoid logging incorrectly and sending if osmux not enabled
 | 
				
			||||||
 | 
					  * osmux: Don't process regular osmux frames if disabled by cfg
 | 
				
			||||||
 | 
					  * osmux: Move parse_cid of legacy dummy frames to own function
 | 
				
			||||||
 | 
					  * osmux: Make func handling dummy frames independent of endp type
 | 
				
			||||||
 | 
					  * osmux: allow enabling osmux only on correct activating state
 | 
				
			||||||
 | 
					  * osmux: Improve checks around activating and using enabled osmux
 | 
				
			||||||
 | 
					  * osmux.h: Document enum osmux_state
 | 
				
			||||||
 | 
					  * osmux: Avoid processing further frames if conn not found
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Philipp Maier ]
 | 
				
			||||||
 | 
					  * mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well
 | 
				
			||||||
 | 
					  * mgcp_network: translate payload type numbers in RTP packets
 | 
				
			||||||
 | 
					  * mgcp_client: use IETF source port as for MGCP
 | 
				
			||||||
 | 
					  * mgcp_client: increment local port number when port is in use
 | 
				
			||||||
 | 
					  * mgcp_test: release endpoints after use
 | 
				
			||||||
 | 
					  * network: do not patch PT of RTCP packets
 | 
				
			||||||
 | 
					  * network: check packets before further processing
 | 
				
			||||||
 | 
					  * Cosmetic: remove misplaced line break
 | 
				
			||||||
 | 
					  * mgcp_sdp: restructure mgcp_write_response_sdp() (rtpmap)
 | 
				
			||||||
 | 
					  * mgcp_sdp: restructure mgcp_write_response_sdp() (audio)
 | 
				
			||||||
 | 
					  * mgcp_client: check local port only once
 | 
				
			||||||
 | 
					  * mgcp_client_fsm: switch to MGCP_CONN_RECV_SEND in add_audio()
 | 
				
			||||||
 | 
					  * mgcp_protocol: increase buffer space for codec name in LCO
 | 
				
			||||||
 | 
					  * osmo-mgw: Add vty reference manual
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Neels Hofmeyr ]
 | 
				
			||||||
 | 
					  * fix handling of "Wrong domain name" error
 | 
				
			||||||
 | 
					  * interpret domain '*' as 'allow any domain'
 | 
				
			||||||
 | 
					  * cosmetic: log: fix "CallIDs does not match"
 | 
				
			||||||
 | 
					  * fix 3G hack: allow any IP for loopback and 0.0.0.0
 | 
				
			||||||
 | 
					  * cosmetic: drop code dup in mgcp_client_fsm.c CRCX
 | 
				
			||||||
 | 
					  * add X-Osmo-IGN MGCP header to ignore CallID
 | 
				
			||||||
 | 
					  * X-Osmo-IGN: rather parse items by token, not char
 | 
				
			||||||
 | 
					  * mgcp_test: fix log of conn_id presence
 | 
				
			||||||
 | 
					  * mgcp_test: fix get_conn_id_from_response() CI length
 | 
				
			||||||
 | 
					  * mgcp_client_test: cosmetically re-arrange reply_to() args
 | 
				
			||||||
 | 
					  * mgcp_client_test: use "\r\n\r\n" instead of "\n\n"
 | 
				
			||||||
 | 
					  * mgcp_client_test: also verify received conn_id
 | 
				
			||||||
 | 
					  * mgcp_client_test: test long conn_id
 | 
				
			||||||
 | 
					  * mgcp_client: error on too long conn id
 | 
				
			||||||
 | 
					  * mgcp_common: rename to MGCP_CONN_ID_MAXLEN
 | 
				
			||||||
 | 
					  * doc: fix mgcp_verify_ci() return val doc
 | 
				
			||||||
 | 
					  * mgcp_verify_ci(): return meaningful error codes
 | 
				
			||||||
 | 
					  * fix mgcp_verify_ci(): off-by-one in max len check
 | 
				
			||||||
 | 
					  * generate shorter 'I:' conn IDs
 | 
				
			||||||
 | 
					  * mgcp_conn_get(): compare conn Id ('I:') case insensitively
 | 
				
			||||||
 | 
					  * mgcp_conn_get(): match conn Id ('I:') despite leading zeros
 | 
				
			||||||
 | 
					  * cosmetic: mgcp_test: fix get_conn_id_from_response()
 | 
				
			||||||
 | 
					  * comment: indicate struct type for mgcp_endpoint.conns
 | 
				
			||||||
 | 
					  * log: avoid logging early media as error
 | 
				
			||||||
 | 
					  * fix osmo-mgw -s; fixes osmo-mgw.service using -s
 | 
				
			||||||
 | 
					  * Importing history from osmo-gsm-manuals.git
 | 
				
			||||||
 | 
					  * OsmoMGW: update VTY reference
 | 
				
			||||||
 | 
					  * OsmoMGW: document the 'X-Osmo-IGN' MGCP extension
 | 
				
			||||||
 | 
					  * mgw: update vty reference
 | 
				
			||||||
 | 
					  * drop/replace very weird logging in mgcp_client.c
 | 
				
			||||||
 | 
					  * check_rtp: on IP:port errors, log the IP and port
 | 
				
			||||||
 | 
					  * osmo-mgw: err-log: include expected domain name
 | 
				
			||||||
 | 
					  * mgcp_client_vty: fix missing talloc_free
 | 
				
			||||||
 | 
					  * mgcp_client: drop a bunch of dead code
 | 
				
			||||||
 | 
					  * mgcp_client: logging tweaks
 | 
				
			||||||
 | 
					  * mgcp_client: make domain part of endpoint configurable
 | 
				
			||||||
 | 
					  * mgcp_client: tweak some log levels INFO -> {DEBUG,ERROR}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Stefan Sperling ]
 | 
				
			||||||
 | 
					  * add VTY commands which show specific mgcp endpoints
 | 
				
			||||||
 | 
					  * add MGCP CRCX command statistics to osmo-mgw
 | 
				
			||||||
 | 
					  * show RTP TX/RX stats in 'mgcp show stats' output
 | 
				
			||||||
 | 
					  * use local variable for rate counters in handle_create_con()
 | 
				
			||||||
 | 
					  * add more mgcp crxc error counters
 | 
				
			||||||
 | 
					  * add MDCX command statistics to osmo-mgw
 | 
				
			||||||
 | 
					  * add aggregated rtp connection stats to osmo-mgw
 | 
				
			||||||
 | 
					  * add DLCX command statistics to osmo-mgw
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Harald Welte ]
 | 
				
			||||||
 | 
					  * debian/rules: Don't overwrite .tarball-version
 | 
				
			||||||
 | 
					  * check_rtp_origin(): Don't memcmp sockadd_in and in_addr
 | 
				
			||||||
 | 
					  * check_rtp_origin(): Avoid using memcmp for comparing integer types
 | 
				
			||||||
 | 
					  * vty-ref: Update URI of docbook 5.0 schema
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Daniel Willmann ]
 | 
				
			||||||
 | 
					  * mgw: Add new VTY reference
 | 
				
			||||||
 | 
					  * Add initial OsmoMGW manual
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  [ Oliver Smith ]
 | 
				
			||||||
 | 
					  * build manuals moved here from osmo-gsm-manuals.git
 | 
				
			||||||
 | 
					  * jenkins.sh: remove leftover MGCP env variable
 | 
				
			||||||
 | 
					  * Fix DISTCHECK_CONFIGURE_FLAGS override
 | 
				
			||||||
 | 
					  * contrib/jenkins.sh: build and publish manuals
 | 
				
			||||||
 | 
					  * contrib: fix makedistcheck with disabled systemd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 -- Harald Welte <laforge@gnumonks.org>  Sun, 20 Jan 2019 15:02:18 +0100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
osmo-mgw (1.4.0) unstable; urgency=medium
 | 
					osmo-mgw (1.4.0) unstable; urgency=medium
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [ Philipp Maier ]
 | 
					  [ Philipp Maier ]
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							@@ -19,7 +19,7 @@ Multi-Arch: foreign
 | 
				
			|||||||
Depends: ${misc:Depends}, ${shlibs:Depends}
 | 
					Depends: ${misc:Depends}, ${shlibs:Depends}
 | 
				
			||||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
 | 
					Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Package: libosmo-mgcp-client3
 | 
					Package: libosmo-mgcp-client5
 | 
				
			||||||
Section: libs
 | 
					Section: libs
 | 
				
			||||||
Architecture: any
 | 
					Architecture: any
 | 
				
			||||||
Multi-Arch: same
 | 
					Multi-Arch: same
 | 
				
			||||||
@@ -31,5 +31,5 @@ Package: libosmo-mgcp-client-dev
 | 
				
			|||||||
Section: libdevel
 | 
					Section: libdevel
 | 
				
			||||||
Architecture: any
 | 
					Architecture: any
 | 
				
			||||||
Multi-Arch: same
 | 
					Multi-Arch: same
 | 
				
			||||||
Depends: libosmo-mgcp-client3 (= ${binary:Version}), ${misc:Depends}
 | 
					Depends: libosmo-mgcp-client5 (= ${binary:Version}), ${misc:Depends}
 | 
				
			||||||
Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities
 | 
					Description: libosmo-mgcp-client: Osmocom's Media Gateway Control Protocol client utilities
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,10 @@ struct mgcp_client_conf {
 | 
				
			|||||||
	int local_port;
 | 
						int local_port;
 | 
				
			||||||
	const char *remote_addr;
 | 
						const char *remote_addr;
 | 
				
			||||||
	int remote_port;
 | 
						int remote_port;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* By default, we are always addressing the MGW with e.g. 'rtpbridge/123@mgw'.
 | 
				
			||||||
 | 
						 * If this is nonempty, the contained name will be used instead of 'mgw'. */
 | 
				
			||||||
 | 
						char endpoint_domain_name[MGCP_ENDPOINT_MAXLEN];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef unsigned int mgcp_trans_id_t;
 | 
					typedef unsigned int mgcp_trans_id_t;
 | 
				
			||||||
@@ -120,6 +124,9 @@ const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp);
 | 
				
			|||||||
uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp);
 | 
					uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp);
 | 
				
			||||||
uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp);
 | 
					uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const char *mgcp_client_endpoint_domain(const struct mgcp_client *mgcp);
 | 
				
			||||||
 | 
					const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Invoked when an MGCP response is received or sending failed.  When the
 | 
					/* Invoked when an MGCP response is received or sending failed.  When the
 | 
				
			||||||
 * response is passed as NULL, this indicates failure during transmission. */
 | 
					 * response is passed as NULL, this indicates failure during transmission. */
 | 
				
			||||||
typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv);
 | 
					typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@ AM_LDFLAGS = \
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# This is not at all related to the release version, but a range of supported
 | 
					# This is not at all related to the release version, but a range of supported
 | 
				
			||||||
# API versions. Read TODO_RELEASE in the source tree's root!
 | 
					# API versions. Read TODO_RELEASE in the source tree's root!
 | 
				
			||||||
MGCP_CLIENT_LIBVERSION=4:0:1
 | 
					MGCP_CLIENT_LIBVERSION=5:0:0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lib_LTLIBRARIES = \
 | 
					lib_LTLIBRARIES = \
 | 
				
			||||||
	libosmo-mgcp-client.la \
 | 
						libosmo-mgcp-client.la \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -205,7 +205,7 @@ static void mgcp_client_handle_response(struct mgcp_client *mgcp,
 | 
				
			|||||||
	if (pending->response_cb)
 | 
						if (pending->response_cb)
 | 
				
			||||||
		pending->response_cb(response, pending->priv);
 | 
							pending->response_cb(response, pending->priv);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		LOGP(DLMGCP, LOGL_INFO, "MGCP response ignored (NULL cb)\n");
 | 
							LOGP(DLMGCP, LOGL_DEBUG, "MGCP response ignored (NULL cb)\n");
 | 
				
			||||||
	talloc_free(pending);
 | 
						talloc_free(pending);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -705,6 +705,16 @@ struct mgcp_client *mgcp_client_init(void *ctx,
 | 
				
			|||||||
	mgcp->actual.remote_port = conf->remote_port >= 0 ? (uint16_t)conf->remote_port :
 | 
						mgcp->actual.remote_port = conf->remote_port >= 0 ? (uint16_t)conf->remote_port :
 | 
				
			||||||
		MGCP_CLIENT_REMOTE_PORT_DEFAULT;
 | 
							MGCP_CLIENT_REMOTE_PORT_DEFAULT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (osmo_strlcpy(mgcp->actual.endpoint_domain_name, conf->endpoint_domain_name,
 | 
				
			||||||
 | 
								 sizeof(mgcp->actual.endpoint_domain_name))
 | 
				
			||||||
 | 
						    >= sizeof(mgcp->actual.endpoint_domain_name)) {
 | 
				
			||||||
 | 
							LOGP(DLMGCP, LOGL_ERROR, "MGCP client: endpoint domain name is too long, max length is %zu: '%s'\n",
 | 
				
			||||||
 | 
							     sizeof(mgcp->actual.endpoint_domain_name) - 1, conf->endpoint_domain_name);
 | 
				
			||||||
 | 
							talloc_free(mgcp);
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						LOGP(DLMGCP, LOGL_NOTICE, "MGCP client: using endpoint domain '@%s'\n", mgcp_client_endpoint_domain(mgcp));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return mgcp;
 | 
						return mgcp;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -811,6 +821,32 @@ uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp)
 | 
				
			|||||||
	return mgcp->remote_addr;
 | 
						return mgcp->remote_addr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* To compose endpoint names, usually for CRCX, use this as domain name.
 | 
				
			||||||
 | 
					 * For example, snprintf("rtpbridge\*@%s", mgcp_client_endpoint_domain(mgcp)). */
 | 
				
			||||||
 | 
					const char *mgcp_client_endpoint_domain(const struct mgcp_client *mgcp)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return mgcp->actual.endpoint_domain_name[0] ? mgcp->actual.endpoint_domain_name : "mgw";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const char *mgcp_client_rtpbridge_wildcard(const struct mgcp_client *mgcp)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						static char endpoint[MGCP_ENDPOINT_MAXLEN];
 | 
				
			||||||
 | 
						int rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define RTPBRIDGE_WILDCARD_FMT "rtpbridge/*@%s"
 | 
				
			||||||
 | 
						rc = snprintf(endpoint, sizeof(endpoint), RTPBRIDGE_WILDCARD_FMT, mgcp_client_endpoint_domain(mgcp));
 | 
				
			||||||
 | 
						if (rc > sizeof(endpoint) - 1) {
 | 
				
			||||||
 | 
							LOGP(DLMGCP, LOGL_ERROR, "MGCP endpoint exceeds maximum length of %zu: '" RTPBRIDGE_WILDCARD_FMT "'\n",
 | 
				
			||||||
 | 
							     sizeof(endpoint) - 1, mgcp_client_endpoint_domain(mgcp));
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if (rc < 1) {
 | 
				
			||||||
 | 
							LOGP(DLMGCP, LOGL_ERROR, "Cannot compose MGCP endpoint name\n");
 | 
				
			||||||
 | 
							return NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return endpoint;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct mgcp_response_pending * mgcp_client_pending_add(
 | 
					struct mgcp_response_pending * mgcp_client_pending_add(
 | 
				
			||||||
					struct mgcp_client *mgcp,
 | 
										struct mgcp_client *mgcp,
 | 
				
			||||||
					mgcp_trans_id_t trans_id,
 | 
										mgcp_trans_id_t trans_id,
 | 
				
			||||||
@@ -868,7 +904,7 @@ int mgcp_client_tx(struct mgcp_client *mgcp, struct msgb *msg,
 | 
				
			|||||||
		msgb_free(msg);
 | 
							msgb_free(msg);
 | 
				
			||||||
		goto mgcp_tx_error;
 | 
							goto mgcp_tx_error;
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		LOGP(DLMGCP, LOGL_INFO, "Queued %u bytes for MGCP GW\n",
 | 
							LOGP(DLMGCP, LOGL_DEBUG, "Queued %u bytes for MGCP GW\n",
 | 
				
			||||||
		     msgb_l2len(msg));
 | 
							     msgb_l2len(msg));
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -892,10 +928,10 @@ int mgcp_client_cancel(struct mgcp_client *mgcp, mgcp_trans_id_t trans_id)
 | 
				
			|||||||
	struct mgcp_response_pending *pending = mgcp_client_response_pending_get(mgcp, trans_id);
 | 
						struct mgcp_response_pending *pending = mgcp_client_response_pending_get(mgcp, trans_id);
 | 
				
			||||||
	if (!pending) {
 | 
						if (!pending) {
 | 
				
			||||||
		/*! Note: it is not harmful to cancel a transaction twice. */
 | 
							/*! Note: it is not harmful to cancel a transaction twice. */
 | 
				
			||||||
		LOGP(DLMGCP, LOGL_INFO, "Cannot cancel, no such transaction: %u\n", trans_id);
 | 
							LOGP(DLMGCP, LOGL_ERROR, "Cannot cancel, no such transaction: %u\n", trans_id);
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	LOGP(DLMGCP, LOGL_INFO, "Canceled transaction %u\n", trans_id);
 | 
						LOGP(DLMGCP, LOGL_DEBUG, "Canceled transaction %u\n", trans_id);
 | 
				
			||||||
	talloc_free(pending);
 | 
						talloc_free(pending);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
	/*! We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent
 | 
						/*! We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -137,6 +137,22 @@ ALIAS_DEPRECATED(cfg_mgw_rtp_bts_base_port,
 | 
				
			|||||||
      BTS_START_STR
 | 
					      BTS_START_STR
 | 
				
			||||||
      UDP_PORT_STR)
 | 
					      UDP_PORT_STR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DEFUN(cfg_mgw_endpoint_domain_name,
 | 
				
			||||||
 | 
					      cfg_mgw_endpoint_domain_name_cmd,
 | 
				
			||||||
 | 
					      "mgw endpoint-domain NAME",
 | 
				
			||||||
 | 
					      MGW_STR "Set the domain name to send in MGCP messages, e.g. the part 'foo' in 'rtpbridge/*@foo'.\n"
 | 
				
			||||||
 | 
					      "Domain name, should be alphanumeric.\n")
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (osmo_strlcpy(global_mgcp_client_conf->endpoint_domain_name, argv[0],
 | 
				
			||||||
 | 
								 sizeof(global_mgcp_client_conf->endpoint_domain_name))
 | 
				
			||||||
 | 
						    >= sizeof(global_mgcp_client_conf->endpoint_domain_name)) {
 | 
				
			||||||
 | 
							vty_out(vty, "%% Error: 'mgw endpoint-domain' name too long, max length is %zu: '%s'%s",
 | 
				
			||||||
 | 
								sizeof(global_mgcp_client_conf->endpoint_domain_name) - 1, argv[0], VTY_NEWLINE);
 | 
				
			||||||
 | 
							return CMD_WARNING;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return CMD_SUCCESS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int mgcp_client_config_write(struct vty *vty, const char *indent)
 | 
					int mgcp_client_config_write(struct vty *vty, const char *indent)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char *addr;
 | 
						const char *addr;
 | 
				
			||||||
@@ -160,6 +176,10 @@ int mgcp_client_config_write(struct vty *vty, const char *indent)
 | 
				
			|||||||
		vty_out(vty, "%smgw remote-port %u%s", indent,
 | 
							vty_out(vty, "%smgw remote-port %u%s", indent,
 | 
				
			||||||
			(uint16_t)port, VTY_NEWLINE);
 | 
								(uint16_t)port, VTY_NEWLINE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (global_mgcp_client_conf->endpoint_domain_name[0])
 | 
				
			||||||
 | 
							vty_out(vty, "%smgw endpoint-domain %s%s", indent,
 | 
				
			||||||
 | 
								global_mgcp_client_conf->endpoint_domain_name, VTY_NEWLINE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return CMD_SUCCESS;
 | 
						return CMD_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -174,6 +194,7 @@ void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *c
 | 
				
			|||||||
	install_element(node, &cfg_mgw_remote_port_cmd);
 | 
						install_element(node, &cfg_mgw_remote_port_cmd);
 | 
				
			||||||
	install_element(node, &cfg_mgw_endpoint_range_cmd);
 | 
						install_element(node, &cfg_mgw_endpoint_range_cmd);
 | 
				
			||||||
	install_element(node, &cfg_mgw_rtp_bts_base_port_cmd);
 | 
						install_element(node, &cfg_mgw_rtp_bts_base_port_cmd);
 | 
				
			||||||
 | 
						install_element(node, &cfg_mgw_endpoint_domain_name_cmd);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* deprecated 'mgcpgw' commands */
 | 
						/* deprecated 'mgcpgw' commands */
 | 
				
			||||||
	install_element(node, &cfg_mgcpgw_local_ip_cmd);
 | 
						install_element(node, &cfg_mgcpgw_local_ip_cmd);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,8 @@
 | 
				
			|||||||
 | 
					DLMGCP MGCP client: using endpoint domain '@mgw'
 | 
				
			||||||
DLMGCP message buffer to small, can not generate MGCP message
 | 
					DLMGCP message buffer to small, can not generate MGCP message
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_mgcp_client_cancel():
 | 
					test_mgcp_client_cancel():
 | 
				
			||||||
 | 
					DLMGCP MGCP client: using endpoint domain '@mgw'
 | 
				
			||||||
- composed msg with trans_id=1
 | 
					- composed msg with trans_id=1
 | 
				
			||||||
- not in queue yet, cannot cancel yet
 | 
					- not in queue yet, cannot cancel yet
 | 
				
			||||||
DLMGCP Cannot cancel, no such transaction: 1
 | 
					DLMGCP Cannot cancel, no such transaction: 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user