Review Board 1.7.16


Fix directed group pickup feature code *8 with pickupsounds enabled , deadlock and segfault, affects 1.8.0 and trunk

Review Request #1185 - Created April 17, 2011 and submitted

Alec Davis
trunk
18654
Reviewers
asterisk-dev
rmudgett
Asterisk
Since 1.8, the new pickupsound and pickupfailsound in features.conf cause many issues.

1). chan_sip:handle_request_invite() shouldn't be playing out the fail/success audio, as it has 'netlock' locked.
2). dialplan applications for directed_pickups shouldn't beep.
3). feature code for directed pickup should beep on success/failure if configured.

Moved app_directed:pickup_do() to features:ast_do_pickup().

Functions below, all now use the new ast_do_pickup()
app_directed_pickup.c:
   pickup_by_channel()
   pickup_by_exten()
   pickup_by_mark()
   pickup_by_part()
features.c:
   ast_pickup_call()

Created a sip_pickup() thread to handle the pickup and playout the audio, spawned from handle_request_invite.
pickup using *8 feature code, with pickup sounds enabled/disabled

exten => 71,1,Pickup()           ; any ringing extension in same pickupgroup 
exten => 72,1,Pickup(85@phones)  ; dahdi extension
exten => 73,1,Pickup(823@phones) ; sip extension

Changes between revision 10 and 11

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

  1. trunk/apps/app_directed_pickup.c: Loading...
  2. trunk/main/features.c: Loading...
trunk/apps/app_directed_pickup.c
Diff Revision 10 Diff Revision 11
[20] 247 lines
[+20] [+] static int pickup_by_mark(struct ast_channel *chan, const char *mark)
248

    
   
248

   
249
static int find_channel_by_group(void *obj, void *arg, void *data, int flags)
249
static int find_channel_by_group(void *obj, void *arg, void *data, int flags)
250
{
250
{
251
	struct ast_channel *chan = obj;
251
	struct ast_channel *chan = obj;
252
	struct ast_channel *c = data;
252
	struct ast_channel *c = data;

    
   
253
	int i;
253

    
   
254

   
254
	ast_channel_lock(chan);
255
	ast_channel_lock(chan);
255
	int i = (c != chan) &&
256
	i = (c != chan) && (chan->pickupgroup & c->callgroup) &&
256
		(chan->pickupgroup & c->callgroup) &&

   
257
		can_pickup(chan);
257
		can_pickup(chan);
258

    
   
258

   
259
	ast_channel_unlock(chan);
259
	ast_channel_unlock(chan);
260
	return i ? CMP_MATCH | CMP_STOP : 0;
260
	return i ? CMP_MATCH | CMP_STOP : 0;
261
}
261
}
[+20] [20] 26 lines
[+20] [+] static int pickup_exec(struct ast_channel *chan, const char *data)
288
	int res = 0;
288
	int res = 0;
289
	char *tmp = ast_strdupa(data);
289
	char *tmp = ast_strdupa(data);
290
	char *exten = NULL, *context = NULL;
290
	char *exten = NULL, *context = NULL;
291

    
   
291

   
292
	if (ast_strlen_zero(data)) {
292
	if (ast_strlen_zero(data)) {
293
//		res = pickup_by_group(chan);
293
		res = pickup_by_group(chan);
294
		res = ast_pickup_call(chan);

   
295
		return res;
294
		return res;
296
	}
295
	}
297

    
   
296

   
298
	/* Parse extension (and context if there) */
297
	/* Parse extension (and context if there) */
299
	while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
298
	while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
[+20] [20] 114 lines
trunk/main/features.c
Diff Revision 10 Diff Revision 11
 
  1. trunk/apps/app_directed_pickup.c: Loading...
  2. 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.