[asterisk-dev] i extension does not match on initial context - bug or not?

Benny Amorsen benny+usenet at amorsen.dk
Sat Jan 10 17:46:46 CST 2009


Tzafrir Cohen <tzafrir.cohen at xorcom.com> writes:

> On Fri, Jan 09, 2009 at 11:51:26AM +0100, Benny Amorsen wrote:

>> I am not sure what to do about it though. A start would be to forbid
>> patterns from matching the special extensions, so that you could use
>> _h to match h exactly, without matching hangup.
>
> This (or the 'special =>' suggested below) would be a problem for someone 
> who actually needs both normal and the special extensions to match on
> some specific extension. 

Yes. Goto and Gosub to a special extension would be a problem too.

>> Another nice thing would be to get rid of some of the reasons why
>> people use e.g. h. My favourite would be to always record HANGUPCAUSE
>> in the CDR's, without having to use exten =>
>> h,1,Set(CDR(hangupcause)=${HANGUPCAUSE})
>
> What about 'i' ?
>
> What about 't' ? 

You can't get rid of the special extensions completely that way, but I
do think they are a bit overused and that Asterisk could just do the
right thing by default in most cases.

Another idea would be to add a function:

Set(SPECIALEXTEN(h)=hangupcontext,${EXTEN},1)

and then jump into ${SPECIALEXTEN(h)} instead of simply h.


/Benny




More information about the asterisk-dev mailing list