]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
It's possible for the iax2 pvt to disappear, so if it has... don't bother looking...
authorJoshua Colp <jcolp@digium.com>
Thu, 4 Jan 2007 23:00:50 +0000 (23:00 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 4 Jan 2007 23:00:50 +0000 (23:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49568 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index c38480f93e956b97bed461267fef878ce99ead8d..2037a3a4056fb325124415f2da67b318bed9135b 100644 (file)
@@ -7023,15 +7023,17 @@ retryowner2:
                                                }
                                        }
                                }
-                               ast_mutex_lock(&dpcache_lock);
-                               dp = iaxs[fr->callno]->dpentries;
-                               while(dp) {
-                                       if (!(dp->flags & CACHE_FLAG_TRANSMITTED)) {
-                                               iax2_dprequest(dp, fr->callno);
+                               if (iaxs[fr->callno]) {
+                                       ast_mutex_lock(&dpcache_lock);
+                                       dp = iaxs[fr->callno]->dpentries;
+                                       while(dp) {
+                                               if (!(dp->flags & CACHE_FLAG_TRANSMITTED)) {
+                                                       iax2_dprequest(dp, fr->callno);
+                                               }
+                                               dp = dp->peer;
                                        }
-                                       dp = dp->peer;
+                                       ast_mutex_unlock(&dpcache_lock);
                                }
-                               ast_mutex_unlock(&dpcache_lock);
                                break;
                        case IAX_COMMAND_POKE:
                                /* Send back a pong packet with the original timestamp */