[asterisk-dev] [Code Review] 2654: Make built-in attended transfer feature complete

Mark Michelson reviewboard at asterisk.org
Thu Jul 18 09:43:24 CDT 2013



> On July 17, 2013, 8:55 p.m., rmudgett wrote:
> > /trunk/main/bridging_basic.c, lines 2115-2139
> > <https://reviewboard.asterisk.org/r/2654/diff/5/?file=41556#file41556line2115>
> >
> >     Way too much indentation.  Inconsistent also.

I'm blaming this one squarely on my editor. It indents based on the number of unclosed parentheses when I break lines. It looks really bad here since reviewboard uses 8 space tabs instead of something more civilized.


> On July 17, 2013, 8:55 p.m., rmudgett wrote:
> > /trunk/main/bridging_basic.c, line 34
> > <https://reviewboard.asterisk.org/r/2654/diff/5/?file=41556#file41556line34>
> >
> >     This didn't need to be moved.

Yeah, I had moved that when I was doing reference count debugging in order to make sure that bridging_basic.c included astobj2.h before any of the other include files attempted to. I just left it where it was after I stopped debugging because, well, it didn't really hurt to leave it at the top of the include list.


> On July 17, 2013, 8:55 p.m., rmudgett wrote:
> > /trunk/main/bridging_basic.c, line 247
> > <https://reviewboard.asterisk.org/r/2654/diff/5/?file=41556#file41556line247>
> >
> >     I am not finding where hooks are restored after a transfer completes.  The transferee channels don't look like they ever get their hooks back.  Also the transferrer may not get his hooks back if he is in the original bridge when the transfer completes.
> >     
> >     May need to rethink what happens to the hooks on non-transferrer channels.

Yes, when I reworked how personalities were created and changed after the previous review, I did not include the re-addition of feature hooks when returning to a normal personality. I will re-add this.


- Mark


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


On July 17, 2013, 6:03 p.m., Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2654/
> -----------------------------------------------------------
> 
> (Updated July 17, 2013, 6:03 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-21543
>     https://issues.asterisk.org/jira/browse/ASTERISK-21543
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This review contains the content necessary to get DTMF attended transfer feature complete.
> 
> In order to facilitate this, there are some background tasks that needed to be done first. First, when an attended transfer is initiated, it was clear that the bridge that the parties were in would need to behave differently from how it normally did. In order to allow for this to happen, the concept of bridge "personalities" was added. When a bridge is being used in an attended transfer, it has its personality changed to be that of an attended transfer basic bridge instead of a normal basic bridge. With this personality, the following changes are present:
> 
> * The bridge will never dissolve on its own. It must be destroyed by an outside influence.
> * The bridge recognizes when a channel with the "transferer" role enters. This channel is bestowed with DTMF hooks and a hangup hook that other channels do not get.
> * The normal DTMF hooks are not present for channels. This makes compounding transfers impossible.
> 
> In order to make use of an alternate personality for basic bridging, attended transfer functionality was moved from bridges/bridge_builtin_features.c to main/bridging_basic.c. While performing this move, it became clear that it made sense to move blind transfer functionality as well since attended and blind transfers share some common code.
> 
> Attended transfer operation has been completely overhauled from its old form. In its old form, the attended transfer DTMF hook would not return until a conclusive result of the transfer could be determined. With this set of changes, the attended transfer DTMF hook sets up an attended_transfer_properties structure that has all the relevant pieces of information for the attended transfer. After setting up the properties, the feature hook launches a monitoring thread and returns.
> 
> This monitor thread then runs a state machine that responds to stimuli from various hooks and callbacks. The state machine allows for orderly operation since stimuli may be coming from multiple other threads.
> 
> In addition to the normal feedback for reviews (i.e. memory leaks, potential deadlocks, etc.), let me know if you have alternate suggestions for names of things. I struggled to come up with cogent state names for the state machine, so if you have better suggestions for the names, please let me know.
> 
> 
> Diffs
> -----
> 
>   /trunk/bridges/bridge_builtin_features.c 394568 
>   /trunk/include/asterisk/bridging.h 394568 
>   /trunk/include/asterisk/bridging_features.h 394568 
>   /trunk/include/asterisk/bridging_internal.h PRE-CREATION 
>   /trunk/include/asterisk/bridging_roles.h 394568 
>   /trunk/include/asterisk/features_config.h 394568 
>   /trunk/include/asterisk/stasis_bridging.h 394568 
>   /trunk/main/bridging.c 394568 
>   /trunk/main/bridging_basic.c 394568 
>   /trunk/main/bridging_roles.c 394568 
>   /trunk/main/features.c 394568 
>   /trunk/main/features_config.c 394568 
>   /trunk/main/stasis_bridging.c 394568 
> 
> Diff: https://reviewboard.asterisk.org/r/2654/diff/
> 
> 
> Testing
> -------
> 
> Using the state machine as a guide, I ran through every transition that can be reliably tested (for instance, I couldn't easily test transfer failures that rely on memory allocation failures). In all cases, I got the result I expected.
> 
> 
> Thanks,
> 
> Mark Michelson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130718/932cca8c/attachment-0001.htm>


More information about the asterisk-dev mailing list