Make sure we check for owner even after a queue frame
authorMark Spencer <markster@digium.com>
Thu, 20 Jan 2005 22:53:57 +0000 (22:53 +0000)
committerMark Spencer <markster@digium.com>
Thu, 20 Jan 2005 22:53:57 +0000 (22:53 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4854 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 8f228a9..d839df2 100755 (executable)
@@ -1533,7 +1533,9 @@ static int attempt_transmit(void *data)
                                                        fr.frametype = AST_FRAME_CONTROL;
                                                        fr.subclass = AST_CONTROL_HANGUP;
                                                        iax2_queue_frame(f->callno, &fr);
                                                        fr.frametype = AST_FRAME_CONTROL;
                                                        fr.subclass = AST_CONTROL_HANGUP;
                                                        iax2_queue_frame(f->callno, &fr);
-                                                       iaxs[f->callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
+                                                       /* Remember, owner could disappear */
+                                                       if (iaxs[f->callno]->owner)
+                                                               iaxs[f->callno]->owner->hangupcause = AST_CAUSE_DESTINATION_OUT_OF_ORDER;
                                                } else {
                                                        if (iaxs[f->callno]->reg) {
                                                                memset(&iaxs[f->callno]->reg->us, 0, sizeof(iaxs[f->callno]->reg->us));
                                                } else {
                                                        if (iaxs[f->callno]->reg) {
                                                                memset(&iaxs[f->callno]->reg->us, 0, sizeof(iaxs[f->callno]->reg->us));