]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 244071 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 1 Feb 2010 17:59:37 +0000 (17:59 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 1 Feb 2010 17:59:37 +0000 (17:59 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r244071 | tilghman | 2010-02-01 11:53:39 -0600 (Mon, 01 Feb 2010) | 22 lines

  Merged revisions 244070 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r244070 | tilghman | 2010-02-01 11:46:31 -0600 (Mon, 01 Feb 2010) | 16 lines

    Revert previous chan_local fix (r236981) and fix instead by destroying expired frames in the queue.

    (closes issue #16525)
     Reported by: kobaz
     Patches:
           20100126__issue16525.diff.txt uploaded by tilghman (license 14)
           20100129__issue16525__1.6.0.diff.txt uploaded by tilghman (license 14)
     Tested by: kobaz, atis

    (closes issue #16581)
     Reported by: ZX81

    (closes issue #16681)
     Reported by: alexr1
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@244072 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_local.c
main/channel.c

index 5b930b0ee325b6383d36b54023f62c79929af59d..7c8aa8d759912a5e6ce93ca26f3a378adfd7b328 100644 (file)
@@ -217,9 +217,7 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
        }
 
        if (other) {
-               if (other->pbx || other->_bridge || !ast_strlen_zero(other->appl)) {
-                       ast_queue_frame(other, f);
-               } /* else the frame won't go anywhere */
+               ast_queue_frame(other, f);
                ast_channel_unlock(other);
        }
 
index 0da2752e6bc6fc45edb52ba227b85be48ad61e78..4a95de4189e32db51eef6ecf61316c996d63b73c 100644 (file)
@@ -1028,22 +1028,22 @@ static int __ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, in
                }
        }
 
-       if ((queued_frames + new_frames) > 128) {
-               ast_log(LOG_WARNING, "Exceptionally long queue length queuing to %s\n", chan->name);
-               while ((f = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
-                       ast_frfree(f);
-               }
-               ast_channel_unlock(chan);
-               return 0;
-       }
-
-       if ((queued_voice_frames + new_voice_frames) > 96) {
-               ast_log(LOG_WARNING, "Exceptionally long voice queue length queuing to %s\n", chan->name);
-               while ((f = AST_LIST_REMOVE_HEAD(&frames, frame_list))) {
-                       ast_frfree(f);
+       if ((queued_frames + new_frames > 128 || queued_voice_frames + new_voice_frames > 96)) {
+               int count = 0;
+               ast_log(LOG_WARNING, "Exceptionally long %squeue length queuing to %s\n", queued_frames + new_frames > 128 ? "" : "voice ", chan->name);
+               AST_LIST_TRAVERSE_SAFE_BEGIN(&chan->readq, cur, frame_list) {
+                       /* Save the most recent frame */
+                       if (!AST_LIST_NEXT(cur, frame_list)) {
+                               break;
+                       } else if (cur->frametype == AST_FRAME_VOICE || cur->frametype == AST_FRAME_VIDEO || cur->frametype == AST_FRAME_NULL) {
+                               if (++count > 64) {
+                                       break;
+                               }
+                               AST_LIST_REMOVE_CURRENT(frame_list);
+                               ast_frfree(cur);
+                       }
                }
-               ast_channel_unlock(chan);
-               return 0;
+               AST_LIST_TRAVERSE_SAFE_END;
        }
 
        if (after) {