Simplify the code in this function
authorOlle Johansson <oej@edvina.net>
Mon, 7 Sep 2009 11:31:19 +0000 (11:31 +0000)
committerOlle Johansson <oej@edvina.net>
Mon, 7 Sep 2009 11:31:19 +0000 (11:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216652 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 656cf4b..90b8742 100644 (file)
@@ -23198,20 +23198,21 @@ int st_get_se(struct sip_pvt *p, int max)
                }
                p->stimer->st_cached_max_se = global_max_se;
                return (p->stimer->st_cached_max_se);
-       } else {
-               if (p->stimer->st_cached_min_se) {
-                       return p->stimer->st_cached_min_se;
-               } else if (p->peername) {
-                       struct sip_peer *pp = find_peer(p->peername, NULL, TRUE, FINDPEERS, FALSE, 0);
-                       if (pp) {
-                               p->stimer->st_cached_min_se = pp->stimer.st_min_se;
-                               unref_peer(pp, "unref peer pointer from find_peer call in st_get_se (2)");
-                               return (p->stimer->st_cached_min_se);
-                       }
+       } 
+       /* Find Min SE timer */
+       if (p->stimer->st_cached_min_se) {
+               return p->stimer->st_cached_min_se;
+       } 
+       if (p->peername) {
+               struct sip_peer *pp = find_peer(p->peername, NULL, TRUE, FINDPEERS, FALSE, 0);
+               if (pp) {
+                       p->stimer->st_cached_min_se = pp->stimer.st_min_se;
+                       unref_peer(pp, "unref peer pointer from find_peer call in st_get_se (2)");
+                       return (p->stimer->st_cached_min_se);
                }
-               p->stimer->st_cached_min_se = global_min_se;
-               return (p->stimer->st_cached_min_se);
        }
+       p->stimer->st_cached_min_se = global_min_se;
+       return (p->stimer->st_cached_min_se);
 }