diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-22 13:23:05 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-25 23:02:43 +0800 |
commit | dc41755fc7c092669db6a387e7e301024468183f (patch) | |
tree | a8ebd6b76511b997ba844c3bfd9a2a9aba5b9307 | |
parent | aa9d3ce97afe7f4d5e690b0557e75b2121afa9e2 (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.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) { |