Summary:ASTERISK-14369: Option U() functionality is not equivalent to application documentation
Reporter:kaldemar (kaldemar)Labels:
Date Opened:2009-06-24 10:02:42Date Closed:2011-06-07 14:00:24
Versions:Frequency of
Description:App documentation for Dial() option U() suggests that gosub calls "routine" x and arguments are delimited with ^. Instead, option U() treats x as a context and calls for extension s and priority 1 in it, and arguments are delimited with either a comma or ^.

   -- Executing [123@default:1] Dial("Console/dsp1", "Local/100@weasels,,U(context,123,arg2)") in new stack
[Jun 24 17:57:45] DEBUG[10604]: pbx.c:3179 pbx_extension_helper: Launching 'Answer'
   -- Executing [100@weasels:1] Answer("Local/100@weasels-15c7;2", "") in new stack
   -- Called 100@weasels
   -- Local/100@weasels-15c7;1 answered Console/dsp1
[Jun 24 17:57:45] DEBUG[10603]: app_stack.c:240 gosub_exec: Channel Local/100@weasels-15c7;1 has no datastore, so we're allocating one.
[Jun 24 17:57:45] DEBUG[10603]: app_stack.c:299 gosub_exec: Setting 'ARG1' to '123'
[Jun 24 17:57:45] DEBUG[10603]: app_stack.c:299 gosub_exec: Setting 'ARG2' to 'arg2'
Comments:By: Jason Parker (jparker) 2009-06-24 17:49:28

The documentation appears to be described quite accurately already.

GoSub uses a context (starting at s,1) and arguments are indeed delimited by a ^ (they are replaced in code with commas - using commas in dialplan would cause other issues).  Am I missing something?

By: kaldemar (kaldemar) 2009-06-25 01:42:38

core show application GoSub ( says

That is the way app GoSub actually works. It doesn't start at s,1 but where it is told to start. U() works in a macro manner (goes to "s,1" in given context), and does not work like GoSub.

The best solution would be to have U() work exactly like GoSub to avoid two different behaviors.

By: Leif Madsen (lmadsen) 2009-06-29 11:20:00

That is a feature request, not a documentation issue. If U() is working AS DESCRIBED then there is no issue here.