From dc41755fc7c092669db6a387e7e301024468183f Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 22 Apr 2010 13:23:05 +0800 Subject: [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. --- openbsc/src/mgcp/mgcp_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'openbsc') diff --git a/openbsc/src/mgcp/mgcp_main.c b/openbsc/src/mgcp/mgcp_main.c index 80b7b543c..f7f1f80fc 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) { -- cgit v1.2.3