Exit early instead of deciding to exit after processing the message.
authorOlle Johansson <oej@edvina.net>
Thu, 15 Nov 2007 10:26:00 +0000 (10:26 +0000)
committerOlle Johansson <oej@edvina.net>
Thu, 15 Nov 2007 10:26:00 +0000 (10:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89279 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index e592e03..2bda45e 100644 (file)
@@ -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;