[asterisk-bugs] [JIRA] (ASTERISK-26282) macro-call in Dial application

chris de rock (JIRA) noreply at issues.asterisk.org
Thu Aug 11 00:41:56 CDT 2016


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

chris de rock commented on ASTERISK-26282:
------------------------------------------

currently im using asterisk 11.13 on debian jessie and the patch for this version is:
{noformat}
--- asterisk-11.13.1~dfsg.orig/apps/app_macro.c
+++ asterisk-11.13.1~dfsg/apps/app_macro.c
@@ -303,12 +303,12 @@ static int _macro_exec(struct ast_channe
        }
 
        snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro);
-       if (!ast_exists_extension(chan, fullmacro, "s", 1,
+       if (!ast_exists_extension(chan, fullmacro, "~~s~~", 1,
                S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, NULL))) {
                if (!ast_context_find(fullmacro)) 
                        ast_log(LOG_WARNING, "No such context '%s' for macro '%s'. Was called by %s@%s\n", fullmacro, macro, ast_channel_exten(chan), ast_channel_context(chan));
                else
-                       ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
+                       ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks '~~s~~' extension, priority 1\n", fullmacro, macro);
                return 0;
        }
{noformat}

should be easy to apply this patch to other versions

> macro-call in Dial application
> ------------------------------
>
>                 Key: ASTERISK-26282
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26282
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_dial
>    Affects Versions: 13.2.0
>         Environment: Tested with asterisk versions from 1.8 to current...
>            Reporter: chris de rock
>
> The ael parser creates macros with extension '~~s~~'. If the macro is called from the Dial application, asterisk searches for extension 's' which is not existent.
> Sample:
> {noformat}
> dialplan show macro-foo3
> [ Context 'macro-foo3' created by 'pbx_ael' ]
>   '~~s~~' =>        1. NoOp(foo3)                                 [pbx_ael]
>                     2. Return()                                   [pbx_ael]
>   Include =>        'ael-builtin-h-bubble'                        [pbx_ael]
>  
> -= 1 extension (2 priorities) in 1 context. =-
> Dialplan:
> macro macro-foo3()
> {
>   NoOp(foo3);
> }
>  
> context foo2 {
>   _X. => {
>     Answer();
>     Wait(2);
>     Hangup();
>   }
> }
>  
> context foo1 {
>   _X. => {
>     Dial(LOCAL/0815 at foo2, 200, g:n:M(foo3));
>   }
> }
> {noformat}
> Console Output:
> {noformat}
>     -- Attempting call on LOCAL/0815 at foo1 for 4711 at foo1:1 (Retry 1)
>     -- Called 0815 at foo1
>     -- Executing [0815 at foo1:1] Dial("Local/0815 at foo1-00000005;2", "LOCAL/0815 at foo2, 200, g:n:M(foo3)") in new stack
>     -- Called LOCAL/0815 at foo2
>     -- Executing [0815 at foo2:1] Answer("Local/0815 at foo2-00000006;2", "") in new stack
>     -- Local/0815 at foo2-00000006;1 answered Local/0815 at foo1-00000005;2
> [Aug 10 16:17:40] WARNING[19129][C-00000003]: app_macro.c:312 _macro_exec: Context 'macro-foo3' for macro 'foo3' lacks 's' extension, priority 1
>     -- Channel Local/0815 at foo1-00000005;2 joined 'simple_bridge' basic-bridge <86f2274a-e67d-4aaa-a93c-0961fcfebbc9>
>     -- Local/0815 at foo1-00000005;1 answered
>     -- Executing [4711 at foo1:1] Dial("Local/0815 at foo1-00000005;1", "LOCAL/0815 at foo2, 200, g:n:M(foo3)") in new stack
>     -- Called LOCAL/0815 at foo2
>     -- Local/0815 at foo1-00000005;1 requested media update control 26, passing it to Local/0815 at foo2-00000007;1
>     -- Executing [0815 at foo2:1] Answer("Local/0815 at foo2-00000007;2", "") in new stack
>     -- Channel Local/0815 at foo2-00000006;1 joined 'simple_bridge' basic-bridge <86f2274a-e67d-4aaa-a93c-0961fcfebbc9>
>     -- Local/0815 at foo2-00000007;1 answered Local/0815 at foo1-00000005;1
> [Aug 10 16:17:40] WARNING[19128][C-00000004]: app_macro.c:312 _macro_exec: Context 'macro-foo3' for macro 'foo3' lacks 's' extension, priority 1
>     -- Channel Local/0815 at foo1-00000005;1 joined 'simple_bridge' basic-bridge <f5860df1-94d9-471b-ac2f-294c998f70fa>
>     -- Channel Local/0815 at foo2-00000007;1 joined 'simple_bridge' basic-bridge <f5860df1-94d9-471b-ac2f-294c998f70fa>
> {noformat}



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



More information about the asterisk-bugs mailing list