[asterisk-bugs] [JIRA] (ASTERISK-29811) func_logic IF func (acf_if) inconsistent behavior

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Tue Dec 21 06:37:44 CST 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257465#comment-257465 ] 

Richard Mudgett commented on ASTERISK-29811:
--------------------------------------------

The patch is not marked as a contribution.  Have you signed the license agreement?  Patches cannot be accepted without the license agreement signed.

> func_logic IF func (acf_if) inconsistent behavior
> -------------------------------------------------
>
>                 Key: ASTERISK-29811
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29811
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_logic
>    Affects Versions: 18.9.0
>            Reporter: Ruslan Andronov
>              Labels: patch
>         Attachments: func_logic.patch
>
>
> IF function strips quotes and slashes only from TRUE argument and FALSE argument of function stays untouched.
> h3. Proof
> Dialplan:
> {noformat}
> exten = test,1,GoSub(test_if_func,s,1)
> [test_if_func]
> exten = s,1,NoOp
>  same = n,Set(TRUEARG="abcd" \$)
>  same = n,Set(FALSEARG="gijk" \$)
>  same = n,Set(TRUERES=${IF($[1=1]?${TRUEARG}:${FALSEARG})})
>  same = n,Set(FALSERES=${IF($[1!=1]?${TRUEARG}:${FALSEARG})})
>  same = n,NoOp(TRUERES:${TRUERES} FALSERES:${FALSERES})
> {noformat}
> Log:
> {noformat}
>     -- Executing [test at from-internal:1] Gosub("PJSIP/6789-00000003", "test_if_func,s,1") in new stack
>     -- Executing [s at test_if_func:1] NoOp("PJSIP/6789-00000003", "") in new stack
>     -- Executing [s at test_if_func:2] Set("PJSIP/6789-00000003", "TRUEARG="abcd" \$") in new stack
>     -- Executing [s at test_if_func:3] Set("PJSIP/6789-00000003", "FALSEARG="gijk" \$") in new stack
>     -- Executing [s at test_if_func:4] Set("PJSIP/6789-00000003", "TRUERES=abcd $") in new stack
>     -- Executing [s at test_if_func:5] Set("PJSIP/6789-00000003", "FALSERES="gijk" \$") in new stack
>     -- Executing [s at test_if_func:6] NoOp("PJSIP/6789-00000003", "TRUERES:abcd $ FALSERES:"gijk" \$") in new stack
> {noformat}
> it seems that function __ast_app_separate_args contains a bug.
> but personally I will prefer that IF function will use AST_NONSTANDARD_RAW_ARGS macro like GotoIf and ExecIf
> suggested patch is attached



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list