aboutsummaryrefslogtreecommitdiffstats
path: root/src/msc_conn.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-09-15 00:20:52 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-09-15 13:23:00 +0200
commit588754c7d391482de6b903e3a80a0df103d314d8 (patch)
treefbbffd3ea20e84c07634f17faa92fbf3b2fa2d61 /src/msc_conn.c
parent040c6bcb25f24b73839111dbce3a7114e7c59bf6 (diff)
mgcp: Reset the local endpoint with the domain name configured
Diffstat (limited to 'src/msc_conn.c')
-rw-r--r--src/msc_conn.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/msc_conn.c b/src/msc_conn.c
index 792c482..551a781 100644
--- a/src/msc_conn.c
+++ b/src/msc_conn.c
@@ -1,7 +1,7 @@
/* MSC related stuff... */
/*
- * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
- * (C) 2010 by On-Waves
+ * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010-2011 by On-Waves
* All Rights Reserved
*
* This program is free software: you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include <ipaccess.h>
#include <mtp_data.h>
#include <cellmgr_debug.h>
+#include <ss7_application.h>
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/tlv.h>
@@ -333,11 +334,16 @@ static void msc_schedule_reconnect(struct msc_connection *fw)
/* send a RSIP to the MGCP GW */
void msc_mgcp_reset(struct msc_connection *msc)
{
- static const char mgcp_reset[] = {
- "RSIP 1 13@mgw MGCP 1.0\r\n"
- };
+ char buf[512];
+ char *dest = "mgw";
- mgcp_forward(msc, (const uint8_t *) mgcp_reset, strlen(mgcp_reset));
+ if (msc->app->mgcp_domain_name)
+ dest = msc->app->mgcp_domain_name;
+
+ snprintf(buf, sizeof(buf) - 1, "RSIP 1 13@%s MGCP 1.0\r\n", dest);
+ buf[sizeof(buf) - 1] = '\0';
+
+ mgcp_forward(msc, (const uint8_t *) buf, strlen(buf));
}
static int mgcp_do_write(struct osmo_fd *fd, struct msgb *msg)