[asterisk-bugs] [Asterisk 0013632]: [patch] Shortcut for duplicating the last extension, so the pattern doesn't need to be repeated

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Oct 10 12:57:49 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13632 
====================================================================== 
Reported By:                blitzrage
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   13632
Category:                   PBX/pbx_config
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 146799 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-06 18:42 CDT
Last Modified:              2008-10-10 12:57 CDT
====================================================================== 
Summary:                    [patch] Shortcut for duplicating the last extension,
so the pattern doesn't need to be repeated
Description: 
As discussed with Leif Madsen at Astricon, this creates a shortcut in
extensions.conf, such that the last pattern used in extensions.conf is
repeatable by defining a "same" variable.  The value of the "same" variable
starts with the corresponding priority (usually "n"), such that an example
might be:

<pre>exten => _1NXXNXXXXXX,1,NoOp(long distance number)
same =>               n,DoSomethingElse
...</pre>
====================================================================== 

---------------------------------------------------------------------- 
 (0093494) Corydon76 (administrator) - 2008-10-10 12:57
 http://bugs.digium.com/view.php?id=13632#c93494 
---------------------------------------------------------------------- 
Okay... I just tried this with:
<pre>exten => 8133,1,Answer
same =>       n,Record(8133.Wav)
same =>       n,Playback(8133)
same =>       n,Hangup</pre>
and it worked perfectly.  Let me try your dialplan.

<pre>*CLI> dialplan show complex_pattern
[ Context 'complex_pattern' created by 'pbx_config' ]
  'FLY' =>          1. Verbose(2,There's a frog on the bump on the log
that caught the fly and now the frog is sitting on the bump on the log)
[pbx_config]
                    2. Goto(lmenterprises,finish_loop)           
[pbx_config]
  '_[lL][mM][eE]nterprises' => 1. Verbose(2,We matched on this extension:
${EXTEN}) [pbx_config]
                    2. Verbose(2,Who's here? ${CALLERID(name)})  
[pbx_config]
                    3. Verbose(2,Perform a flip!)                
[pbx_config]
                    4. Set(FROG_FLIPPING=1)                      
[pbx_config]
                    5. While($[${FROG_FLIPPING} < 10])           
[pbx_config]
                    6. Verbose(2,The frog jumped!)               
[pbx_config]
                    7. Exec(${IF($[${FROG_FLIPPING} =
6]?Set(DISTRACTION=FLY):Verbose(2,Hanging out on a log))}) [pbx_config]
                    8. ExecIf($[${EXISTS(${DISTRACTION})         
[pbx_config]
                    9.
Exec(${IF($[${EXISTS(${DISTRACTION})}]?Verbose(2,This is how I would prefer
to do the fly... Exec still needs an arg?))}) [pbx_config]
                    10.
GotoIf($[${EXISTS(${DISTRACTION})}]?${DISTRACTION},1) [pbx_config]
     [finish_loop]  11. Set(FROG_FLIPPING=$[${FROG_FLIPPING} + 1])
[pbx_config]
                    12. EndWhile()                               
[pbx_config]
                    13. Verbose(2,That's all folks!)             
[pbx_config]
                    14. Hangup()                                 
[pbx_config]
</pre>
What am I missing? 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-10 12:57 Corydon76      Note Added: 0093494                          
======================================================================




More information about the asterisk-bugs mailing list