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

Alec Davis reviewboard at asterisk.org
Mon May 9 06:11:17 CDT 2011


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

(Updated 2011-05-09 06:11:17.048545)


Review request for Asterisk Developers.


Changes
-------

chan_sip:handle_request_invite() cannot afford to call ast_stream_and_wait(pickupsound).
changing features.conf 'pickupsound = tt-somethingwrong' highlights the issue.
   during playout period 'core show locks, has the following lock, no others waiting. 
   === ---> Lock #0 (chan_sip.c): MUTEX 24533 handle_request_do &netlock 0xb6684ce0 (1)

The fix, spawn a new thread 'sip_pickup' from handle_request_invite to do the pickup, and more importantly playout the audio..

The result:
4 SIP phones required. A rings B, C and D (at exactly the same time) use the *8 pickup feature code to pickup B.
Both C and D at the same time, hear the respective 'success, or 'failure' beep.

Below correct console output.
[2011-05-09 22:43:27.510121] NOTICE[22857]: chan_sip.c:20909 sip_pickup: Group pickup thread started by channel SIP/gxp824-00000011
[2011-05-09 22:43:27.511548] NOTICE[22886]: features.c:5732 ast_pickup_call: pickup SIP/snom8929-00000010 attempt by SIP/gxp824-00000011
  == Using SIP RTP CoS mark 5
[2011-05-09 22:43:27.526062] NOTICE[22857]: chan_sip.c:20909 sip_pickup: Group pickup thread started by channel SIP/gxp822-00000012
    -- <SIP/gxp824-00000011> Playing 'tt-somethingwrong.gsm' (language 'en')
    -- <SIP/gxp822-00000012> Playing 'beeperr.gsm' (language 'en')
[2011-05-09 22:43:28.020374] NOTICE[22887]: chan_sip.c:20888 sip_pickup_thread: Nothing to pick up for SIP/gxp822-00000012


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 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/20110509/ea98ea17/attachment.htm>


More information about the asterisk-dev mailing list