diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-02 17:02:46 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-02 17:02:46 +0000 |
commit | f245638833df201bc8a1681dc3221465faf1442a (patch) | |
tree | ecd8c578f0de09fb9451f2d8928500675f00433b | |
parent | c08bb10217a9bc9ce4ad2e4903afde717353f231 (diff) |
If a SIP message comes in and goes to a method handler that requires additional values that may not be present then send back an error.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@57475 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2ce4d2574..29916b741 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11340,6 +11340,12 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc } } + if (!e && (p->method == SIP_INVITE || p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER)) { + transmit_response(p, "503 Server error", req); + ast_set_flag(p, SIP_NEEDDESTROY); + return -1; + } + /* Handle various incoming SIP methods in requests */ switch (p->method) { case SIP_OPTIONS: |