[asterisk-dev] [Code Review] ast_pickup_call() refactor to create a common core function ast_do_pickup()

Alec Davis reviewboard at asterisk.org
Fri May 6 06:59:13 CDT 2011



> On 2011-05-05 14:43:53, Russell Bryant wrote:
> > trunk/include/asterisk/features.h, lines 125-126
> > <https://reviewboard.asterisk.org/r/1185/diff/8/?file=16321#file16321line125>
> >
> >     It would be good to document what this function assumes about channel locks.  i.e., which channel locks does it assume are held or not held when entering this function?

done


> On 2011-05-05 14:43:53, Russell Bryant wrote:
> > trunk/main/features.c, lines 5724-5730
> > <https://reviewboard.asterisk.org/r/1185/diff/8/?file=16322#file16322line5724>
> >
> >     I'm not sure why this is required.  Why not just block on lock() and then check to see if the channel is a zombie / has been hung up when you get it?

agreed, gained next to nothing, other than was able to release failed pickup fractionally earlier, IE. during the planning masquerade.

[2011-05-06 22:20:18.136971] DEBUG[1456] features.c: pickup attempt by SIP/gxp824-00000002
[2011-05-06 22:20:18.223609] DEBUG[1479] features.c: pickup attempt by DAHDI/33-1
[2011-05-06 22:20:18.224511] DEBUG[1456] channel.c: Planning to masquerade channel SIP/gxp824-00000002 into the structure of SIP/gxp823-00000001
[2011-05-06 22:20:18.224742] DEBUG[1479] features.c: No call pickup possible... for DAHDI/33-1
[2011-05-06 22:20:18.224787] DEBUG[1456] channel.c: Done planning to masquerade channel SIP/gxp824-00000002 into the structure of SIP/gxp823-00000001
[2011-05-06 22:20:18.225107] DEBUG[1480] channel.c: Actually Masquerading SIP/gxp824-00000002(6) into the structure of SIP/gxp823-00000001(5)

whereas now, without the retry loop
[2011-05-06 23:27:33.514435] DEBUG[10713] features.c: pickup attempt by SIP/gxp824-0000000e
[2011-05-06 23:27:33.581703] DEBUG[10733] features.c: pickup attempt by DAHDI/33-1
[2011-05-06 23:27:33.592564] DEBUG[10713] channel.c: Planning to masquerade channel SIP/gxp824-0000000e into the structure of SIP/gxp823-0000000d
[2011-05-06 23:27:33.592744] DEBUG[10713] channel.c: Done planning to masquerade channel SIP/gxp824-0000000e into the structure of SIP/gxp823-0000000d
[2011-05-06 23:27:33.592848] DEBUG[10733] features.c: No call pickup possible... for DAHDI/33-1
[2011-05-06 23:27:33.592976] DEBUG[10734] channel.c: Actually Masquerading SIP/gxp824-0000000e(6) into the structure of SIP/gxp823-0000000d(5)

I have had to add a lock around the ast_stream_and_wait(target, pickupsound, ""); as sometimes it didn't play out on success, although on the console it reported is was, but wasn't heard on the device.


- Alec


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1185/#review3480
-----------------------------------------------------------


On 2011-05-06 06:56:57, Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1185/
> -----------------------------------------------------------
> 
> (Updated 2011-05-06 06:56:57)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> debugging mantis 18654, found common code, of which 1 set was wrong, the ast_pickup_call() code in features.c
> The actual fault was ast_pickup_call where the target chan was unlocked too early - see bug18654.diff2.txt
> 
> Moved app_directed:pickup_do() to features:ast_do_pickup().
> 
> Now 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() 
> 
> 
> This addresses bug 18654.
>     https://issues.asterisk.org/view.php?id=18654
> 
> 
> Diffs
> -----
> 
>   trunk/apps/app_directed_pickup.c 317665 
>   trunk/channels/chan_sip.c 317665 
>   trunk/include/asterisk/features.h 317665 
>   trunk/main/features.c 317665 
>   trunk/res/res_features.exports.in 317665 
> 
> Diff: https://reviewboard.asterisk.org/r/1185/diff
> 
> 
> Testing
> -------
> 
> 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 at phones)  ; dahdi extension
> exten => 73,1,Pickup(823 at phones) ; sip extension
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110506/4f1c298e/attachment.htm>


More information about the asterisk-dev mailing list