aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 10:26:00 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 10:26:00 +0000
commit9801c2468b37c0fae52169b1a3a6189e7dae31c8 (patch)
tree2e80db5df75b2bb8b121b7b13807a57e00dab47b /channels
parentf4235a7e7ff0d34cddbcdde105c30bafc2bc412c (diff)
Exit early instead of deciding to exit after processing the message.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89279 f38db490-d61c-443f-a65b-d21fe96a405b
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;