[asterisk-dev] [Code Review] 4101: Channel Originate/Continue via ARI support for labels in dialplan is incomplete
Joshua Colp
reviewboard at asterisk.org
Wed Nov 5 07:27:37 CST 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4101/#review13688
-----------------------------------------------------------
/trunk/res/ari/resource_channels.c
<https://reviewboard.asterisk.org/r/4101/#comment24182>
We don't use the atol/atoi family of functions as it does not detect errors. We use sscanf instead, an example being:
int priority;
if (sscanf(args->priority, "%30d", &priority) != 1) {
ast_log(LOG_NOTICE, "This is not an integer\n");
}
This applies to the two places you've used atol.
/trunk/res/ari/resource_channels.c
<https://reviewboard.asterisk.org/r/4101/#comment24184>
This should be removed or made into a better debug message using ast_debug
/trunk/res/ari/resource_channels.c
<https://reviewboard.asterisk.org/r/4101/#comment24183>
It would be good to have error checking here as well. As it is if the label isn't found it'll likely originate, send it to -1, and then the call will immediately drop. Instead of placing the call in the first place having it error out provides a better experience and makes it easier for a developer using this to debug what is going on.
- Joshua Colp
On Nov. 2, 2014, 1:25 p.m., greenfieldtech wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4101/
> -----------------------------------------------------------
>
> (Updated Nov. 2, 2014, 1:25 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-24412
> https://issues.asterisk.org/jira/browse/ASTERISK-24412
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> This patch changes the current behavior of ARI, to allow channel originate/continue requests to be performed with labels as the priority, not only integer values.
>
>
> Diffs
> -----
>
> /trunk/rest-api/api-docs/channels.json 425359
> /trunk/res/res_ari_channels.c 425359
> /trunk/res/ari/resource_channels.c 425359
> /trunk/res/ari/resource_channels.h 425359
>
> Diff: https://reviewboard.asterisk.org/r/4101/diff/
>
>
> Testing
> -------
>
> Testing was performed by testing the following scenarios:
> 1. Originating a call to a numeric priority - works
> 2. Originating a call to a null priority - works
> 3. Originating a call to a label - works
> 4. Continue a call to a label - not tested yet
>
>
> Thanks,
>
> greenfieldtech
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141105/e93e43df/attachment-0001.html>
More information about the asterisk-dev
mailing list