]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix *8 directed pickup locks system during pickupsound play out
authorAlec L Davis <sivad.a@paradise.net.nz>
Fri, 27 May 2011 08:24:32 +0000 (08:24 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Fri, 27 May 2011 08:24:32 +0000 (08:24 +0000)
move playout from sip_pickup_thread to bridge using BRIDGE_PLAY_SOUND method,
This stop the clash of 2 threads trying to write audio to same channel.
In addition fixes choppy audio beep in issue 19177.

 (issue #18654)
 (issue #19177)
 Reported by: Docent
 Patches:
      review1232-1.6.2.diff.txt uploaded by alecdavis (license 585)
 Tested by: alecdavis

Review: https://reviewboard.asterisk.org/r/1232/

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

main/features.c

index d77384d54855935f6e7ebe4d89715c714458e4de..ab1538f1009bcac0c056eb1883cd8ca0dda48cee 100644 (file)
@@ -5074,14 +5074,15 @@ int ast_pickup_call(struct ast_channel *chan)
        ast_debug(1, "pickup attempt by %s\n", chan->name);
 
        if (target) {
-               if (!(res = ast_do_pickup(chan, target))) {
+               res = ast_do_pickup(chan, target);
+               ast_channel_unlock(target);
+               if (!res) {
                        if (!ast_strlen_zero(pickupsound)) {
-                               ast_stream_and_wait(target, pickupsound, "");
+                               pbx_builtin_setvar_helper(target, "BRIDGE_PLAY_SOUND", pickupsound);
                        }
                } else {
                        ast_log(LOG_WARNING, "pickup %s failed by %s\n", target->name, chan->name);
                }
-               ast_channel_unlock(target);
        }
 
        if (res < 0) {