[asterisk-dev] [Code Review] Fix directed group pickup feature code *8 with pickupsounds enabled , deadlock and segfault, affects 1.8.0 and trunk

rmudgett reviewboard at asterisk.org
Tue May 10 16:40:50 CDT 2011


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



trunk/apps/app_directed_pickup.c
<https://reviewboard.asterisk.org/r/1185/#comment7196>

    Should a ZOMBIE check be done here like you did in ast_pickup_call()?
    
    Break long line.



trunk/apps/app_directed_pickup.c
<https://reviewboard.asterisk.org/r/1185/#comment7186>

    Space after comma.



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1185/#comment7187>

    /*!
     * blah
     * blah
     */



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1185/#comment7194>

    The diff has trailing whitespace in this function.
    
    Wonder why there is no red blobs here.



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1185/#comment7188>

    /*!
     * blah
     * blah
     */



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1185/#comment7189>

    If sip_pickup() fails (Because the thread could not be created) what should be the cause code?
    AST_CAUSE_CALL_REJECTED(403 Forbidden)?
    AST_CAUSE_NORMAL_UNSPECIFIED(480 Temporarily unavailable)?
    
    Extra space around sip_pickup().
    
    Arrg! The locked status of c is indeterminate.  If initial INVITE then c is locked.  If re-INVITE then c is not locked.



trunk/include/asterisk/features.h
<https://reviewboard.asterisk.org/r/1185/#comment7190>

    /*!
     * blah
     * blah
     */



trunk/main/features.c
<https://reviewboard.asterisk.org/r/1185/#comment7191>

    Break extra long line.
    Grouping the masq and ZOMBIE tests together would be better since they are checking if a masquerade is pending or in progress.



trunk/main/features.c
<https://reviewboard.asterisk.org/r/1185/#comment7192>

    The return value of ast_do_pickup() is not handled.  res set but not used.  ast_do_pickup() can fail.



trunk/main/features.c
<https://reviewboard.asterisk.org/r/1185/#comment7195>

    res can be eliminated.
    Makes the return value of ast_do_pickup() predictable.
    Eliminate the goto.
    
    blah...
    if (ast_answer()) {
      blah...
      return -1;
    }
    if (ast_queue_control()) {
      blah...
      return -1;
    }
    if (ast_channel_masquerade()) {
      blah...
      return -1;
    }
    blah...
    return 0;



trunk/res/res_features.exports.in
<https://reviewboard.asterisk.org/r/1185/#comment7193>

    File no longer exists.


- rmudgett


On 2011-05-09 16:45:23, Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1185/
> -----------------------------------------------------------
> 
> (Updated 2011-05-09 16:45:23)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> 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.
> 
> 
> 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/20110510/f400183e/attachment-0001.htm>


More information about the asterisk-dev mailing list