[Asterisk-Users] Scope of the "h" extension..

John Todd jtodd at loligo.com
Thu Nov 20 09:29:28 MST 2003


>I have the following setup..
>
>[extensions]
>; all extensions defined here.
>exten => 1234,....
>
>exten => 1235,....
>
>[dial-out]
>; PSTN dialout config
>ignorepat = 9
>
>exten => _9,....
>
>exten => h,....
>
>[local]
>; phone context in sip.conf is here..
>include => extensions
>include => dialout
>
>
>The question is where will the "h" extension be active?? it appears 
>to run for ALL, both internal and PSTN calls, not just the calls to 
>the PSTN.. Is that correct?? is there any way to limit it to PSTN 
>calls??
>
>Later..

No.  If you include "h" from anywhere, it gets included everywhere. 
The first one included, wins.

There are extremely ugly ways to handle that problem in the way I 
think you want it handled using Goto and include.  Essentially, 
create two contexts (one for external, and one for internal) and then 
use Goto(othercontext,${EXTEN},1) at the end of the first one if 
nothing matches.  Put the "new"  h extension definition in that new 
context.  Verrrry ugly.

I'm sure there is more than one way to address this problem, though, 
but in the 10 seconds I've thought about it, I didn't come up with 
any others.  :-)

JT



More information about the asterisk-users mailing list