summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-11-15 10:26:00 +0000
committerOlle Johansson <oej@edvina.net>2007-11-15 10:26:00 +0000
commit257b4fb41ee29ae0cb90989081c94ba87deaa0d4 (patch)
tree2e80db5df75b2bb8b121b7b13807a57e00dab47b /channels
parenteab6b00904d15e927c457ea7ef56b299d58dc086 (diff)
Exit early instead of deciding to exit after processing the message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e592e03bf..2bda45e22 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12297,6 +12297,12 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
!strcasecmp(c, "application/vnd.nortelnetworks.digits")) {
unsigned int duration = 0;
+ if (!p->owner) { /* not a PBX call */
+ transmit_response(p, "481 Call leg/transaction does not exist", req);
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ return;
+ }
+
/* Try getting the "signal=" part */
if (ast_strlen_zero(c = get_body(req, "Signal")) && ast_strlen_zero(c = get_body(req, "d"))) {
ast_log(LOG_WARNING, "Unable to retrieve DTMF signal from INFO message from %s\n", p->callid);
@@ -12311,11 +12317,6 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
if (!duration)
duration = 100; /* 100 ms */
- if (!p->owner) { /* not a PBX call */
- transmit_response(p, "481 Call leg/transaction does not exist", req);
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
- return;
- }
if (ast_strlen_zero(buf)) {
transmit_response(p, "200 OK", req);
@@ -12358,15 +12359,17 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req)
} else if (!strcasecmp(c, "application/dtmf")) {
unsigned int duration = 0;
- get_msg_text(buf, sizeof(buf), req);
- duration = 100; /* 100 ms */
-
- if (!p->owner) { /* not a PBX call */
+ if (!p->owner) { /* not a PBX call */
transmit_response(p, "481 Call leg/transaction does not exist", req);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
return;
}
+
+
+ get_msg_text(buf, sizeof(buf), req);
+ duration = 100; /* 100 ms */
+
if (ast_strlen_zero(buf)) {
transmit_response(p, "200 OK", req);
return;