[asterisk-dev] Regression: dash a not a character any more?

Richard Mudgett rmudgett at digium.com
Tue Jan 17 14:32:23 CST 2017


On Tue, Jan 17, 2017 at 2:03 PM, Kirill Katsnelson <kkm at smartaction.com>
wrote:

> A change from 1.8 to 13 broke us in some other aspect, and I am trying to
> figure out whether this is a bug or things work as expected. In short, the
> '-' character is converted to nothing in extension "numbers"
>
> Here's a snippet that demonstrates the problem:
>
> extension.ael:
>
> context test {
>   foobar =>  Hangup();
>   foo-bar => Play(foo-bar);
> }
>
> *CLI> ael reload
> [2017-01-17 11:45:47.688] WARNING[57864]: pbx.c:6987 add_priority: Unable
> to register extension 'foo-bar' priority 1 in 'test', already in use by
> aliased extension 'foobar'
> *CLI> dialplan show test
> [ Context 'test' created by 'pbx_ael' ]
>   'foobar' =>       1. Hangup()                                   [pbx_ael]
>
> -= 1 extension (1 priority) in 1 context. =-
>
> "dialplan debug" shows the '-' is not in the trie trace at all.
>
> In 1.8, ael reloads completes without a warning, and
>
> *CLI> dialplan show test
> [ Context 'test' created by 'pbx_ael' ]
>   'foo-bar' =>      1. Play(foo-bar)                              [pbx_ael]
>   'foobar' =>       1. Hangup()                                   [pbx_ael]
>
> -= 2 extensions (2 priorities) in 1 context. =-
>
> Was the change intentional? Will you accept a patch that reintroduces the
> old behavior (with an option perhaps?). The '-' is so deeply embedded into
> all our Asterisk infrastructure (autogenerated files, AMI controllers etc.)
> that it is not realistic at this point to attempt to change the separator
> character.
>

The '-' dash has always been eye-candy and means nothing when matching
extensions.
Otherwise you would not be able to dial something like 18005551212 if you
had this as an exten:

exten = 1-800-555-1212,1,NoOp()
same = n,Playback(tt-weasels)
same = n,Hangup()

Inconsistencies in the treatment of '-' were intentionally removed so
extensions will always match.

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20170117/ea23592b/attachment.html>


More information about the asterisk-dev mailing list