diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-06-29 14:36:21 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-06-29 14:36:21 +0000 |
commit | b5aa3db8153a7e5d7b31ecd2263e4e907fcfc1be (patch) | |
tree | 407af690f4a474fece6af1e35fd3dd82dfb5be4e /channels/chan_mgcp.c | |
parent | 8570dda2f081da4e480af6baf8a5df6cd8611760 (diff) |
Accept MGCP keepalive
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1135 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-x | channels/chan_mgcp.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 27a962bd3..faeb828d7 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -2139,15 +2139,22 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req, } /* Clear out potential response */ if (!strcasecmp(req->verb, "RSIP")) { - dump_queue(p); - if (option_verbose > 2) { - ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name); - } - if (sub->owner) { - ast_softhangup(sub->owner, AST_SOFTHANGUP_DEV); - } - transmit_response(sub, "200", req, "OK"); - transmit_notify_request(sub, ""); + /* Test if this RSIP request is just a keepalive */ + if(!strcasecmp( get_header(req, "RM"), "X-keepalive")) { + if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "Received keepalive request from %s@%s\n", p->name, p->parent->name); + transmit_response(sub, "200", req, "OK"); + } else { + dump_queue(p); + if (option_verbose > 2) { + ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name); + } + if (sub->owner) { + ast_softhangup(sub->owner, AST_SOFTHANGUP_DEV); + } + transmit_response(sub, "200", req, "OK"); + transmit_notify_request(sub, ""); + } } else if (!strcasecmp(req->verb, "NTFY")) { /* Acknowledge and be sure we keep looking for the same things */ transmit_response(sub, "200", req, "OK"); |