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 13 and 14

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/channels/chan_sip.c: Loading...
trunk/channels/chan_sip.c
Diff Revision 13 Diff Revision 14
[20] 22326 lines
[+20] [+] static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct ast_sockaddr *addr, int *recount, const char *e, int *nounlock)
22327
					c = NULL;
22327
					c = NULL;
22328
				}
22328
				}
22329
			} else {	/* Pickup call in call group */
22329
			} else {	/* Pickup call in call group */
22330
				if (sip_pickup(c)) {
22330
				if (sip_pickup(c)) {
22331
					ast_log(LOG_WARNING, "Failed to start Group pickup by %s\n", c->name);
22331
					ast_log(LOG_WARNING, "Failed to start Group pickup by %s\n", c->name);
22332
					p->invitestate = INV_COMPLETED;

   
22333
					transmit_response_reliable(p, "480 Temporarily Unavailable", req);
22332
					transmit_response_reliable(p, "480 Temporarily Unavailable", req);

    
   
22333
					sip_alreadygone(p);

    
   
22334
					c->hangupcause = AST_CAUSE_FAILURE;
22334

    
   
22335

   
22335
					/* Unlock locks so ast_hangup can do its magic */
22336
					/* Unlock locks so ast_hangup can do its magic */
22336
					if (!reinvite) {
22337
					if (!reinvite) {
22337
						/* If initial INVITE then c is locked.
22338
						/* If initial INVITE then c is locked.
22338
						 * If re-INVITE then c is not locked.
22339
						 * If re-INVITE then c is not locked.
22339
						 */
22340
						 */
22340
						ast_channel_unlock(c);
22341
						ast_channel_unlock(c);

    
   
22342
						*nounlock = 1;
22341
					}
22343
					}
22342

    
   
22344

   

    
   
22345
					p->invitestate = INV_COMPLETED;
22343
					sip_pvt_unlock(p);
22346
					sip_pvt_unlock(p);
22344
					ast_hangup(c);
22347
					ast_hangup(c);
22345
					sip_pvt_lock(p);
22348
					sip_pvt_lock(p);
22346
					c = NULL;
22349
					c = NULL;
22347
				}
22350
				}
[+20] [20] 7311 lines
  1. trunk/channels/chan_sip.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.