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

Alec Davis reviewboard at asterisk.org
Thu Apr 28 07:03:44 CDT 2011


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

(Updated 2011-04-28 07:03:44.720736)


Review request for Asterisk Developers.


Changes
-------

if 2 channels concurrently attempted to pickup the same channel, the code would fail at masquerade in ast_do_pickup.
Now after target lock is acquired, recheck that the target is still ringing etc.

Using the *8 pickup feature, with the debug logging the result can be seen. 1 wins, the 2nd gets an error beep.

[2011-04-29 00:00:51.328201] NOTICE[927]: features.c:5730 ast_pickup_call: SIP/gxp823-00000024, pickup attempt by SIP/gxp824-00000025
    -- <SIP/gxp824-00000025> Playing 'beep.gsm' (language 'en')
[2011-04-29 00:00:51.414847] NOTICE[1023]: features.c:5730 ast_pickup_call: SIP/gxp823-00000024, pickup attempt by DAHDI/33-1
[2011-04-29 00:00:51.848314] NOTICE[927]: features.c:5771 ast_do_pickup: Call pickup on 'SIP/gxp823-00000024' by 'SIP/gxp824-00000025'
[2011-04-29 00:00:51.848746] NOTICE[927]: features.c:5794 ast_do_pickup: answered 'SIP/gxp824-00000025'
[2011-04-29 00:00:51.848942] NOTICE[927]: features.c:5801 ast_do_pickup: queue answer to 'SIP/gxp823-00000024'
[2011-04-29 00:00:51.849294] NOTICE[927]: features.c:5808 ast_do_pickup: masquerade 'SIP/gxp824-00000025' into 'SIP/gxp823-00000024'
[2011-04-29 00:00:51.849626] NOTICE[927]: features.c:5822 ast_do_pickup: return with 0 on 'SIP/gxp824-00000025'
[2011-04-29 00:00:51.853989] WARNING[1023]: features.c:5740 ast_pickup_call: target has gone, or not ringing anymore for DAHDI/33-1
    -- <DAHDI/33-1> Playing 'beeperr.gsm' (language 'en')


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 (updated)
-----

  trunk/apps/app_directed_pickup.c 316037 
  trunk/channels/chan_sip.c 316037 
  trunk/include/asterisk/features.h 316037 
  trunk/main/features.c 316037 
  trunk/res/res_features.exports.in 316037 

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/20110428/d1420a54/attachment.htm>


More information about the asterisk-dev mailing list