Hi, I was wondering how other people might handle this situation. We have a 10 channel fractional E1 and have so far only allocated about 25 numbers out of a 100 number block (9500 - 9599). If an external caller dials an invalid extension then we would like for them to be put through to our main number. In order to make for a short and simple extensions.conf we have defined our incoming context along the lines of: exten => _123495XX,1,Dial(SIP/${EXTEN:4},16,tr) exten => _123495XX,2,Voicemail,u${EXTEN:4} exten => _123495XX,102,Voicemail,b${EXTEN:4} In order to accomodate invalid extensions we did this: exten => _123495XX,1,Dial(SIP/${EXTEN:4},16,tr) exten => _123495XX,2,Voicemail,u${EXTEN:4} exten => _123495XX,102,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?104) exten => _123495XX,103,Voicemail,b${EXTEN:4} exten => _123495XX,104,Dial(SIP/9500,20,tr) exten => _123495XX,105,Voicemail,u9500 exten => _123495XX,205,Voicemail,b9500 When I was trying to research this I pretty much found no information apart from an example using GotoIf in the 's' extension which wouldn't have been compatible with our pattern matching anyway (exten => s,1,Blah vs exten => _123495XX,1,Blah). The 'i' documentation in the wiki is less than helpful and if I read it correctly it is really only for the occasion where an extension cannot be matched. The way it is defined above we will always get a match, we will fail when there is no corresponding SIP extension defined (priority + 101) and that is where the GotoIf($[${DIALSTATUS}..) comes in. Is there any other way that we should be 'supposed' to do this functionality? Craig
> Is there any other way that we should be 'supposed' to do this > functionality?I would probably do something like this: [macro-siphandset] exten => s,1,Dial(SIP/${ARG1},16,tr) exten => s,2,Voicemail(u${ARG1}) exten => s,102,Voicemail(b${ARG1}) ; do whatever you want your normal SIP handsets to do here [extensions] exten => 950X,Macro(siphandset,${EXTEN}) exten => 951X,Macro(siphandset,${EXTEN}) exten => 9521,Macro(siphandset,${EXTEN}) exten => 9537,Macro(siphandset,${EXTEN}) exten => 9543,Macro(siphandset,${EXTEN}) ; ... ; define patterns matching all assigned extensions [inbound] ; Attempt to connect to extensions/xxxx exten => _123495XX,1,Dial(Local/${EXTEN:4}@extensions) ; Didn't work? Connect to 9500 exten => _123495XX,2,Goto(extensions,9500,1) Hope this helps. --Will Glynn Freedom Healthcare Group
Hrm:> [extensions] > exten => 950X,Macro(siphandset,${EXTEN}) > exten => 951X,Macro(siphandset,${EXTEN}) > exten => 9521,Macro(siphandset,${EXTEN}) > exten => 9537,Macro(siphandset,${EXTEN}) > exten => 9543,Macro(siphandset,${EXTEN}) > ; ... > ; define patterns matching all assigned extensions > > [inbound] > ; Attempt to connect to extensions/xxxx > exten => _123495XX,1,Dial(Local/${EXTEN:4}@extensions) > > ; Didn't work? Connect to 9500 > exten => _123495XX,2,Goto(extensions,9500,1)I guess that's a bit silly, now isn't it? :-) Let's try that again: [extensions] exten => 9500,... ; ... ; all phones here ; No patterns matched? exten => i,Goto(9500,1) [inbound] ; Unconditionally hand off to [extensions] context exten => _123495XX,Goto(extensions,${EXTEN:4},1) --Will Glynn Freedom Healthcare Group
Maybe Matching Threads
- Sip device not login or register calls to that device go to busy voicemail not un-available
- Gre Tunneling Problem
- Help troubleshooting silent failure reading huge file with read.delim
- Read Windows-like .INI files into R data structure?
- IP Security for Linux (IPSec)