aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 06:46:06 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 06:46:06 +0200
commitbda581963dc5f967bdaab3fc4bb5720d33ddc94f (patch)
treebf54059ec5ed10267bdaa585b69aa530f0b41cf5
parent2ba40afc36c1abfa4b0777fb5dc4eb6ac8179d3a (diff)
parent8d9833ef8376a144ef384d0f47b5c67bd0a1f6e2 (diff)
Merge branch 'on-waves/mgcp'
-rw-r--r--openbsc/src/mgcp/mgcp_network.c5
-rw-r--r--openbsc/src/mgcp/mgcp_vty.c22
-rw-r--r--openbsc/src/vty/command.c3
3 files changed, 19 insertions, 11 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index cd10d2a8..5a982608 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -158,8 +158,9 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what)
}
endp->bts = addr.sin_addr;
- LOGP(DMGCP, LOGL_NOTICE, "Found BTS for endpoint: 0x%x on port: %d/%d\n",
- ENDPOINT_NUMBER(endp), ntohs(endp->bts_rtp), ntohs(endp->bts_rtcp));
+ LOGP(DMGCP, LOGL_NOTICE, "Found BTS for endpoint: 0x%x on port: %d/%d of %s\n",
+ ENDPOINT_NUMBER(endp), ntohs(endp->bts_rtp), ntohs(endp->bts_rtcp),
+ inet_ntoa(addr.sin_addr));
}
}
diff --git a/openbsc/src/mgcp/mgcp_vty.c b/openbsc/src/mgcp/mgcp_vty.c
index af762c57..bf5d15f0 100644
--- a/openbsc/src/mgcp/mgcp_vty.c
+++ b/openbsc/src/mgcp/mgcp_vty.c
@@ -33,6 +33,8 @@
#include <vty/command.h>
#include <vty/vty.h>
+#include <string.h>
+
static struct mgcp_config *g_cfg = NULL;
/*
@@ -48,23 +50,25 @@ static int config_write_mgcp(struct vty *vty)
{
vty_out(vty, "mgcp%s", VTY_NEWLINE);
if (g_cfg->local_ip)
- vty_out(vty, " local ip %s%s", g_cfg->local_ip, VTY_NEWLINE);
- if (g_cfg->bts_ip)
+ vty_out(vty, " local ip %s%s", g_cfg->local_ip, VTY_NEWLINE);
+ if (g_cfg->bts_ip && strlen(g_cfg->bts_ip) != 0)
vty_out(vty, " bts ip %s%s", g_cfg->bts_ip, VTY_NEWLINE);
vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE);
vty_out(vty, " bind port %u%s", g_cfg->source_port, VTY_NEWLINE);
vty_out(vty, " bind early %u%s", !!g_cfg->early_bind, VTY_NEWLINE);
vty_out(vty, " rtp base %u%s", g_cfg->rtp_base_port, VTY_NEWLINE);
- vty_out(vty, " sdp audio payload number %u%s", g_cfg->audio_payload, VTY_NEWLINE);
- vty_out(vty, " sdp audio payload name %s%s", g_cfg->audio_name, VTY_NEWLINE);
+ if (g_cfg->audio_payload != -1)
+ vty_out(vty, " sdp audio payload number %d%s", g_cfg->audio_payload, VTY_NEWLINE);
+ if (g_cfg->audio_name)
+ vty_out(vty, " sdp audio payload name %s%s", g_cfg->audio_name, VTY_NEWLINE);
vty_out(vty, " loop %u%s", !!g_cfg->audio_loop, VTY_NEWLINE);
- vty_out(vty, " endpoints %u%s", g_cfg->number_endpoints, VTY_NEWLINE);
+ vty_out(vty, " number endpoints %u%s", g_cfg->number_endpoints - 1, VTY_NEWLINE);
if (g_cfg->forward_ip)
- vty_out(vty, " forward audio ip %s%s", g_cfg->forward_ip, VTY_NEWLINE);
+ vty_out(vty, " forward audio ip %s%s", g_cfg->forward_ip, VTY_NEWLINE);
if (g_cfg->forward_port != 0)
- vty_out(vty, " forward audio port %d%s", g_cfg->forward_port, VTY_NEWLINE);
+ vty_out(vty, " forward audio port %d%s", g_cfg->forward_port, VTY_NEWLINE);
if (g_cfg->call_agent_addr)
- vty_out(vty, " call agent ip %s%s", g_cfg->call_agent_addr, VTY_NEWLINE);
+ vty_out(vty, " call agent ip %s%s", g_cfg->call_agent_addr, VTY_NEWLINE);
return CMD_SUCCESS;
}
@@ -77,7 +81,7 @@ DEFUN(show_mcgp, show_mgcp_cmd, "show mgcp",
vty_out(vty, "MGCP is up and running with %u endpoints:%s", g_cfg->number_endpoints - 1, VTY_NEWLINE);
for (i = 1; i < g_cfg->number_endpoints; ++i) {
struct mgcp_endpoint *endp = &g_cfg->endpoints[i];
- vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s traffic in :%u/%u%s",
+ vty_out(vty, " Endpoint 0x%.2x: CI: %d net: %u/%u bts: %u/%u on %s traffic received bts: %u remote: %u%s",
i, endp->ci,
ntohs(endp->net_rtp), ntohs(endp->net_rtcp),
ntohs(endp->bts_rtp), ntohs(endp->bts_rtcp),
diff --git a/openbsc/src/vty/command.c b/openbsc/src/vty/command.c
index 2faed35e..a38ed042 100644
--- a/openbsc/src/vty/command.c
+++ b/openbsc/src/vty/command.c
@@ -2362,6 +2362,9 @@ DEFUN(config_exit,
case VTY_NODE:
vty->node = CONFIG_NODE;
break;
+ case MGCP_NODE:
+ vty->node = CONFIG_NODE;
+ vty->index = NULL;
default:
break;
}