[asterisk-dev] i extension does not match on initial context - bug or not?
Nir Simionovich
nir.simionovich at gmail.com
Thu Jan 8 10:19:26 CST 2009
Hmmmm....
IMHO, I don't believe that a catch all extension is something that
Asterisk should have, as it is a possible breach of security. Same as
applies to the ever dreaded _. combo.
If you need something that really goes about and requires you to match
the special characters in the front, then you can do something like this:
_[0-9*+]. this way, you have a true catch all phrase. However, it is the
programmers responsibility to verify that the catch all is implemented
correctly in the dialplan. I would rather have the dialplan exit with a
disconnect, than to have a default catch all that may introduce a
security issue.
I know this sounds a little purist, but hey, we do need to cover our
rear somehow.
Klaus Darilion wrote:
> Hi Leif and Nir!
>
> Thanks for the description.
>
> So, as obviously I (and others) try to abuse the i extension as
> catch-all, wouldn't it make sense to introduce a catch-all extension?
>
> IMO _X. is not sufficient (what about dialing +431234 or *31#, ...) and
> _. can not be used as it also matches the special extensions.
>
> regards
> Klaus
>
> Leif Madsen schrieb:
>> I do not believe this is a bug. The 'i' extension is used for invalid,
>> but not a catch all.
>>
>> By using the Goto() and sending it to an invalid extension, then the 'i'
>> is executed because a dialplan application in Asterisk tried to execute
>> something that did not exist.
>>
>> The 'i' extension is more used to control errors with logic in your
>> dialplan execution, and not so much as a 'catch-all' for when you dial
>> an extension that does not exist.
>>
>> At least this is my understanding.
>>
>> Leif Madsen.
>> http://www.leifmadsen.com
>> http://www.asteriskdocs.org
>>
>> Klaus Darilion wrote:
>>> Hi!
>>>
>>> I just stumbled about an already known problem:
>>> http://www.voip-info.org/wiki/view/Asterisk+i+extension
>>>
>>> The i extension does not match in the initial context, e.g:
>>>
>>> context fromSipPhone {
>>> 11 => {
>>> Answer();
>>> Wait(20);
>>> }
>>> i => {
>>> Playback(pbx-invalid);
>>> }
>>> }
>>>
>>> In this example, if the SIP phone dials 22, the i extension is not executed.
>>>
>>> But in this example:
>>>
>>> context fromSipPhone {
>>> _X. => goto fromSipPhoneWorkaround |${EXTEN}|1;
>>> }
>>>
>>> context fromSipPhoneWorkaround {
>>> 11 => {
>>> Answer();
>>> Wait(20);
>>> }
>>> i => {
>>> Playback(pbx-invalid);
>>> }
>>> }
>>>
>>> Here, if the SIP phone dials 22, the i extension is executed.
>>>
>>> IMO this is inconsistent behavior - and I would consider this a bug.
>>>
>>> Thus - should I open a bug report or is there a certain reason for the
>>> strange behavior?
>>>
>>> thanks
>>> klaus
>>>
>>> _______________________________________________
>>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>>
>>> asterisk-dev mailing list
>>> To UNSUBSCRIBE or update options visit:
>>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
--
Kind Regards,
Nir Simionovich
Asterisk Community Founder and Maintainer - Israel
(e) nir.simionovich at gmail.com
(w) http://www.simionovich.com
More information about the asterisk-dev
mailing list