[asterisk-dev] [Code Review] 3183: ARI: pass channel variables into originate as opposed to assigning after originate

Matt Jordan reviewboard at asterisk.org
Thu Feb 6 13:49:02 CST 2014



> On Feb. 6, 2014, 9:42 a.m., Corey Farrell wrote:
> > /branches/12/res/ari/resource_channels.c, line 761
> > <https://reviewboard.asterisk.org/r/3183/diff/3/?file=53609#file53609line761>
> >
> >     If we actually failed to create variables that were requested, we should abort the Originate.  Half-success is worse than total failure.

Agreed


> On Feb. 6, 2014, 9:42 a.m., Corey Farrell wrote:
> > /branches/12/res/ari/resource_channels.c, line 690
> > <https://reviewboard.asterisk.org/r/3183/diff/3/?file=53609#file53609line690>
> >
> >     I feel the following prototype would be better for the caller:
> >     static int json_to_ast_variables(struct ast_json *src, struct ast_variable **dest);
> >     Return 0 or -1 for success/failure.
> >     
> >     This way the caller can tell between a failure and an empty json_variables object.

I'm usually less of a fan of 'out' parameters than just returning what has been created, I can see how this is useful in this case - it would at least prevent the case of { variables: { } } from causing an error response. Changed.


- Matt


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


On Feb. 6, 2014, 9:05 a.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3183/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2014, 9:05 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This patch tweaks the behaviour of POST /channels with channel variables such that the variables are passed into the pbx.c routines that perform the origination. This allows the variables to be assigned to the newly created channels immediately upon their construction, as opposed to be assigned after the originate has completed.
> 
> The upshot of this is that the variables are available on the channels if they execute in the dialplan, as opposed to only being available once the channels are answered.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/ari/resource_channels.c 407562 
> 
> Diff: https://reviewboard.asterisk.org/r/3183/diff/
> 
> 
> Testing
> -------
> 
> Both testsuite originate tests still pass.
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140206/0935e4f1/attachment-0001.html>


More information about the asterisk-dev mailing list