Merged revisions 338801 via svnmerge from
[asterisk/asterisk.git] / channels / chan_dahdi.c
index b26881c..11a7bda 100644 (file)
@@ -10695,9 +10695,14 @@ static void *analog_ss_thread(void *data)
                                                ast_log(LOG_WARNING, "DTMFCID timed out waiting for ring. "
                                                        "Exiting simple switch\n");
                                                ast_hangup(chan);
-                                               return NULL;
+                                               goto quit;
                                        }
                                        f = ast_read(chan);
+                                       if (!f) {
+                                               /* Hangup received waiting for DTMFCID. Exiting simple switch. */
+                                               ast_hangup(chan);
+                                               goto quit;
+                                       }
                                        if (f->frametype == AST_FRAME_DTMF) {
                                                dtmfbuf[k++] = f->subclass.integer;
                                                ast_debug(1, "CID got digit '%c'\n", f->subclass.integer);