diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-09-15 00:20:52 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-09-18 12:38:18 +0000 |
commit | 4533be3e3b5410be23b30454b7b3ea96a491b00f (patch) | |
tree | 72639258ba7a93c4f362cd62f9d9187d7029f4ea | |
parent | f7435d4bc3221bc23933d2786fce2adf6e1ed994 (diff) |
mgcp: Reset the local endpoint with the domain name configured
-rw-r--r-- | src/msc_conn.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/msc_conn.c b/src/msc_conn.c index a554514..6e6109f 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 <osmocore/talloc.h> #include <osmocore/tlv.h> @@ -332,11 +333,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 bsc_fd *fd, struct msgb *msg) |