[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
Thu Oct 9 20:34:36 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13632 
====================================================================== 
Reported By:                blitzrage
Assigned To:                blitzrage
====================================================================== 
Project:                    Asterisk
Issue ID:                   13632
Category:                   PBX/pbx_config
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
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-09 20:34 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>
====================================================================== 

---------------------------------------------------------------------- 
 (0093445) blitzrage (administrator) - 2008-10-09 20:34
 http://bugs.digium.com/view.php?id=13632#c93445 
---------------------------------------------------------------------- 
With a standard Asterisk I get:

    -- Added extension '_[lL][mM][eE]nterprises' priority 1 to
complex_pattern
[Oct  9 21:43:14] WARNING[3656]: pbx_config.c:1511;40m pbx_load_config:
==!!== Unknown directive: same at line 425 -- IGNORING!!!

But I get no such error with the patched version. However it only seems to
load the first extension:

development*CLI> dialplan show complex_pattern 
[ Context 'complex_pattern' created by 'pbx_config' ]
  'FLY' =>          1. Verbose(2|Theres 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]
  '_[lL][mM][eE]nterprises' => 1. Verbose(2|We matched on this extension:
${EXTEN}) [pbx_config]

-= 2 extensions (2 priorities) in 1 context. =-


And here is the dialplan I'm testing:

[complex_pattern]
exten => _[lL][mM][eE]nterprises,1,Verbose(2,We matched on this extension:
${EXTEN})
same => n,Verbose(2,Who's here? ${CALLERID(name)})
same => n,Verbose(2,Perform a flip!)
same => n,Set(FROG_FLIPPING=1)
same => n,While($[${FROG_FLIPPING} < 10])
same => n,Verbose(2,The frog jumped!)
same => n,Exec(${IF($[${FROG_FLIPPING} =
6]?Set(DISTRACTION=FLY):Verbose(2,Hanging out on a log))})
same => n,ExecIf($[${EXISTS(${DISTRACTION})}],Verbose,2\,OMG A FLY!
same => n,Exec(${IF($[${EXISTS(${DISTRACTION})}]?Verbose(2,This is how I
would prefer to do the fly... Exec still needs an arg?))})
same => n,GotoIf($[${EXISTS(${DISTRACTION})}]?${DISTRACTION},1)
same => n(finish_loop),Set(FROG_FLIPPING=$[${FROG_FLIPPING} + 1])
same => n,EndWhile()
same => n,Verbose(2,That's all folks!)
same => n,Hangup()

exten => 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)
same => n,Goto(lmenterprises,finish_loop) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-09 20:34 blitzrage      Note Added: 0093445                          
======================================================================




More information about the asterisk-bugs mailing list