Review Board 1.7.16


chan_sip+CEL: Add missing ANSWER and PICKUP events to INVITE/w/replaces pickup (for asterisk 12)

Review Request #3537 - Created May 13, 2014 and updated

wdoekes
12
ASTERISK-22977
Reviewers
asterisk-dev
Asterisk
The fixes from https://reviewboard.asterisk.org/r/3073/ (11r413838) won't work in Asterisk 12.

This is a quick stab at making it work.

BEWARE! This is completely untested. Preliminary feedback is welcome.
This will have to sit here a while until I find some time to properly test how this pans out in 12.

 
Posted (May 22, 2014, 9:12 a.m.)

   

  
/branches/12/channels/chan_sip.c (Diff revision 1)
 
 
 
 
 
 
 
Not a finding, just a thought for your testing.

Under the hood, ast_do_pickup will eventually call ast_channel_move on the same two channels. From the perspective of "moving channels around", this ends up being the same.

What is interesting about this change is that instead of just moving the channels around, we will now interpret _all_ INVITE w/ replaces that target a channel not in a bridge as a pickup attempt. That may be the correct interpretation - in which case, this patch should be fine. If that isn't true, then we'd have to have some other way to determine the intent of the INVITE w/ replaces.
  1. The only time I could foresee this situation not being a call pickup would be if Alice places a call to Bob, and Carol sends an INVITE to replace Alice. In that scenario, Carol is not picking up the call but is instead taking Alice's place on the call to Bob.
    
    Probably the best way to handle this is
    if (bridge) {
        /* Do what's already in your patch */
    } else if (p->outgoing_call) {
        /* Do the pickup as you have it in the patch */
    } else {
        /* Do an ast_channel_move as it was prior to your patch */
    }
    
    That would at least make behavior correct in the odd case; however, I'm not sure if there would be other missing events if something like that were done.

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.