aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 13:23:05 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 13:23:05 +0800
commit840447e2bf38a2d583fcee8a542b26548eb8a30a (patch)
tree9c163a487686c5a69d1139786b2cc6185fe2790b
parent3f7586d5710208e158f561c180ec6e210878b7b3 (diff)
[mgcp] Add a change callback and send a dummy packet on MDCX.
Send a dummy packet to make sure our Gateway will discover us and can send the ringtone to us.
-rw-r--r--openbsc/src/mgcp/mgcp_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_main.c b/openbsc/src/mgcp/mgcp_main.c
index 80b7b543..f7f1f80f 100644
--- a/openbsc/src/mgcp/mgcp_main.c
+++ b/openbsc/src/mgcp/mgcp_main.c
@@ -128,6 +128,15 @@ static int mgcp_rsip_cb(struct mgcp_config *cfg)
return 0;
}
+static int mgcp_change_cb(struct mgcp_config *cfg, int endpoint, int state, int local_rtp)
+{
+ if (state != MGCP_ENDP_MDCX)
+ return 0;
+
+ mgcp_send_dummy(&cfg->endpoints[endpoint]);
+ return 0;
+}
+
static int read_call_agent(struct bsc_fd *fd, unsigned int what)
{
struct sockaddr_in addr;
@@ -200,6 +209,7 @@ int main(int argc, char** argv)
/* set some callbacks */
cfg->reset_cb = mgcp_rsip_cb;
+ cfg->change_cb = mgcp_change_cb;
/* we need to bind a socket */
if (rc == 0) {