[asterisk-dev] Better pattern matching

Tzafrir Cohen tzafrir.cohen at xorcom.com
Thu Aug 2 13:26:53 CDT 2007


On Thu, Aug 02, 2007 at 10:26:09AM -0400, Leif Madsen wrote:

> 2) The ability to have an alias or shortcut to say, "use the previous pattern 
> match", similar to the 'n' priority (or rather, the 's' priority), so I can 
> write a complex pattern match, BUT only have to write it on the first 
> priority
> 
> exten => nancy|jim|james,1,NoOp()
> exten => p,n,Verbose(1|My current EXTEN is ${EXTEN})
> exten => p,n,Playback(silence/1&tt-weasels)
> exten => p,n,Hangup()

A different approach to that problem:

#define local_folks nancy|jim|james

exten => local_folks,n,Verbose(1|My current EXTEN is ${EXTEN})
exten => local_folks,n,Playback(silence/1&tt-weasels)
exten => local_folks,n,Hangup()

I sometime find the n priority still confusing and unintuitive, Though 
that "p" is not auto-incrementing and hence less confusing.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list