Review Board 1.7.16


Fix *8 directed pickup locks system while sucessful pickupsound plays out.

Review Request #1232 - Created May 26, 2011 and submitted

Alec Davis
trunk
18654
Reviewers
asterisk-dev
rmudgett
Asterisk
https://reviewboard.asterisk.org/r/1185/ finished off with the target channel requiring to be locked for the duration of the pickupsound, otherwise there was a clash between 2 threads trying to write data.

This simple change keeps the playout of the sucessful pickupsound in the same thread as the bridge, now played out by bridge_play_sounds().
yes, simple pickups with SIP and DAHDI, but to exaggerate the issue for testing purposes set pickupsound=tt_monkeys set in features.conf, and checking with 'core show locks' that no locks exist during playout. They do prior to this change.

Diff revision 1 (Latest)

  1. trunk/main/features.c: Loading...
trunk/main/features.c
Revision 320797 New Change
[20] 5808 lines
[+20] [+] int ast_pickup_call(struct ast_channel *chan)
5809
		ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", target->name, chan->name);
5809
		ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", target->name, chan->name);
5810

    
   
5810

   
5811
		res = ast_do_pickup(chan, target);
5811
		res = ast_do_pickup(chan, target);
5812
		if (!res) {
5812
		if (!res) {
5813
			if (!ast_strlen_zero(pickupsound)) {
5813
			if (!ast_strlen_zero(pickupsound)) {
5814
				/*!
5814
				pbx_builtin_setvar_helper(target, "BRIDGE_PLAY_SOUND", pickupsound);
5815
				 * \todo We are not the bridge thread when we inject this sound

   
5816
				 * so we need to hold the target channel lock while the sound is

   
5817
				 * played.  A better way needs to be found as this pauses the

   
5818
				 * system.

   
5819
				 */

   
5820
				ast_stream_and_wait(target, pickupsound, "");

   
5821
			}
5815
			}
5822
		} else {
5816
		} else {
5823
			ast_log(LOG_WARNING, "pickup %s failed by %s\n", target->name, chan->name);
5817
			ast_log(LOG_WARNING, "pickup %s failed by %s\n", target->name, chan->name);
5824
		}
5818
		}
5825
		ast_channel_unlock(target);
5819
		ast_channel_unlock(target);
[+20] [20] 413 lines
  1. trunk/main/features.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.